Spec: topocentric positions of the Sun and the Moon #10
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jeff/zig-astro#10
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem Statement
Everything zig-astro computes today is geocentric: where the Sun and the Moon appear from the Earth's center. Nobody stands there. For the Moon the difference is large: its parallax reaches about 1°, two of its own diameters, so a geocentric position cannot say whether the Moon is above a given horizon, which way to point a telescope, or when an occultation happens. Nor can the library answer the questions an observer asks first — how high is the Moon, and in which direction — because it has no sidereal time, no notion of an observer, and no horizontal coordinates. Someone wanting them would have to do the work themselves, at exactly the places such code goes wrong: longitude counted west where east was meant, azimuth from south where north was meant, geodetic latitude mistaken for geocentric, UT confused with TT in the Earth's rotation, and refraction applied or not without saying which.
Solution
zig-astro adds topocentric positions — apparent positions as seen by an observer on the Earth's surface — for the Sun and the Moon, and the machinery beneath them, built generically so that the planets and satellites to come use it unchanged:
The library's conventions follow the IAU and WGS 84 rather than Meeus where the two differ (ADR 0003).
User Stories
Implementation Decisions
equatorial,ecliptic,hour_angle,horizontalanddistance_km. Parallax uses the rigorous formulas (eqs. 40.6 and 40.7), not the approximations; the ecliptic coordinates follow Meeus's topocentric ecliptic method (ch. 40) or are converted from the topocentric equatorial ones with the true obliquity. The hour angle is local apparent sidereal time minus right ascension, topocentric.Testing Decisions
astromodule only, from the test directory, as the existing ones do; no internal hooks are added.Out of Scope
Further Notes
Changed from this spec while working #14: refraction below −1° airless is held at its value there (as Horizons does) rather than zeroed below −2°, and the inverse, airless from observed, inverts Sæmundsson's formula exactly rather than using Bennett's. See #14 and
0c94159.