Deep Sky Object: Compute astrometric position#217
Conversation
86f6c49 to
a3813b4
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR introduces support for deep sky objects such as stars, galaxies, clusters, and nebulae in Astronoby. The implementation focuses on computing astrometric positions from J2000 equatorial coordinates with optional proper motion, parallax, and radial velocity corrections.
Key changes:
- Adds
DeepSkyObjectclass for handling celestial objects with astrometric positioning - Implements
StellarPropagationfor computing propagated positions with proper motion corrections - Introduces
AngularVelocityclass for handling proper motion measurements
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/astronoby/bodies/deep_sky_object.rb | Core DeepSkyObject class with astrometric positioning |
| lib/astronoby/stellar_propagation.rb | Stellar propagation calculations for proper motion corrections |
| lib/astronoby/angular_velocity.rb | New AngularVelocity class for proper motion measurements |
| lib/astronoby/angle.rb | Added degree_milliarcseconds method and constant fixes |
| lib/astronoby/constants.rb | Added astronomical constants for stellar calculations |
| lib/astronoby/distance.rb | Added parsec unit support |
| lib/astronoby/velocity.rb | Added astronomical units per day velocity support |
| spec/astronoby/bodies/deep_sky_object_spec.rb | Comprehensive tests for DeepSkyObject functionality |
| spec/astronoby/stellar_propagation_spec.rb | Tests for stellar propagation calculations |
| spec/astronoby/angular_velocity_spec.rb | Tests for AngularVelocity class |
| spec/astronoby/angle_spec.rb | Tests for new degree_milliarcseconds method |
| lib/astronoby.rb | Updated require statements for new modules |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
3805378 to
025ba55
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
lib/astronoby/constants.rb:1
- The constant
MINUTES_PER_DEGREEhas been removed but is still referenced in the angle.rb file at lines 146 and 149. This will cause a NameError when the code is executed.
# frozen_string_literal: true
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
dd59369 to
2612764
Compare
2612764 to
4f86015
Compare
## 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 is the first piece for handling deep sky objects such as stars, galaxies, clusters, nebulae, etc.
Disclaimer: For now, Astronoby won't store the initial data of these objects. Depending on the used catalogues, there could be between hundreds and billions of objects. The Messier catalogue has 110 objects, the NGC contains 7840 objects, the Hipparcos catalogue has 118218 objects and the Gaia DR3 contains 1.8 billion sources.
Also, each catalogue might expose data differently, which would increase complexity for Astronoby.
In the future, it is possible Astronoby wold make it easier to fetch data from external data sources. We'll see.
This first piece handle astrometric position of deep sky objects.
What
Given J2000 equatorial coordinates and optionally additional attributes, a
DeepSkyObjectobject is instantiated and exposes theastrometricmethod, which, the same way as for solar system bodies, describes the astrometric reference frame of the object.How
J2000 equatorial coordinates can be found on the internet, the suggested source is the SIMBAD Astronomical Database.
If only
instantandequatorial_coordinateskey arguments are provided, Astronoby will simply instantiate the object with no transformation.If the following optional key attributes are provided, Astronoby will compute the propagated astrometric position which applies correction of the object's proper motion:
proper_motion_ra(Astronoby::AngularVelocity): object's proper motion in right ascensionproper_motion_dec(Astronoby::AngularVelocity): object's proper motion in declinationparallax(Astronoby::Angle): stellar parallaxradial_velocity(Astronoby::Velocity): variation over time of the object's velocityExample
Vega (Alpha Lyrae) data coming from SIMBAD: https://simbad.u-strasbg.fr/simbad/sim-basic?Ident=vega
Precision
Compared to other astronomy libraries such as Astropy or Skyfield, when provided the additional coordinates, the precision provided is below 10th of an arcsecond.
As you can see on the example below, the different in right ascension is around 0.4 hour arcseconds, while the difference in declination is around 7 degree arcseconds.
None of these differences can be seen with a naked eye and extremely hard to notice in an amateur telescope even with great magnification. But still, precision up to professional standards can be achieved.
Velocity
On this first version, the astrometric velocity is mathematically right but astronomically wrong.
Astronoby currently computed the object's intrinsic velocity, which is related to its actual motion. In Astronoby, an astrometric position is geocentric, which means the astrometric velocity is supposed to be observer-relative and corrected with the Earth's own motion in the Solar System.
To reduce the complexity and because an ephemeride would be necessary, I decided to only compute the intrinsic velocity for now and I will see how I could fix it in the future when
DeepSkyObjectwill support apparent and topocentric positions.