You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Internally, there is a mix up between the J1900 reference and the J2000 reference. Specifically, the J2000_TO_J1900_DURATION constant is a duration of 36524 days 12 h but it should be 36525 days, i.e. a duration of one century exactly.
As pointed out in #281, the J2000 reference epoch is at noon not at midnight as that specific constant points to.
This bug affects only this constant, and does not affect the external API. This is because the constant is only used in the time system conversions to ET and TDB which are validated against NAIF SPICE. Other conversions that rely on the Julian epochs use the J1900_OFFSET and J2000_OFFSET constants, which fix that twelve hour difference. In other words, this constant fixes the glitch introduced by the reference epoch being wrong by twelve hours.
Example
use hifitime::{Epoch,TimeUnits,J1900_REF_EPOCH,J2000_REF_EPOCH,J2000_TO_J1900_DURATION};#[test]fndiscuss(){println!("{J2000_TO_J1900_DURATION}");println!("{}", Epoch::from_utc_duration(0_f64.nanoseconds()));println!("{}",
Epoch::from_utc_duration(0_f64.nanoseconds()).to_jde_utc_days());println!("{}",
Epoch::from_jde_tai(2451545.0).to_gregorian_str(hifitime::TimeScale::TAI));println!("{}",
J1900_REF_EPOCH.to_gregorian_str(hifitime::TimeScale::TAI));println!("{}",
J2000_REF_EPOCH.to_gregorian_str(hifitime::TimeScale::TAI));}
Output
36524 days 12 h // --> This should be 36525 days exactly
1900-01-01T00:00:00 UTC
2415020.5 // --> A zero duration UTC should be J1900 exactly, whose Julian date is 2415020.0
2000-01-01T12:00:00 TAI // --> This matches SPICE J2000: https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/FORTRAN/spicelib/j2000.html
1900-01-01T00:00:00 TAI // --> Wrong by twelve hours
2000-01-01T12:00:00 TAI // --> Correct
test discuss ... ok
Fix acceptance
This issue should deprecate this constant entirely, and remove its usage in the code base.
The J1900 reference epoch should be corrected so that an initialization at zero duration returns noon on 01 Jan 1900 instead of midnight. (Maybe?)
This bug is directly related to the test failed in #280 and #261.
The text was updated successfully, but these errors were encountered:
Slight correction: the 20th century, i.e. from 1900 to 2000, only had 36524 days because 1900 was not a leap year. The definition of one century is 36525 days.
Internally, there is a mix up between the J1900 reference and the J2000 reference. Specifically, the
J2000_TO_J1900_DURATION
constant is a duration of36524 days 12 h
but it should be36525 days
, i.e. a duration of one century exactly.As pointed out in #281, the J2000 reference epoch is at noon not at midnight as that specific constant points to.
This bug affects only this constant, and does not affect the external API. This is because the constant is only used in the time system conversions to ET and TDB which are validated against NAIF SPICE. Other conversions that rely on the Julian epochs use the J1900_OFFSET and J2000_OFFSET constants, which fix that twelve hour difference. In other words, this constant fixes the glitch introduced by the reference epoch being wrong by twelve hours.
Example
Output
Fix acceptance
This bug is directly related to the test failed in #280 and #261.
The text was updated successfully, but these errors were encountered: