-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce observation events for Moon (#86)
Like the Sun, the Moon is a candidate for events defined in `Astronoby::Events::ObservationEvents`, such as rising, transit and setting times, or rising and setting azimuths, or transit altitude. This adds `Astronoby::Moon#observation_events` method, with an `observer` as parameter. This change also refactors how observation events are computed, introducing a loop to increase precision, as explained in _Astronomical Algorithms_. From a few tests, the error margin with the IMCCE is around 2 minutes maximum. ```rb time = Time.utc(2024, 5, 31) observer = Astronoby::Observer.new( latitude: Astronoby::Angle.zero, longitude: Astronoby::Angle.zero ) moon = Astronoby::Moon.new(time: time) observation_events = moon.observation_events(observer: observer) observation_events.rising_time # => 2024-05-31 00:29:50 UTC observation_events.transit_time # => 2024-05-31 06:41:22 UTC observation_events.setting_time # => 2024-05-31 12:52:48 UTC observation_events.rising_azimuth.str(:dms) # => "+98° 47′ 20.2285″" observation_events.transit_altitude.str(:dms) # => "+83° 2′ 9.8145″" observation_events.setting_azimuth.str(:dms) # => "+264° 35′ 11.0134″" ```
- Loading branch information
1 parent
c274ceb
commit 34334fd
Showing
9 changed files
with
491 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.