106 Commits

Author SHA1 Message Date
1e9d856a39 Add astrolock reply: v0.18.0 Tiers 1+2 integrated 2026-02-28 03:41:20 -07:00
c31f282cf8 Add v0.18.0 astrolock integration thread, message 001
Opens agent thread for astrolock to integrate 10 new functions:
saturn_ring_tilt, penumbral eclipse (4), rise/set event windows (3),
angular separation rate (2). Notes three items from v0.17.0's
"not in this release" are now addressed.
2026-02-27 23:53:38 -07:00
b309980003 Add v0.18.0: Saturn ring tilt, penumbral eclipse, rise/set windows, angular rate
Four features, 10 new SQL functions (174 → 184 objects), 29 test suites:

Saturn ring tilt: saturn_ring_tilt() exposes sub-observer latitude B'.
planet_magnitude() for Saturn now includes Mallama & Hilton Eq. 10
ring correction (-2.60|sin B'| + 1.25 sin²B'), removing the ~1.5 mag
globe-only caveat. IAU 2000 pole direction, ecliptic J2000 projection.

Conical shadow model: Replaces cylindrical shadow with umbra/penumbra
cones using Sun's finite angular size. Four new functions:
satellite_in_penumbra(), satellite_shadow_state(),
satellite_next_penumbra_entry/exit(). Existing eclipse functions are
backward compatible via narrower (more accurate) umbra boundary.

Rise/set event windows: Three SRFs returning TABLE(event_time, event_type)
for all rise/set events within a time window — planet_rise_set_events(),
sun_rise_set_events(), moon_rise_set_events(). Follows predict_passes()
SRF pattern. Optional refracted parameter, 366-day window limit.

Angular separation rate: Vincenty formula extracted to reusable helper.
eq_angular_rate() for generic finite-difference rate, planet_angular_rate()
for solar system body convenience (1-minute dt, handles Sun/planets/Moon).
2026-02-27 23:52:06 -07:00
08a5cdf994 Confirm night quality fix, Tier 2 fully operational
All three Tier 2 features verified: eclipse clipping, night quality, lunar libration.
2026-02-27 15:17:01 -07:00
cdc030b1d3 Add message 008: observing_night_quality fix shipped, Docker updated 2026-02-27 13:23:25 -07:00
76b4e449c7 Fix observing_night_quality: use topo_elevation() accessor, not .elevation composite 2026-02-27 13:22:09 -07:00
ae8deae67e Add astrolock Tier 1 + Tier 2 integration thread replies
Tier 1: eclipse fraction, solar elongation, planet phase
Tier 2: eclipse clipping, night quality, lunar libration

Reports observing_night_quality() bug (.elevation vs topo_elevation)
2026-02-27 13:21:20 -07:00
2e424f2867 Add message 006: confirm Tier 1, eclipse clipping guidance, perf notes 2026-02-26 23:13:34 -07:00
333493a609 Add message 004: v0.17.0 tagged, Docker image pushed to registry 2026-02-26 20:09:03 -07:00
bbfed58d81 Add message 003: answer TLE reuse, eclipse cost, body_id error questions v0.17.0 2026-02-26 19:56:38 -07:00
3d13f44cbd Reply to pg_orrery v0.17.0 announcement with integration plan
Three-tier plan: elongation+phase+eclipse in existing SQL (immediate),
observing_night_quality as secondary signal (next), lunar libration in
new Moon detail section (later). Questions on TLE CTE reuse and eclipse
fraction compute cost.
2026-02-26 19:39:21 -07:00
dc52b844b3 Add message 001: v0.17.0 available for astrolock integration 2026-02-26 19:36:52 -07:00
22b272fd0c Implement v0.17.0: solar elongation, planet phase, satellite eclipse, observing night quality, lunar libration
162 → 174 SQL objects, 27 → 28 test suites, 3 new C source files.

Features:
- solar_elongation(body_id, ts): Sun-Earth-Planet angle [0,180] degrees
- planet_phase(body_id, ts): illuminated disk fraction [0,1]
- satellite_is_eclipsed/next_eclipse_entry/exit/eclipse_fraction:
  cylindrical shadow model (Vallado §5.3) for Earth shadow prediction
- observing_night_quality(observer, ts): composite PL/pgSQL scoring
  based on astronomical darkness duration and Moon interference
- moon_libration_longitude/latitude/position_angle/libration/subsolar_longitude:
  optical libration from Meeus (1998) Ch. 53

