Skip to content

feat: improve the solar transit for the apparent hour angle in night module in @observerly/astrometry - #550

Merged
michealroberts merged 1 commit into
mainfrom
feature/night/getSolarTransit
Sep 3, 2026
Merged

feat: improve the solar transit for the apparent hour angle in night module in @observerly/astrometry#550
michealroberts merged 1 commit into
mainfrom
feature/night/getSolarTransit

Conversation

@michealroberts

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The behavioral change is consistently applied in the implementation and tests, and the only noted concern is a non-blocking maintainability improvement (shared helper extraction).

Pull request overview

This PR updates the night/solar-transit calculations to resolve solar transit and horizon-crossing events using the Sun’s apparent hour angle (LAST-based), aligning the night module’s behavior with how apparent solar right ascension is defined and improving conformance to SPA references.

Changes:

  • Switch getSolarTransit()/isNight() to use apparent-hour-angle-based solar altitude evaluation (including refraction correction) instead of convertEquatorialToHorizontal().
  • Update expected timestamps in tests/night.spec.ts to match the refined event resolution.
  • Tighten SPA conformance expectations for refined solar-noon residuals by reducing MERIDIAN_TRANSIT_TOLERANCE.
File summaries
File Description
src/night.ts Computes apparent solar altitude from apparent hour angle and uses it in getSolarTransit() and isNight() to refine event timing.
tests/night.spec.ts Updates expected sunrise/noon/sunset/night timestamps and adjusts altitude cross-checking to match the new apparent-hour-angle basis.
tests/conformance/spa.spec.ts Updates documentation and tightens the refined meridian-transit tolerance to reflect improved alignment.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/night.ts
Comment on lines +36 to +41
const getApparentSolarAltitude = (
datetime: Date,
observer: GeographicCoordinate,
temperature: number,
pressure: number
): number => {
@michealroberts
michealroberts merged commit a054cb0 into main Sep 3, 2026
6 checks passed
@michealroberts
michealroberts deleted the feature/night/getSolarTransit branch September 3, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants