Deep Sky Object: Compute apparent position#220
Merged
rhannequin merged 1 commit intomainfrom Oct 20, 2025
Merged
Conversation
2612764 to
4f86015
Compare
a0fc3cd to
c1a4c70
Compare
c1a4c70 to
fbedc28
Compare
Merged
rhannequin
added a commit
that referenced
this pull request
Oct 31, 2025
## 0.9.0 - 2025-10-31 _If you are upgrading: please see [UPGRADING.md]._ ### Features * Add `#approaching_primary?` and `#receding_from_primary?` to solar system bodies ([#211]) * Calculate apoapsis and periapsis events ([#213]) * Improve precision of ΔT ([#219]) * Deep Sky Object: Compute astrometric position ([#217]) * Deep Sky Object: Compute apparent position ([#220]) * Deep Sky Object: Handle velocities properly ([#222]) * Deep Sky Object: Compute topocentric position ([#226]) * Deep Sky Object: difference between the body and the position ([#227]) * Deep Sky Object: Add support for RiseTransitSetCalculator ([#228]) ### Improvements * Drop `Astronoby::Apparent#angular_diameter` ([#221]) * Bump rubyzip from 3.0.2 to 3.2.1 by @dependabot ([#210], [#215], [#223], [#233]) * Bump standard from 1.50.0 to 1.51.1 by @dependabot ([#212], [#214]) * Be proud about the precision achieved ([#218]) * Use local apparent instead of local mean sidereal time for hour angle ([#225]) * Bump rspec from 3.13.1 to 3.13.2 by @dependabot ([#229]) * Bump benchmark from 0.4.1 to 0.5.0 by @dependabot ([#230]) * Add documentation for deep-sky objects ([#232]) * Bump rake from 13.3.0 to 13.3.1 by @dependabot ([#235]) ### Backward-incompatible changes * Drop `Astronoby::Apparent#angular_diameter` ([#221]) * Use local apparent instead of local mean sidereal time for hour angle ([#225]) **Full Changelog**: v0.8.0...v0.9.0 [#210]: #210 [#211]: #211 [#212]: #212 [#213]: #213 [#214]: #214 [#215]: #215 [#217]: #217 [#218]: #218 [#219]: #219 [#220]: #220 [#221]: #221 [#222]: #222 [#223]: #223 [#225]: #225 [#226]: #226 [#227]: #227 [#228]: #228 [#229]: #229 [#230]: #230 [#232]: #232 [#233]: #233 [#235]: #235 [UPGRADING.md]: https://github.com/rhannequin/astronoby/blob/main/UPGRADING.md
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.
This supports the apparent position of a deep sky object.
How it works
There are three levels of precision for the apparent position, depending on how the object has been initialized:
With
ephemand proper motion attributesWhen computing the rotation from an
astrometricto anapparentposition, some corrections applied depend on the Earth's velocity at the given instant. Providingephemallows to apply aberration correction. Same for the proper motion attributes (proper_motion_ra,proper_motion_dec,parallax,radial_velocity), which allow to apply some position correction when provided.With only
ephemIn this case, the proper motion of the object won't be applied to correct the position, but the aberration correction (which depends on the Earth's velocity) will be applied.
With no
ephemnor proper motion attributesIn this case, only the precession and nutation will be applied to the initial J2000 coordinates.
Why supporting 3 different initialization?
The first reason is that only stars have proper motion data available. When creating a
DeepSkyObjectinstance for a cluster or a nebulae, most of the time there will be no proper motion data available to apply.The second reason is that, as you can see above, the difference between a fully corrected position and a position with no aberration nor proper motion corrections is very similar.
I want Astronoby to provide maximum accuracy, but I also want users who don't require maximum to benefit from great performance and simplicity.
One use case is calculating rising and setting times for a deep sky object. Because most deep sky objects are quite large (at least several arcminutes), a difference of a few arcseconds between a corrected position and not fully corrected position won't drastically change the compute times. In that case, it can be beneficial to use a simpler a more performant initialization.
Precision
Apparent equatorial coordinates are less than 1 arcsecond different from Skyfield and less than a few arcseconds different from Astropy, Stellarium and SkySafari.