Refactored magnitude_funcs.c to extract shared compute_planet_geometry()
used by magnitude, elongation, and phase — single VSOP87 evaluation per call.

All 28 regression suites pass. Zero compiler warnings.
2026-02-26 18:47:30 -07:00
557f94364d Add message 006: All tiers live, v0.16.0 fully integrated 2026-02-26 17:37:01 -07:00
085d27adb3 Add message 005: Mercury magnitude fix shipped, full polynomial model 2026-02-26 17:24:22 -07:00
9949af738d Fix planet_magnitude: use full Mallama & Hilton (2018) polynomials
The original implementation only used c1+c2 coefficients from the
simplified model. Mercury's 6th-order polynomial diverges badly
beyond ~60 deg phase angle with only 2 terms — returning -23 mag
at 130 deg (should be +1.1).

Now uses the complete piecewise models from the paper:
- Mercury: full 6th-order polynomial (Eq. 1)
- Venus: piecewise at 163.7 deg (Eq. 2/3)
- Mars: piecewise at 50 deg (Eq. 5/6)
- Jupiter: piecewise at 12 deg with log term (Eq. 7/8)
- Saturn: globe-only model (Eq. 11/12), ring tilt still not modeled
- Uranus: phase threshold at 3.1 deg (Eq. 14)
- Neptune: phase threshold at 1.9 deg (Eq. 17)

Bug found by astrolock: Mercury at superior conjunction (i=130.6 deg)
returned -23.3 mag instead of +1.1.
2026-02-26 17:23:44 -07:00
9eaff060ab Add message 004: Tier 1 live, Mercury edge case, proceeding to Tier 2/3 2026-02-26 17:17:24 -07:00
beb1b97c23 Add message 003: confirm integration plan, answer Saturn/moon_age questions 2026-02-26 13:05:30 -07:00
11d0f95324 Reply to v0.16.0 thread: integration plan for twilight, lunar phase, planet magnitude 2026-02-26 13:04:51 -07:00
0851d2d171 Add message 001: v0.16.0 available for astrolock integration
Twilight (6 functions), lunar phase (4 functions), planet
apparent magnitude (1 function). 151 -> 162 SQL objects.
2026-02-26 13:01:42 -07:00
46c8a30575 Add v0.16.0: twilight dawn/dusk, lunar phase, planet apparent magnitude
Twilight: 6 functions (civil/nautical/astronomical × dawn/dusk) reusing
the existing find_next_crossing() bisection search with Sun depression
angle thresholds (-6°, -12°, -18°). Returns NULL for polar regions
where the threshold is never reached.

Lunar phase: 4 functions computing Sun-Earth-Moon geometry from VSOP87
+ ELP2000-82B. Phase angle [0,360) via elongation + cross product
z-component for waxing/waning discrimination. 8 named phases in 45°
bins. Moon age approximated from phase angle and mean synodic month.

Planet magnitude: Mallama & Hilton (2018) polynomial model with VSOP87
heliocentric distances and phase angle via law of cosines. All 7
planets (Mercury-Neptune, excluding Earth). Saturn ring tilt not
modeled.

151 → 162 SQL objects. 26 → 27 test suites, all passing.
v0.16.0
2026-02-26 12:42:01 -07:00
e670ed7ed1 Add rise/set and constellation guides, remove stale TODO
Two new workflow guides covering v0.13.0–v0.15.0 features:
- Rise/set prediction: geometric vs refracted, NULL contract, extreme latitudes
- Constellation identification: composability chains, catalog enrichment, zodiac

Remove docs/TODO-v0.10.0.md (5 versions stale, all Tier 1–2 items shipped).
2026-02-26 12:29:45 -07:00
e4589715bd Update docs for v0.15.0: rise/set reference page, llms.txt, sidebar 2026-02-25 20:48:40 -07:00
8159b949b1 Add message 011: astrolock deploy blocked, needs merge to main 2026-02-25 20:48:35 -07:00
fe61428b96 Add message 013: v0.15.0 integration confirmed in astrolock 2026-02-25 20:36:57 -07:00
4bc03e7c0d Add message 012: main merged, pushed, tagged — deploy unblocked 2026-02-25 19:41:40 -07:00
14fc7c14c1 Add message 010: v0.15.0 available with constellation full name and rise/set status 2026-02-25 19:39:44 -07:00
501872d45d v0.15.0: constellation full name lookup, rise/set status diagnostics
constellation_full_name(text) returns full IAU name from 3-letter
abbreviation (88-entry static table, IMMUTABLE). Returns NULL for
invalid input — composable with constellation() in queries.

