LAL  7.5.0.1-fe68b98
GPStoGMST1Test.c
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2007 David Chin, Jolien Creighton
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with with program; see the file COPYING. If not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 * MA 02110-1301 USA
18 */
19 
20 #include <stdio.h>
21 #include <math.h>
22 #include <stdlib.h>
23 #include <time.h>
24 
25 #include <lal/LALStdlib.h>
26 #include <lal/Date.h>
27 #include <lal/AVFactories.h>
28 
29 
30 int main(void)
31 {
32  LIGOTimeGPS gps = {0., 0.};
33  REAL8 gmst;
34 
35  gps.gpsSeconds = 61094;
36 
37  for (gps.gpsNanoSeconds =99999999; gps.gpsNanoSeconds < 1000000000;
38  gps.gpsNanoSeconds+=10000000)
39  {
40  gmst = XLALGreenwichMeanSiderealTime(&gps);
41  printf("nSec = %d\tgmst = %g\n", gps.gpsNanoSeconds, gmst);
42  }
43 
44  return 0;
45 }
int main(void)
double REAL8
Double precision real floating-point number (8 bytes).
REAL8 XLALGreenwichMeanSiderealTime(const LIGOTimeGPS *gpstime)
Convenience wrapper, calling XLALGreenwichSiderealTime() with the equation of equinoxes set to 0.
Epoch relative to GPS epoch, see LIGOTimeGPS type for more details.
Definition: LALDatatypes.h:458
INT4 gpsSeconds
Seconds since 0h UTC 6 Jan 1980.
Definition: LALDatatypes.h:459
INT4 gpsNanoSeconds
Residual nanoseconds.
Definition: LALDatatypes.h:460