Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference between true and apparent ecliptic and equatorial coordinates #41

Merged
merged 2 commits into from
Mar 29, 2024

Conversation

rhannequin
Copy link
Owner

I found it hard to compare the results on this library with different sources like the IMCCE, NASA JPL, Heavens Above, etc.

The main reason is the difference of meaning of coordinates. Regarding the Sun, for example, books like Practical Astronomy or Celestial Calculations provide algorithms to calculate coordinates to the date (current epoch). There are in fact different definitions of coordinates:

  • Mean coordinates for standard epoch J2000
  • Apparent coordinates for standard epoch J2000
  • Mean coordinates for the date's epoch
  • Apparent coordinates for the date's epoch

While we already have a way to convert equatorial coordinates from one epoch to another, the current algorithms I have access to will provide only Sun ecliptic coordinates for the date's epoch.

I can still manage to make the difference between true and apparent coordinates, which is the purpose of this change.

This change removes Astronoby::Sun#ecliptic_coordinates and Astronoby::Coordinates::Ecliptic#to_equatorial in favour of the following:

  • Astronoby::Sun#true_ecliptic_coordinates: true coordinates
  • Astronoby::Sun#apparent_ecliptic_coordinates: include corrections for nutation and aberration
  • Astronoby::Coordinates::Ecliptic#to_true_equatorial: true equatorial coordinates for the date
  • Astronoby::Coordinates::Ecliptic#to_apparent_equatorial: include corrections for true obliquity
time = Time.utc(1988, 7, 27, 0, 0, 0)
epoch = Astronoby::Epoch.from_time(time)

true_ecliptic_coordinates = Astronoby::Sun.new(epoch: epoch).true_ecliptic_coordinates
true_equatorial_coordinates = ecliptic_coordinates.to_true_equatorial(epoch: epoch)

true_equatorial_coordinates.right_ascension.str(:hms)
# => "8h 26m 3.6131s"

true_equatorial_coordinates.declination.str(:dms)
=> "+19° 12′ 43.1836″"

apparent_ecliptic_coordinates = Astronoby::Sun.new(epoch: epoch).apparent_ecliptic_coordinates
apparent_equatorial_coordinates = ecliptic_coordinates.to_apparent_equatorial(epoch: epoch)

apparent_equatorial_coordinates.right_ascension.str(:hms)
# => "8h 26m 3.7342s"

apparent_equatorial_coordinates.declination.str(:dms)
# => "+19° 12′ 50.2238″"

As you can see the difference is very subtle, but my goal is to provide accurate data and more importantly accurate concepts. I know this library still suffers from some approximations, but I aim to correct this problems over time.

@rhannequin rhannequin self-assigned this Mar 27, 2024
@rhannequin rhannequin merged commit ac70a87 into main Mar 29, 2024
8 checks passed
@rhannequin rhannequin deleted the ecliptic-equatorial-true-apparent-coordinates branch March 29, 2024 15:13
rhannequin added a commit that referenced this pull request Mar 29, 2024
 ## 0.3.0 - 2024-03-29

_If you are upgrading: please see [`UPGRADING.md`]._

 ### Improvements

* Drop `Angle#==` ([#42])
* Improved accuracy with Sun's location predictions ([#41])

 ### Breaking changes

* **breaking:** Difference between true and apparent ecliptic and equatorial
  coordinates ([#41])
* **breaking:** Rename `Angle::as_*` into `Angle::from_*` ([#43])

[#41]: #41
[#42]: #42
[#43]: #43
rhannequin added a commit that referenced this pull request Mar 29, 2024
 ## 0.3.0 - 2024-03-29

_If you are upgrading: please see [`UPGRADING.md`]._

 ### Improvements

* Drop `Angle#==` ([#42])
* Improved accuracy with Sun's location predictions ([#41])

 ### Breaking changes

* **breaking:** Difference between true and apparent ecliptic and equatorial coordinates ([#41])
* **breaking:** Rename `Angle::as_*` into `Angle::from_*` ([#43])

[#41]: #41
[#42]: #42
[#43]: #43
rhannequin added a commit that referenced this pull request Mar 29, 2024
 ## 0.3.0 - 2024-03-29

_If you are upgrading: please see [`UPGRADING.md`]._

 ### Improvements

* Drop `Angle#==` ([#42])
* Improved accuracy with Sun's location predictions ([#41])

 ### Breaking changes

* **breaking:** Difference between true and apparent ecliptic and equatorial coordinates ([#41])
* **breaking:** Rename `Angle::as_*` into `Angle::from_*` ([#43])

[#41]: #41
[#42]: #42
[#43]: #43
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.

1 participant