Three rise_set_status functions classify body visibility as
'rises_and_sets', 'circumpolar', or 'never_rises' by sampling
elevation at 48 points across 24h. Separate diagnostic path —
called only when rise/set returns NULL, zero cost in normal case.

147 → 151 SQL objects. 25 → 26 regression suites. All pass.
v0.15.0
2026-02-25 19:38:52 -07:00
e720e0fd25 Add message 009: v0.14.0 integration confirmed, v0.15.0 plan for astrolock 2026-02-25 19:11:17 -07:00
d45636c275 Add message 008: v0.14.0 available with refracted rise/set and constellation ID 2026-02-25 17:57:17 -07:00
8ca4383b2e v0.14.0: refracted planet/moon rise/set, constellation identification
Add 4 refracted rise/set functions completing the rise/set feature set:
- planet_next_rise/set_refracted: -0.569 deg threshold (refraction only,
  point source — even Jupiter at opposition is only 24 arcsec)
- moon_next_rise/set_refracted: -0.833 deg threshold (refraction +
  mean semidiameter, same as Sun)

Add IAU constellation identification from Roman (1987) CDS VI/42:
- 357 boundary segments covering all 88 constellations
- Precesses J2000 coordinates to B1875.0 epoch for lookup
- Two overloads: constellation(equatorial) and constellation(float8, float8)
- IMMUTABLE (compiled-in static data)

141 -> 147 SQL objects. 24 -> 25 regression suites. All 25 pass.
v0.14.0
2026-02-25 17:02:08 -07:00
55c0bf6b8b Add message 007: v0.13.0 live, NULL contract confirmed, frontend next 2026-02-25 14:41:49 -07:00
3e8da3a88e Add message 006: confirm NULL contract for polar edges, Phase 4 apparent guidance 2026-02-25 14:40:01 -07:00
5168e445f3 Add message 005: v0.13.0 tagged, refraction default guidance for astrolock 2026-02-25 13:55:43 -07:00
c11afa5ead Add message 004: astrolock v0.13.0 integration plan for all three features 2026-02-25 13:54:23 -07:00
7149c21949 Add message 003: v0.13.0 delivers all three astrolock-requested features 2026-02-25 13:53:26 -07:00
a349f5505a Add v0.13.0: nutation, make_equatorial constructor, rise/set predictions
Integrate IAU 2000B nutation (~9 arcsec) into the solar system observation
pipeline via precess_and_nutate_j2000_to_date(). Affects all planet, star,
moon, and small body RA/Dec and az/el values. Satellite SGP4/TEME pipeline
unchanged.

Add make_equatorial(ra_hours, dec_deg, distance_km) constructor to replace
error-prone text literal casts.

Add 8 rise/set prediction functions (planet_next_rise/set, sun_next_rise/set,
moon_next_rise/set, sun_next_rise/set_refracted) using bisection algorithm
adapted from satellite pass prediction. Returns NULL for circumpolar and
polar night edge cases.

Fix DE fallback test fragility: replace exact float equality with tolerance
comparisons to handle GCC LTO inlining divergence across translation units.

132 -> 141 SQL objects. 22 -> 24 regression suites. All 24 passing.
v0.13.0
2026-02-25 13:53:22 -07:00
d9d01242bd Add message 002: astrolock-web popup is first frontend KNN consumer 2026-02-25 13:18:44 -07:00
54b424fc73 Add v0.12.0 release thread with milestone summary 2026-02-25 13:05:01 -07:00
a152e392bb Fix MDX parse error: escape angle bracket in polar regions text 2026-02-25 13:04:32 -07:00
cc30fc2b21 Update docs and CLAUDE.md for v0.12.0
CLAUDE.md: bump version to 0.12.0, function count to 132, test count
to 22, add v0.10-0.12 SQL files to layout, add gist_equatorial.c,
update function domains table, add DE moon equatorial to DE variants.

