Need to calculate moonrise time based on a date and location #86
-
|
Hi guys, i am trying to get moonrise time using the $moon object, which function will give me the moon data, i already have the following code working great. |
Beta Was this translation helpful? Give feedback.
Answered by
WimDeMeester
Mar 13, 2023
Replies: 1 comment
-
|
Does something like this work? $astrolib = \App\Models\Astrolib::getInstance()->getAstronomyLibrary();
$geo_coords = new GeographicalCoordinates($longitude,$latitude);
// Calculate the Equatorial Coordinates of the Moon
$moondate = Carbon::create($year, $month, $day, $hour);
$moon = new Moon();
$greenwichSiderialTime = deepskylog\AstronomyLibrary\Time::apparentSiderialTimeGreenwich($moondate->subDay());
$deltaT = $astrolib->getDeltaT();
$moon = new \deepskylog\AstronomyLibrary\Targets\Moon();
$heightOfLocation = 10; // In meters
$moon->calculateEquatorialCoordinates($moondate, $geo_coords, $heightOfLocation);
$moon->calculateEphemerides($geo_coords, $greenwichSiderialTime, $deltaT);
// getTransit and getSetting also work
$moon->getRising()->timezone($location->timezone)->format('H:i');
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
WimDeMeester
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does something like this work?