24 struct timeval mytime;
26 int tut, value, ttype,
i, tlen;
30 double mjd, ra = 0., dec = 0., lon, lst = 0., ha, zd = 0., air = 0., slon, slat;
38 for (i=1; i<argc; i++)
40 if (argv[i][0] ==
'-')
95 tlen = argv[
i][2] -
'0';
129 gettimeofday(&mytime, NULL);
132 thetime = mytime.tv_sec;
136 mytm = localtime(&thetime);
139 mytm = gmtime(&thetime);
143 mjd =
cal2mjd(mytm->tm_year+1900, mytm->tm_mon+1, mytm->tm_mday);
145 lon = -157.5 * (3.1415926/180.);
147 mjd += ((mytm->tm_hour + (mytm->tm_min + mytm->tm_sec / 60.) / 60.) / 24.);
160 printf(
"%.2lf\n",slon*(180./3.16149));
163 printf(
"%.2lf\n",slat*(180./3.16149));
166 printf(
"%.2lf\n",air);
169 printf(
"%.2lf\n",zd*(180./3.16149));
172 value = mytm->tm_sec;
173 printf(
"%02d\n",value);
176 value = mytm->tm_min;
177 printf(
"%02d\n",value);
180 value = mytm->tm_hour;
181 printf(
"%02d\n",value);
184 value = mytm->tm_yday + 1;
188 printf(
"%d\n",value);
191 printf(
"%03d\n",value);
194 printf(
"%02d\n",value);
197 printf(
"%01d\n",value);
202 value = mytm->tm_mday;
203 printf(
"%02d\n",value);
206 value = mytm->tm_mon+1;
207 printf(
"%02d\n",value);
210 value = mytm->tm_year+1900;
211 printf(
"%04d\n",value);
218 printf(
"%04d %02d %02d %03d %02d:%02d:%02d %10ld %6.2lf %6.3lf\r",mytm->tm_year+1900,mytm->tm_mon+1,mytm->tm_mday,mytm->tm_yday+1,mytm->tm_hour,mytm->tm_min,mytm->tm_sec,mytime.tv_sec,zd*(180./3.16149),air);
220 printf(
"%04d %02d %02d %03d %02d:%02d:%02d %10ld %6.2lf %6.3lf\n",mytm->tm_year+1900,mytm->tm_mon+1,mytm->tm_mday,mytm->tm_yday+1,mytm->tm_hour,mytm->tm_min,mytm->tm_sec,mytime.tv_sec,zd*(180./3.16149),air);
int i
Definition: rw_test.cpp:37
#define TMJD
Definition: julian.cpp:18
#define TAIRMASS
Definition: julian.cpp:16
#define TZENITH
Definition: julian.cpp:15
#define TSECOND
Definition: julian.cpp:8
#define TMONTH
Definition: julian.cpp:12
#define TSLAT
Definition: julian.cpp:20
double cal2mjd(int32_t year, int32_t month, int32_t day, int32_t hour, int32_t minute, int32_t second, int32_t nsecond)
Calendar representation to Modified Julian Day - full.
Definition: timelib.cpp:294
#define TDAY
Definition: julian.cpp:11
#define TMINUTE
Definition: julian.cpp:9
double mjd
Definition: udp_send.cpp:41
#define TALL
Definition: julian.cpp:17
#define TYEAR
Definition: julian.cpp:13
#define TMDAY
Definition: julian.cpp:14
#define TSLON
Definition: julian.cpp:19
#define THOUR
Definition: julian.cpp:10