Module: IERS::DeltaT
- Defined in:
- lib/iers/delta_t.rb
Defined Under Namespace
Classes: Entry
Class Method Summary collapse
-
.at(input = nil, jd: nil, mjd: nil) ⇒ Entry
DeltaT (TT − UT1) in seconds with source metadata.
Class Method Details
.at(input = nil, jd: nil, mjd: nil) ⇒ Entry
Returns DeltaT (TT − UT1) in seconds with source metadata.
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/iers/delta_t.rb', line 61 def at(input = nil, jd: nil, mjd: nil) query_mjd = TimeScale.to_mjd(input, jd: jd, mjd: mjd) y = mjd_to_decimal_year(query_mjd) if y < EARLIEST_YEAR raise OutOfRangeError.new( "DeltaT is only available from #{EARLIEST_YEAR.to_i} onward", requested_mjd: query_mjd ) end if query_mjd < PRE_1972_MJD Entry.new( delta_t: polynomial_delta_t(y), mjd: query_mjd, source: :estimated ) else tai_utc = LeapSecond.at(mjd: query_mjd) ut1_utc = UT1.at(mjd: query_mjd).ut1_utc Entry.new( delta_t: tai_utc + TimeScale::TT_TAI - ut1_utc, mjd: query_mjd, source: :measured ) end end |