GPS time manipulation functions.
Prototypes | |
INT8 | XLALGPSToINT8NS (const LIGOTimeGPS *epoch) |
Converts GPS time to nano seconds stored as an INT8. More... | |
LIGOTimeGPS * | XLALINT8NSToGPS (LIGOTimeGPS *epoch, INT8 ns) |
Converts nano seconds stored as an INT8 to GPS time. More... | |
LIGOTimeGPS * | XLALGPSSet (LIGOTimeGPS *epoch, INT4 gpssec, INT8 gpsnan) |
Sets GPS time given GPS integer seconds and residual nanoseconds. More... | |
LIGOTimeGPS * | XLALGPSSetREAL8 (LIGOTimeGPS *epoch, REAL8 t) |
Sets GPS time given GPS seconds as a REAL8. More... | |
REAL8 | XLALGPSGetREAL8 (const LIGOTimeGPS *epoch) |
Returns the GPS time as a REAL8. More... | |
REAL8 | XLALGPSModf (REAL8 *iptr, const LIGOTimeGPS *epoch) |
Breaks the GPS time into REAL8 integral and fractional parts, each of which has the same sign as the epoch. More... | |
LIGOTimeGPS * | XLALGPSAddGPS (LIGOTimeGPS *epoch, const LIGOTimeGPS *dt) |
Adds two GPS times. More... | |
LIGOTimeGPS * | XLALGPSAdd (LIGOTimeGPS *epoch, REAL8 dt) |
Adds a double to a GPS time. More... | |
LIGOTimeGPS * | XLALGPSSubGPS (LIGOTimeGPS *t1, const LIGOTimeGPS *t0) |
Difference between two GPS times. More... | |
REAL8 | XLALGPSDiff (const LIGOTimeGPS *t1, const LIGOTimeGPS *t0) |
Difference between two GPS times as double. More... | |
int | XLALGPSCmp (const LIGOTimeGPS *t0, const LIGOTimeGPS *t1) |
Compares two GPS times. More... | |
static void | split_double (double x, double *hi, double *lo) |
LIGOTimeGPS * | XLALGPSMultiply (LIGOTimeGPS *gps, REAL8 x) |
Multiply a GPS time by a number. More... | |
LIGOTimeGPS * | XLALGPSDivide (LIGOTimeGPS *gps, REAL8 x) |
Divide a GPS time by a number. More... | |
INT8 XLALGPSToINT8NS | ( | const LIGOTimeGPS * | epoch | ) |
Converts GPS time to nano seconds stored as an INT8.
Definition at line 36 of file XLALTime.c.
LIGOTimeGPS* XLALINT8NSToGPS | ( | LIGOTimeGPS * | epoch, |
INT8 | ns | ||
) |
Converts nano seconds stored as an INT8 to GPS time.
Returns epoch on success, NULL on error.
Definition at line 46 of file XLALTime.c.
LIGOTimeGPS* XLALGPSSet | ( | LIGOTimeGPS * | epoch, |
INT4 | gpssec, | ||
INT8 | gpsnan | ||
) |
Sets GPS time given GPS integer seconds and residual nanoseconds.
Returns epoch on success, or NULL on error.
Definition at line 63 of file XLALTime.c.
LIGOTimeGPS* XLALGPSSetREAL8 | ( | LIGOTimeGPS * | epoch, |
REAL8 | t | ||
) |
Sets GPS time given GPS seconds as a REAL8.
Returns epoch on success, NULL on error.
Definition at line 73 of file XLALTime.c.
REAL8 XLALGPSGetREAL8 | ( | const LIGOTimeGPS * | epoch | ) |
Returns the GPS time as a REAL8.
Definition at line 91 of file XLALTime.c.
REAL8 XLALGPSModf | ( | REAL8 * | iptr, |
const LIGOTimeGPS * | epoch | ||
) |
Breaks the GPS time into REAL8 integral and fractional parts, each of which has the same sign as the epoch.
Returns the fractional part, and stores the integral part (as a REAL8) in the object pointed to by iptr. Like the standard C math library function modf().
Definition at line 103 of file XLALTime.c.
LIGOTimeGPS* XLALGPSAddGPS | ( | LIGOTimeGPS * | epoch, |
const LIGOTimeGPS * | dt | ||
) |
Adds two GPS times.
Computes epoch + dt and places the result in epoch. Returns epoch on success, NULL on error.
Definition at line 117 of file XLALTime.c.
LIGOTimeGPS* XLALGPSAdd | ( | LIGOTimeGPS * | epoch, |
REAL8 | dt | ||
) |
Adds a double to a GPS time.
Computes epoch + dt and places the result in epoch. Returns epoch on success, NULL on error.
Definition at line 131 of file XLALTime.c.
LIGOTimeGPS* XLALGPSSubGPS | ( | LIGOTimeGPS * | t1, |
const LIGOTimeGPS * | t0 | ||
) |
Difference between two GPS times.
Computes t1 - t0 and places the result in t1. Returns t1 on success, NULL on error.
Definition at line 144 of file XLALTime.c.
REAL8 XLALGPSDiff | ( | const LIGOTimeGPS * | t1, |
const LIGOTimeGPS * | t0 | ||
) |
Difference between two GPS times as double.
Returns t1 - t0.
Definition at line 157 of file XLALTime.c.
int XLALGPSCmp | ( | const LIGOTimeGPS * | t0, |
const LIGOTimeGPS * | t1 | ||
) |
Compares two GPS times.
Returns:
Definition at line 174 of file XLALTime.c.
|
static |
Definition at line 207 of file XLALTime.c.
LIGOTimeGPS* XLALGPSMultiply | ( | LIGOTimeGPS * | gps, |
REAL8 | x | ||
) |
Multiply a GPS time by a number.
Computes gps * x and places the result in gps. Returns gps on success, NULL on failure.
Definition at line 228 of file XLALTime.c.
LIGOTimeGPS* XLALGPSDivide | ( | LIGOTimeGPS * | gps, |
REAL8 | x | ||
) |
Divide a GPS time by a number.
Computes gps / x and places the result in gps. Returns gps on success, NULL on failure.
Definition at line 290 of file XLALTime.c.