Refraction #14

Closed
opened 2026-10-23 20:43:44 -05:00 by jeff · 1 comment
Owner

Part of #10

Parent

#10

What to build

Refraction as an explicit step between the airless altitude and the observed altitude: a function from airless to observed (Sæmundsson, eq. 16.4) and its inverse (Bennett, eq. 16.3), both scaled by an Atmosphere of pressure in millibars and temperature in °C that defaults to 1010 mb and 10 °C. Refraction is zero well below the horizon; the cutoff, about −2° of airless altitude, is fixed by finding where Horizons stops refracting.

Acceptance criteria

  • The worked examples of ch. 16 pass to the printed precision
  • Airless altitude plus refraction agrees with Horizons' refracted elevation for the Sun and the Moon from all three sites
  • Properties: refraction is never negative, zero below the cutoff, greatest near the horizon; Bennett inverts Sæmundsson to within the agreement measured and recorded; non-finite input gives NaN
  • A fuzz target over altitude, pressure and temperature
  • Every new public declaration has a doc comment giving units, time scale and reference frame, and citing the chapter and equation of Meeus it implements
  • Every Horizons tolerance is set only after measuring, with the worst error recorded beside it
  • Every source used is in the README's references cited
  • zig build test, zig build check, zig fmt --exclude zig-pkg --check . and reuse lint pass

Blocked by

Part of #10 ## Parent #10 ## What to build **Refraction** as an explicit step between the **airless altitude** and the **observed altitude**: a function from airless to observed (Sæmundsson, eq. 16.4) and its inverse (Bennett, eq. 16.3), both scaled by an `Atmosphere` of pressure in millibars and temperature in °C that defaults to 1010 mb and 10 °C. Refraction is zero well below the horizon; the cutoff, about −2° of airless altitude, is fixed by finding where Horizons stops refracting. ## Acceptance criteria - [ ] The worked examples of ch. 16 pass to the printed precision - [ ] Airless altitude plus refraction agrees with Horizons' refracted elevation for the Sun and the Moon from all three sites - [ ] Properties: refraction is never negative, zero below the cutoff, greatest near the horizon; Bennett inverts Sæmundsson to within the agreement measured and recorded; non-finite input gives NaN - [ ] A fuzz target over altitude, pressure and temperature - [ ] Every new public declaration has a doc comment giving units, time scale and reference frame, and citing the chapter and equation of Meeus it implements - [ ] Every Horizons tolerance is set only after measuring, with the worst error recorded beside it - [ ] Every source used is in the README's references cited - [ ] `zig build test`, `zig build check`, `zig fmt --exclude zig-pkg --check .` and `reuse lint` pass ## Blocked by - #13
jeff self-assigned this 2026-10-23 21:17:17 -05:00
jeff referenced this issue from a commit 2026-10-23 21:45:54 -05:00
jeff closed this issue 2026-10-23 21:45:54 -05:00
Author
Owner

Done in 0c94159. Two decisions from the spec changed, both settled with Jeff during the work: below −1° airless, refraction is held at 38.80′, as Horizons holds it, rather than zeroed; and airlessAltitude is the exact inverse of Sæmundsson's formula (Newton's method) rather than Bennett's, because once refraction is scaled for non-standard air the two part by minutes of arc near the horizon. Against Horizons both directions agree to 0.00001″.

Done in 0c94159. Two decisions from the spec changed, both settled with Jeff during the work: below −1° airless, refraction is **held** at 38.80′, as Horizons holds it, rather than zeroed; and `airlessAltitude` is the exact inverse of Sæmundsson's formula (Newton's method) rather than Bennett's, because once refraction is scaled for non-standard air the two part by minutes of arc near the horizon. Against Horizons both directions agree to 0.00001″.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Depends on
Reference
jeff/zig-astro#14
No description provided.