Skip to content

v0.1.0 — first release

Choose a tag to compare

@nseaSeb nseaSeb released this 28 Jul 06:48
· 6 commits to main since this release
e8b01e6

Agricultural sun & moon calendar for Elixir — pure arithmetic, zero runtime dependencies, no time zone database required unless you ask for local times.

From a geolocation, a date or a period and an optional elevation:

  • Sun — rise, solar noon, set, time above the horizon, rise/set azimuths, civil / nautical / astronomical twilights
  • Moon — rise, transit, set, phase, illuminated fraction, distance, declination
  • The three independent lunar cycles agricultural calendars rely on, kept distinct: waxing/waning (illumination), ascending/descending (declination — the one biodynamic sowing calendars use), perigee/apogee (distance)
  • Exact instants of everything a printed calendar marks with a symbol: phases (with an eclipse screening flag), perigees/apogees, node crossings, lunar standstills
  • Constellations — equal-sector sidereal zodiac (Lahiri) by default, or the real unequal IAU boundaries with boundaries: :iau, the convention printed biodynamic calendars use

Why it is built this way

Rise/set uses a numeric search, not the closed-form hour-angle formula: the latter assumes a constant declination and can be more than 15 minutes off for the Moon. Crossings shorter than the sampling step are caught by probing the culmination, so a 55-minute polar day is found rather than reported as polar night.

UT and TT are kept apart and converted in one place. ΔT uses observed IERS values over 2000–2026 (the Espenak & Meeus 2005–2050 branch overshoots by ~6 s in 2026), the polynomials before, and a documented extrapolation after.

Degenerate cases are reported, not faked:always_above / :always_below, and a nil moonrise on the ~1 day per month the Moon does not rise.

Astronomy and tradition are labelled apart. Rise/set times, phases and declination trends are validated against published references; elements, organs and sowing days are presented as the tradition they are.

Validation

  • Meeus, Astronomical Algorithms (2nd ed.), examples 7.1, 12.a/b, 22.a, 25.a, 28.b, 47.a — the complete chapter 47 tables reproduce 47.a to 0.13″ in longitude and 0.03 km in distance
  • USNO rise/set API for moonrise/moonset at Paris, Sydney and Edinburgh — within 30 s, their own rounding
  • Published 2026 phase instants; all four 2026 eclipses found by the screening flag, no false positive over the year
  • Property tests and physical invariants

94 tests and 5 properties, green on Elixir 1.15, 1.17 and 1.19.

Not yet on Hex — see CHANGELOG.md for the full entry.