Astro version 2.0
Breaking changes
-
Rename
Astro.Solar.solar_longitude/1toAstro.Solar.solar_ecliptic_longitude/1andAstro.Lunar.lunar_longitude/1toAstro.Lunar.lunar_ecliptic_longitude/1to use unambiguous astronomical terminology. -
Rename
Astro.Lunar.new_moon/0toAstro.Lunar.new_moon_phase/0,Astro.Lunar.full_moon/0toAstro.Lunar.full_moon_phase/0,Astro.Lunar.first_quarter/0toAstro.Lunar.first_quarter_phase/0, andAstro.Lunar.last_quarter/0toAstro.Lunar.last_quarter_phase/0to clarify that these return phase angle constants. -
Rename
Astro.Time.utc_datetime_from_terrestrial_datetime/1toAstro.Time.utc_datetime_from_dynamical_datetime/1to reflect the standard "dynamical time" terminology used in modern astronomical references. -
Rename functions in
Astro.Timethat had names including "datetime" and consistently use the form "date_time". -
Astro.Time.offset_for_zone/2now returns{:ok, offset}or raises if there is an error resolving an offset. That can happen if the time zone is unknown, if there is no time in the zone or if the result is ambiguous due to DST shift. -
Astro.obliquity/0now returns its value in degrees (was previously radians). The only impact is to code that directly calls this function. -
Astro.Earth.nutation/1now returns a 3-tuple{nutation_in_longitude, nutation_in_obliquity, obliquity}instead of a single scalar value. The first element in the tuple has the same purpose as the return value of the original function. However its value may be slightly different due to the new underlying algorithms. -
Astro.moon_position_at/1now returns distance to the Moon in kilometres instead of metres. -
Astro.sunrise/3andAstro.sunset/3now delegate toAstro.Solar.SunRiseSetwhich computes solar positions from the JPL DE440s numerical ephemeris rather than the previous NOAA/Meeus analytical polynomial series, and uses a scan-and-bisect solver rather than the previous iterative analytical formula. -
Improved ΔT (delta-T) computation now uses variable ΔT based on IERS observations (1972–2025) and Meeus polynomial approximations for historical dates, replacing the previous fixed ΔT value. This improves the accuracy of all astronomical calculations but changes computed times for equinoxes, solstices, new moons, and lunar phases by up to ~22 seconds compared to version 1.x.
-
Sunrise/sunset and moonrise/moonset bisection tolerance tightened from 1.0 second to 0.01 seconds, yielding sub-second precision.
-
Remove
Astro.Solar.sun_rise_or_set/3andAstro.Solar.utc_sun_position/4(the old NOAA/Meeus sunrise/sunset implementation). These functions were previously@doc falseand are superseded byAstro.Solar.SunRiseSet.
Enhancements
-
Add
Astro.moonrise/3andAstro.moonset/3to compute moonrise and moonset times for a given location and date. -
Add
Astro.date_time_new_moon_nearest/1which returns the new moon nearest to a given date or datetime. -
Add
Astro.Lunar.date_time_new_moon_nearest/1(takes a moment parameter). -
Add
Astro.Time.date_from_julian_days/1to convert Julian Day Numbers toDatestructs. -
Add new
Astro.Solar.SunRiseSetmodule implementing sunrise/sunset via JPL DE440s ephemeris and scan-and-bisect solver with configurable bisection tolerance. -
Add new
Astro.Lunar.MoonRiseSetmodule implementing fully topocentric moonrise/moonset via JPL DE440s ephemeris and scan-and-bisect solver with configurable bisection tolerance. -
Add new
Astro.Coordinatesmodule for coordinate system conversions. -
Add new types
Astro.radians/0,Astro.astronomical_units/0, andAstro.kilometers/0. -
Improved documentation with greater explanation of some of the key astronomical concepts.