Skip to content

Add HorizontalTransformation to convert many points at once - #317

Merged
rhannequin merged 1 commit into
mainfrom
claude/astronoby-feature-314-6ff7d6
Oct 31, 2026
Merged

rhannequin merged 1 commit into
mainfrom
claude/astronoby-feature-314-6ff7d6

Conversation

@rhannequin

@rhannequin rhannequin commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Closes #314

Converting many points for one observer and one instant with DeepSkyObject#at(instant).observed_by(observer).horizontal rebuilds the reference frames and the sidereal time for each point. HorizontalTransformation computes the nutation and precession rotation and the local apparent sidereal time once, then apply converts equatorial coordinates at J2000 epoch to horizontal coordinates. A point takes about 4 µs instead of about 280 µs.

The result is the one of a DeepSkyObject without an ephemeris: fixed directions, with no aberration, proper motion or parallax. refraction: is optional, and coordinates that are not at J2000 epoch raise IncompatibleArgumentsError.

Based on #316, as the two paths only agree once nutation is applied after precession there. To be retargeted to main once it is merged.

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

No active review issues remain for the reusable J2000-to-horizontal coordinate transformation.

No open issues 🎉

What changed in this PR

Adds Astronoby::HorizontalTransformation to speed up repeated conversions of J2000 equatorial coordinates for a fixed observer and instant, addressing #314 without rebuilding reference frames for every point.

Changes:

  • Precomputes the combined nutation/precession rotation and local apparent sidereal time.
  • Supports optional refraction and rejects non-J2000 coordinates.
  • Adds reference-frame equivalence tests and documents usage and limitations.
File Description
spec/​astronoby/​horizontal_transformation_spec.rb Tests coordinate equivalence, refraction, epoch validation, and object properties.
lib/​astronoby/​horizontal_transformation.rb Implements the reusable coordinate transformation.
lib/​astronoby.rb Loads the new class through the library entry point.
docs/​deep_sky_bodies.md Explains repeated conversions with an example and limitations.
CHANGELOG.md Announces the feature and its reported performance improvement.

Review effort: Balanced

Base automatically changed from claude/astronoby-issue-313-validation-e22673 to main October 31, 2026 20:27
@rhannequin
rhannequin force-pushed the claude/astronoby-feature-314-6ff7d6 branch from a93f6f6 to 49d6257 Compare October 31, 2026 20:29
@rhannequin
rhannequin merged commit 2335d93 into main Oct 31, 2026
44 checks passed
@rhannequin
rhannequin deleted the claude/astronoby-feature-314-6ff7d6 branch October 31, 2026 20:33
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.

Convert many points to horizontal coordinates without recomputing the sky each time

2 participants