/** This contains calculations for UT1 and UT2. These are time corrections for DeltaT: DeltaT = 32.184 s + (TAI-UTC) - (UT1-UTC) TT = TAI + 32.184 s Where TAI-UTC can be obtained from the function TAIMinusUTC[date] The primary source of UT1-UTC corrections is IERS Bulletin A, found at: https://www.iers.org/IERS/EN/DataProducts/EarthOrientationData/eop.html as well as: https://maia.usno.navy.mil/products/deltaT TODO: Parse either IERS Bulletin A or the maia.usno.navy.mil predictions although they are in a hodgepodge non-computer-parseable format. Otherwise the equations here will have to be periodically updated from the ones published in IERS Bulletin A. */ // This is just to get the definition of BesselianDate. Should probably be // made into a native Frink function. use sun.frink /** Return (UT2-UT1). This equation is found at the top of IERS Bulletin A. */ UT2MinusUT1[date] := { T = BesselianDate[date] return (0.022 sin[2 pi T] - 0.012 cos[2 pi T] - 0.006 sin[4 pi T] + 0.007 cos[4 pi T]) s } /** This uses the extrapolating equation from IERS Bulletin A which states "The following formulas will not reproduce the predictions given below, but may be used to extend the predictions beyond the end of this table." LOL. For more accuracy in the short term, this value should be interpolated from the values published in IERS Bulletin A. */ UT1MinusUTC[date] := { return (-0.0385 + 0.00029 (MJD[date]/days - 59950)) s - UT2MinusUT1[date] }