dateutil.c   dateutil.c 
skipping to change at line 56 skipping to change at line 56
jd = Julian Date jd = Julian Date
lt = Local time lt = Local time
mjd = modified Julian Date = JD - 2400000.5 mjd = modified Julian Date = JD - 2400000.5
ofd = FITS date string (dd/mm/yy before 2000, else no return) ofd = FITS date string (dd/mm/yy before 2000, else no return)
time = use fd2* with no date to convert time as hh:mm:ss.ss to sec, day, y ear time = use fd2* with no date to convert time as hh:mm:ss.ss to sec, day, y ear
ts = UT seconds since 1950-01-01T00:00 (used for ephemeris computations) ts = UT seconds since 1950-01-01T00:00 (used for ephemeris computations)
tsi = local seconds since 1980-01-01T00:00 (used by IRAF as a time tag) tsi = local seconds since 1980-01-01T00:00 (used by IRAF as a time tag)
tsu = UT seconds since 1970-01-01T00:00 (used as Unix system time) tsu = UT seconds since 1970-01-01T00:00 (used as Unix system time)
tsd = UT seconds of current day tsd = UT seconds of current day
ut = Universal Time (UTC) ut = Universal Time (UTC)
et = Ephemeris Time (or TDB or TT) et = Ephemeris Time (or TDB or TT) = TAI + 32.184 seconds
tai = International Atomic Time (Temps Atomique International) = ET - 32.
184 seconds
gps = GPS time = TAI - 19 seconds
mst = Mean Greenwich Sidereal Time mst = Mean Greenwich Sidereal Time
gst = Greenwich Sidereal Time (includes nutation) gst = Greenwich Sidereal Time (includes nutation)
lst = Local Sidereal Time (includes nutation) (longitude must be set) lst = Local Sidereal Time (includes nutation) (longitude must be set)
hjd = Heliocentric Julian Date hjd = Heliocentric Julian Date
mhjd = modified Heliocentric Julian Date = HJD - 2400000.5 mhjd = modified Heliocentric Julian Date = HJD - 2400000.5
* ang2hr (angle) * ang2hr (angle)
* Convert angle in decimal floating point degrees to hours as hh:mm:ss .ss * Convert angle in decimal floating point degrees to hours as hh:mm:ss .ss
* ang2deg (angle) * ang2deg (angle)
* Convert angle in decimal floating point degrees to degrees as dd:mm: ss.ss * Convert angle in decimal floating point degrees to degrees as dd:mm: ss.ss
skipping to change at line 125 skipping to change at line 127
* fd2et (string) * fd2et (string)
* Convert from UT in FITS format to ET (or TDT or TT) in FITS format * Convert from UT in FITS format to ET (or TDT or TT) in FITS format
* jd2jed (dj) * jd2jed (dj)
* Convert from Julian Date to Julian Ephemeris Date * Convert from Julian Date to Julian Ephemeris Date
* jed2jd (dj) * jed2jd (dj)
* Convert from Julian Ephemeris Date to Julian Date * Convert from Julian Ephemeris Date to Julian Date
* dt2et (date, time) * dt2et (date, time)
* Convert date (yyyy.ddmm) and time (hh.mmsss) to ephemeris time * Convert date (yyyy.ddmm) and time (hh.mmsss) to ephemeris time
* edt2dt (date, time) * edt2dt (date, time)
* Convert ephemeris date (yyyy.ddmm) and time (hh.mmsss) to UT * Convert ephemeris date (yyyy.ddmm) and time (hh.mmsss) to UT
* dt2tai (date, time)
* Convert date (yyyy.ddmm) and time (hh.mmsss) to TAI date and time
* tai2dt (date, time)
* Convert TAI date (yyyy.ddmm) and time (hh.mmsss) to UT
* ts2ets (tsec) * ts2ets (tsec)
* Convert from UT in seconds since 1950-01-01 to ET in same format * Convert from UT in seconds since 1950-01-01 to ET in same format
* ets2ts (tsec) * ets2ts (tsec)
* Convert from ET in seconds since 1950-01-01 to UT in same format * Convert from ET in seconds since 1950-01-01 to UT in same format
* *
* fd2ep, fd2epb, fd2epj (string) * fd2ep, fd2epb, fd2epj (string)
* Convert FITS date string to fractional year * Convert FITS date string to fractional year
* Convert time alone to fraction of Besselian year * Convert time alone to fraction of Besselian year
* fd2doy (string, year, doy) * fd2doy (string, year, doy)
* Convert FITS standard date string to year and day of year * Convert FITS standard date string to year and day of year
skipping to change at line 1919 skipping to change at line 1925
else if (iyr < 2900.0) else if (iyr < 2900.0)
sprintf (string, "%02d/%02d/%3d %02d:%02d:%6.3f", sprintf (string, "%02d/%02d/%3d %02d:%02d:%6.3f",
iday, imon, iyr-1900, ihr, imn, sec); iday, imon, iyr-1900, ihr, imn, sec);
else else
sprintf (string, "*** date out of range ***"); sprintf (string, "*** date out of range ***");
return (string); return (string);
} }
/* TAI-UTC from the U.S. Naval Observatory */ /* TAI-UTC from the U.S. Naval Observatory */
/* ftp://maia.usno.navy.mil/ser7/tai-utc.dat */ /* ftp://maia.usno.navy.mil/ser7/tai-utc.dat */
static double taijd[23]={2441317.5, 2441499.5, 2441683.5, 2442048.5, 244241 3.5, static double taijd[26]={2441317.5, 2441499.5, 2441683.5, 2442048.5, 244241 3.5,
2442778.5, 2443144.5, 2443509.5, 2443874.5, 2444239.5, 2444786 .5, 2442778.5, 2443144.5, 2443509.5, 2443874.5, 2444239.5, 2444786 .5,
2445151.5, 2445516.5, 2446247.5, 2447161.5, 2447892.5, 2448257 .5, 2445151.5, 2445516.5, 2446247.5, 2447161.5, 2447892.5, 2448257 .5,
2448804.5, 2449169.5, 2449534.5, 2450083.5, 2450630.5, 2451179 2448804.5, 2449169.5, 2449534.5, 2450083.5, 2450630.5, 2451179
.5}; .5,
static double taidt[23]={10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0, 2453736.5, 2454832.5, 2456293.5};
20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0,28.0,29.0,30.0,31.0,32.0} static double taidt[26]={10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,
; 20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0,28.0,29.0,30.0,31.0,32.0,
33.0,34.0,35.0};
static double dttab[173]={13.7,13.4,13.1,12.9,12.7,12.6,12.5,12.5,12.5,12.5 , static double dttab[173]={13.7,13.4,13.1,12.9,12.7,12.6,12.5,12.5,12.5,12.5 ,
12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.4,12.3,12.2,12.0,11.7,11.4, 12.5,12.5,12.5,12.5,12.5,12.5,12.5,12.4,12.3,12.2,12.0,11.7,11.4,
11.1,10.6,10.2, 9.6, 9.1, 8.6, 8.0, 7.5, 7.0, 6.6, 6.3, 6.0, 5.8, 11.1,10.6,10.2, 9.6, 9.1, 8.6, 8.0, 7.5, 7.0, 6.6, 6.3, 6.0, 5.8,
5.7, 5.6, 5.6, 5.6, 5.7, 5.8, 5.9, 6.1, 6.2, 6.3, 6.5, 6.6, 6.8, 5.7, 5.6, 5.6, 5.6, 5.7, 5.8, 5.9, 6.1, 6.2, 6.3, 6.5, 6.6, 6.8,
6.9, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.7, 7.8, 7.8,7.88,7.82 , 6.9, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.7, 7.8, 7.8,7.88,7.82 ,
7.54, 6.97, 6.40, 6.02, 5.41, 4.10, 2.92, 1.82, 1.61, 0.10,-1.02, 7.54, 6.97, 6.40, 6.02, 5.41, 4.10, 2.92, 1.82, 1.61, 0.10,-1.02,
-1.28,-2.69,-3.24,-3.64,-4.54,-4.71,-5.11,-5.40,-5.42,-5.20,-5.46, -1.28,-2.69,-3.24,-3.64,-4.54,-4.71,-5.11,-5.40,-5.42,-5.20,-5.46,
-5.46,-5.79,-5.63,-5.64,-5.80,-5.66,-5.87,-6.01,-6.19,-6.64,-6.44, -5.46,-5.79,-5.63,-5.64,-5.80,-5.66,-5.87,-6.01,-6.19,-6.64,-6.44,
-6.47,-6.09,-5.76,-4.66,-3.74,-2.72,-1.54,-0.02, 1.24, 2.64, 3.86, -6.47,-6.09,-5.76,-4.66,-3.74,-2.72,-1.54,-0.02, 1.24, 2.64, 3.86,
5.37, 6.14, 7.75, 9.13,10.46,11.53,13.36,14.65,16.01,17.20,18.24, 5.37, 6.14, 7.75, 9.13,10.46,11.53,13.36,14.65,16.01,17.20,18.24,
19.06,20.25,20.95,21.16,22.25,22.41,23.03,23.49,23.62,23.86,24.49, 19.06,20.25,20.95,21.16,22.25,22.41,23.03,23.49,23.62,23.86,24.49,
24.34,24.08,24.02,24.00,23.87,23.95,23.86,23.93,23.73,23.92,23.96, 24.34,24.08,24.02,24.00,23.87,23.95,23.86,23.93,23.73,23.92,23.96,
24.02,24.33,24.83,25.30,25.70,26.24,26.77,27.28,27.78,28.25,28.71, 24.02,24.33,24.83,25.30,25.70,26.24,26.77,27.28,27.78,28.25,28.71,
29.15,29.57,29.97,30.36,30.72,31.07,31.35,31.68,32.18,32.68,33.15, 29.15,29.57,29.97,30.36,30.72,31.07,31.35,31.68,32.18,32.68,33.15,
33.59,34.00,34.47,35.03,35.73,36.54,37.43,38.29,39.20,40.18,41.17, 33.59,34.00,34.47,35.03,35.73,36.54,37.43,38.29,39.20,40.18,41.17,
42.23}; 42.23};
/* TAI2FD-- convert from TAI in FITS format to UT in FITS format */
char *
tai2fd (string)
char *string; /* FITS date string, which may be:
fractional year
dd/mm/yy (FITS standard before 2000)
dd-mm-yy (nonstandard use before 2000)
yyyy-mm-dd (FITS standard after 1999)
yyyy-mm-ddThh:mm:ss.ss (FITS standard after 1999) */
{
double dj0, dj, tsec, dt;
dj0 = fd2jd (string);
dt = utdt (dj0);
dj = dj0 - (dt / 86400.0);
dt = utdt (dj);
tsec = fd2ts (string);
tsec = tsec - dt + 32.184;
return (ts2fd (tsec));
}
/* FD2TAI-- convert from UT in FITS format to TAI in FITS format */
char *
fd2tai (string)
char *string; /* FITS date string, which may be:
fractional year
dd/mm/yy (FITS standard before 2000)
dd-mm-yy (nonstandard use before 2000)
yyyy-mm-dd (FITS standard after 1999)
yyyy-mm-ddThh:mm:ss.ss (FITS standard after 1999) */
{
double dj, tsec, dt;
dj = fd2jd (string);
dt = utdt (dj);
tsec = fd2ts (string);
tsec = tsec + dt - 32.184;
return (ts2fd (tsec));
}
/* DT2TAI-- convert from UT as yyyy.mmdd hh.mmssss to TAI in same format */
void
dt2tai (date, time)
double *date; /* Date as yyyy.mmdd */
double *time; /* Time as hh.mmssxxxx
*if time<0, it is time as -(fraction of a day) */
{
double dj, dt, tsec;
dj = dt2jd (*date, *time);
dt = utdt (dj);
tsec = dt2ts (*date, *time);
tsec = tsec + dt - 32.184;
ts2dt (tsec, date, time);
return;
}
/* TAI2DT-- convert from TAI as yyyy.mmdd hh.mmssss to UT in same format */
void
tai2dt (date, time)
double *date; /* Date as yyyy.mmdd */
double *time; /* Time as hh.mmssxxxx
*if time<0, it is time as -(fraction of a day) */
{
double dj, dt, tsec, tsec0;
dj = dt2jd (*date, *time);
dt = utdt (dj);
tsec0 = dt2ts (*date, *time);
tsec = tsec0 + dt;
dj = ts2jd (tsec);
dt = utdt (dj);
tsec = tsec0 + dt + 32.184;
ts2dt (tsec, date, time);
return;
}
/* ET2FD-- convert from ET (or TDT or TT) in FITS format to UT in FITS form at */ /* ET2FD-- convert from ET (or TDT or TT) in FITS format to UT in FITS form at */
char * char *
et2fd (string) et2fd (string)
char *string; /* FITS date string, which may be: char *string; /* FITS date string, which may be:
fractional year fractional year
dd/mm/yy (FITS standard before 2000) dd/mm/yy (FITS standard before 2000)
dd-mm-yy (nonstandard use before 2000) dd-mm-yy (nonstandard use before 2000)
yyyy-mm-dd (FITS standard after 1999) yyyy-mm-dd (FITS standard after 1999)
skipping to change at line 2101 skipping to change at line 2192
double dt, date, time, ts, ts1, ts0, date0, yfrac, diff, cj; double dt, date, time, ts, ts1, ts0, date0, yfrac, diff, cj;
int i, iyr, iyear; int i, iyr, iyear;
/* If after 1972-01-01, use tabulated TAI-UT */ /* If after 1972-01-01, use tabulated TAI-UT */
if (dj >= 2441317.5) { if (dj >= 2441317.5) {
dt = 0.0; dt = 0.0;
for (i = 22; i > 0; i--) { for (i = 22; i > 0; i--) {
if (dj >= taijd[i]) if (dj >= taijd[i])
dt = taidt[i]; dt = taidt[i];
} }
dt = dt + 32.84; dt = dt + 32.184;
} }
/* For 1800-01-01 to 1972-01-01, use table of ET-UT from AE */ /* For 1800-01-01 to 1972-01-01, use table of ET-UT from AE */
else if (dj >= 2378496.5) { else if (dj >= 2378496.5) {
jd2dt (dj, &date, &time); jd2dt (dj, &date, &time);
ts = jd2ts (dj); ts = jd2ts (dj);
iyear = (int) date; iyear = (int) date;
iyr = iyear - 1800; iyr = iyear - 1800;
date0 = (double) iyear + 0.0101; date0 = (double) iyear + 0.0101;
ts0 = dt2ts (date0, 0.0); ts0 = dt2ts (date0, 0.0);
skipping to change at line 4294 skipping to change at line 4385
* Oct 6 2006 Add eqeqnx() to compute equation of the equinoxes * Oct 6 2006 Add eqeqnx() to compute equation of the equinoxes
* *
* Jan 8 2007 Remove unused variables * Jan 8 2007 Remove unused variables
* *
* Sep 5 2008 Replace nutation with IAU 2006 model translated from SOFA * Sep 5 2008 Replace nutation with IAU 2006 model translated from SOFA
* Sep 9 2008 Add ang2hr(), ang2deg(), hr2ang(), deg2ang() * Sep 9 2008 Add ang2hr(), ang2deg(), hr2ang(), deg2ang()
* Sep 10 2008 Add longitude to mean standard time (default = Greenwich) * Sep 10 2008 Add longitude to mean standard time (default = Greenwich)
* Oct 8 2008 Clean up sidereal time computations * Oct 8 2008 Clean up sidereal time computations
* *
* Sep 24 2009 Add end to comment "Coefficients for fundamental arguments" * Sep 24 2009 Add end to comment "Coefficients for fundamental arguments"
*
* Jan 11 2012 Add TAI, TT, GPS time
*/ */
 End of changes. 7 change blocks. 
8 lines changed or deleted 101 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/