Docs: add equatorial GiST operator class section to operators-gist.mdx
(KNN queries, cone search, RA wrapping, polar behavior). Add 4 DE moon
equatorial functions to functions-de.mdx (galilean, saturn, uranus, mars).
2026-02-25 11:57:36 -07:00
662841b748 Add message 008: v0.12.0 implemented, integration instructions for astrolock v0.12.0 2026-02-24 13:15:38 -07:00
84ce1f1b8d Add v0.12.0: equatorial GiST operator class + DE moon equatorial functions
Feature A: GiST index for equatorial type with KNN ordering (<-> strategy 15).
24-byte float-precision spherical bounding box, RA-wrapping aware merge/split,
Vincenty lower-bound distance for correct KNN pruning. Apollo-hardened with
epsilon-widened bounds, circular-aware picksplit, compile-time size assertions.

Feature B: 4 new DE moon equatorial functions (galilean_equatorial_de,
saturn_moon_equatorial_de, uranus_moon_equatorial_de, mars_moon_equatorial_de).
Same-provider rule enforced, transparent VSOP87 fallback.

120 -> 132 SQL objects. 22 regression suites passing.
2026-02-24 13:15:34 -07:00
608370c746 Add message 007: v0.11.0 tagged, v0.12.0 roadmap preview 2026-02-23 14:40:27 -07:00
3906023ade Harden v0.11.0 constructors: NaN/Inf guards, expanded error path tests
- Add validate_orbital_elements_args() with isnan/isinf checks for all
  7 propagation parameters (epoch, q, e, inc, omega, node, tp); h_mag
  and g_slope exempt (NaN is valid sentinel for "unknown magnitude")
- Deduplicate validation between make_orbital_elements() and _deg()
- Update SQL COMMENTs to clarify geometric vs apparent coordinates
- Add NaN/Inf rejection tests (q, e, epoch, Inf inclination)
- Add NaN H/G acceptance test (sentinel value)
- Expand error path coverage to all 4 moon families + negative body_id
- All 20 regression suites pass
2026-02-23 14:25:43 -07:00
ce59a5ce72 Add message 006: v0.11.0 integration confirmed
Constructors and galilean_equatorial() deployed to both environments.
Zero NULL RA/Dec remaining. Ready to tag v0.11.0.
2026-02-23 14:20:13 -07:00
7c76ffc76c Track astrolock message 004: v0.10.0 comet RA/Dec + proximity queries 2026-02-23 14:07:56 -07:00
9158c7c55a Add v0.11.0: make_orbital_elements constructors + moon equatorial functions
6 new SQL functions (114 -> 120):
- make_orbital_elements(): construct from 9 floats, angles in radians
- make_orbital_elements_deg(): same with angles in degrees, matches
  text I/O convention and typical catalog column layouts
- galilean_equatorial(): geocentric RA/Dec for Io/Europa/Ganymede/Callisto
- saturn_moon_equatorial(): geocentric RA/Dec for Mimas through Hyperion
- uranus_moon_equatorial(): geocentric RA/Dec for Miranda through Oberon
- mars_moon_equatorial(): geocentric RA/Dec for Phobos/Deimos

Constructors requested by astrolock-api to replace fragile
format(9 args)::orbital_elements cast pattern. Moon equatorial
functions fill the last NULL RA/Dec gaps in their unified sky query.

All 20 regression suites pass.
2026-02-23 14:07:39 -07:00
be7e28e2b6 Update docs for v0.10.0: benchmarks, Skyfield parity, LLM references
- Add timing numbers for equatorial, aberration, angular distance,
  refraction, and star proper motion+parallax to benchmarks page
- Update From Skyfield page: v0.10.0 now has light-time + aberration
  parity; remaining gap narrowed to nutation (~9 arcsec) and polar motion
- Update llms.txt and llms-full.txt for 114 functions, new DE apparent
  variants, equatorial spatial operators, and aberration/parallax notes
2026-02-21 22:00:52 -07:00
db1f478e4f Update CLAUDE.md for v0.10.0, gitignore bench catalogs, add roadmap
- CLAUDE.md: 106 -> 114 functions, 18 -> 19 test suites, add aberration
  suite, DE apparent variants, equatorial spatial domain to tables
- .gitignore: ignore downloaded TLE catalogs in bench/ (alpha5, celestrak,
  satnogs, spacetrack, supgp, mega/merged, cookies)
- docs/TODO-v0.10.0.md: rewrite as post-v0.10.0 roadmap with next version
  candidates (make_orbital_elements, galilean_equatorial, equatorial GiST
  index, nutation, Delta T, rise/set)
- Track bench/build_catalog.py and agent thread message 001
2026-02-21 21:52:05 -07:00