4 int eraD2dtf(
const char *scale,
int ndp,
double d1,
double d2,
5 int *iy,
int *im,
int *
id,
int ihmsf[4])
80 int iy1, im1, id1, js, iy2, im2, id2, ihmsf1[4],
i;
81 double a1, b1, fd, dat0, dat12, w, dat24, dleap;
88 js =
eraJd2cal(a1, b1, &iy1, &im1, &id1, &fd);
93 if ( ! strcmp(scale,
"UTC") ) {
96 js =
eraDat(iy1, im1, id1, 0.0, &dat0);
97 if ( js < 0 )
return -1;
100 js =
eraDat(iy1, im1, id1, 0.5, &dat12);
101 if ( js < 0 )
return -1;
104 js =
eraJd2cal(a1+1.5, b1-fd, &iy2, &im2, &id2, &w);
106 js =
eraDat(iy2, im2, id2, 0.0, &dat24);
107 if ( js < 0 )
return -1;
110 dleap = dat24 - (2.0*dat12 - dat0);
113 leap = (dleap != 0.0);
118 eraD2tf ( ndp, fd, &s, ihmsf1 );
121 if ( ihmsf1[0] > 23 ) {
124 js =
eraJd2cal(a1+1.5, b1-fd, &iy2, &im2, &id2, &w);
141 if ( ihmsf1[2] > 0 ) {
160 if ( ndp < 0 && ihmsf1[2] == 60 ) {
175 for ( i = 0; i < 4; i++ ) {
176 ihmsf[
i] = ihmsf1[
i];
int eraD2dtf(const char *scale, int ndp, double d1, double d2, int *iy, int *im, int *id, int ihmsf[4])
int eraJd2cal(double dj1, double dj2, int *iy, int *im, int *id, double *fd)
int eraDat(int iy, int im, int id, double fd, double *deltat)
void eraD2tf(int ndp, double days, char *sign, int ihmsf[4])