utils/SSEphem/astrtime.cc
void utc2ut0 (long mjd, double utc, long &ut0_mjd, double &ut0)
{
    long ut1_mjd = ut0_mjd = mjd;
    double ut1;
    utc2ut1(mjd, utc, ut1_mjd, ut1);
    
    double x, y;
    if (!get_pole_offsets(mjd, utc, x, y)) {
	ut0 = ut1;
	return;
    }
    x /= 1296000.0;		// convert arcseconds into days
    y /= 1296000.0;
    double lon = get_observatory_longitude();
    double lat = get_observatory_geoc_latitude();
    ut0 = ut1 + tan(lat) * (x * sin(lon) + y * cos(lon));
    ut0_mjd = ut1_mjd;
    if (ut0 < 0.0) {
	ut0 += 1.0;
	ut0_mjd--;
    }
    if (ut0 > 1.0) {
	ut0 -= 1.0;
	ut0_mjd++;
    }
}
// UT0 is an observatory-specific version of UT1 in the sense that UT0
// contains the effect of polar motion on the observed rotation of the earth
// with respect to a non-rotating reference as defined by distand radio
// sources.  Normally UT1 is derived from UT0 by making the polar motion
// correction, but in the context of this set of routines we can infer our
// local UT0 from UTC and the published UT1-UTC offset by adding the polar
// offset in reverse.  From page 253 of the Explanatory Supplement to the
// Astronomical Almanac (1992)
//     UT0 = UT1 + tan(lat) * (x * sin(long) + y * cos(long))
// where x and y are the published pole offsets, and lat and long are the
// observatory's station coordinates.
UT0 is an observatory-specific version of UT1 in the sense that UT0
contains the effect of polar motion on the observed rotation of the earth
with respect to a non-rotating reference as defined by distand radio
sources.  Normally UT1 is derived from UT0 by making the polar motion
correction, but in the context of this set of routines we can infer our
local UT0 from UTC and the published UT1-UTC offset by adding the polar
offset in reverse.  From page 253 of the Explanatory Supplement to the
Astronomical Almanac (1992)
UT0 = UT1 + tan(lat) * (x * sin(long) + y * cos(long))
where x and y are the published pole offsets, and lat and long are the
observatory's station coordinates.
UT0 is an observatory - specific version of UT1 in the sense that UT0 contains the effect of polar motion on the observed rotation of the earth with respect to a non - rotating reference as defined by distand radio sources . Normally UT1 is derived from UT0 by making the polar motion correction but in the context of this set of routines we can infer our local UT0 from UTC and the published UT1 - UTC offset by adding the polar offset in reverse . From page 253 of the Explanatory Supplement to the Astronomical Almanac ( 1992 ) UT0 = UT1 + tan ( lat ) * ( x * sin ( long ) + y * cos ( long )) where x and y are the published pole offsets and lat and long are the observatory ' s station coordinates .
void utc2ut0 (long mjd, double utc, long &ut0_mjd, double &ut0)
{
    long ut1_mjd = ut0_mjd = mjd;
    double ut1;
    utc2ut1(mjd, utc, ut1_mjd, ut1);
    double x, y;
    if (!get_pole_offsets(mjd, utc, x, y)) {
	ut0 = ut1;
	return;
    }
    x /= 1296000.0;		
    y /= 1296000.0;
    double lon = get_observatory_longitude();
    double lat = get_observatory_geoc_latitude();
    ut0 = ut1 + tan(lat) * (x * sin(lon) + y * cos(lon));
    ut0_mjd = ut1_mjd;
    if (ut0 < 0.0) {
	ut0 += 1.0;
	ut0_mjd--;
    }
    if (ut0 > 1.0) {
	ut0 -= 1.0;
	ut0_mjd++;
    }
}
void utc2ut0 ( long mjd , double utc , long & ut0_mjd , double & ut0 ) { long ut1_mjd = ut0_mjd = mjd ; double ut1 ; utc2ut1 ( mjd , utc , ut1_mjd , ut1 ) ; double x , y ; if ( ! get_pole_offsets ( mjd , utc , x , y ) ) { ut0 = ut1 ; return ; } x /= 1296000.0 ; y /= 1296000.0 ; double lon = get_observatory_longitude ( ) ; double lat = get_observatory_geoc_latitude ( ) ; ut0 = ut1 + tan ( lat ) * ( x * sin ( lon ) + y * cos ( lon ) ) ; ut0_mjd = ut1_mjd ; if ( ut0 < 0.0 ) { ut0 += 1.0 ; ut0_mjd -- ; } if ( ut0 > 1.0 ) { ut0 -= 1.0 ; ut0_mjd ++ ; } }
UT0 is an observatory-specific version of UT1 in the sense that UT0
contains the effect of polar motion on the observed rotation of the earth
with respect to a non-rotating reference as defined by distand radio
sources.
UT0 is an observatory - specific version of UT1 in the sense that UT0 contains the effect of polar motion on the observed rotation of the earth with respect to a non - rotating reference as defined by distand radio sources .
// convert arcseconds into days