Repository navigation
Add HorizontalTransformation to convert many points at once - #317
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 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
force-pushed
the
claude/astronoby-feature-314-6ff7d6
branch
from
October 31, 2026 20:29
a93f6f6 to
49d6257
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #314
Converting many points for one observer and one instant with
DeepSkyObject#at(instant).observed_by(observer).horizontalrebuilds the reference frames and the sidereal time for each point.HorizontalTransformationcomputes the nutation and precession rotation and the local apparent sidereal time once, thenapplyconverts 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
DeepSkyObjectwithout an ephemeris: fixed directions, with no aberration, proper motion or parallax.refraction:is optional, and coordinates that are not at J2000 epoch raiseIncompatibleArgumentsError.Based on #316, as the two paths only agree once nutation is applied after precession there. To be retargeted to
mainonce it is merged.