LAL  7.5.0.1-8083555

Detailed Description

GPS time manipulation functions.

Prototypes

INT8 XLALGPSToINT8NS (const LIGOTimeGPS *epoch)
 Converts GPS time to nano seconds stored as an INT8. More...
 
LIGOTimeGPSXLALINT8NSToGPS (LIGOTimeGPS *epoch, INT8 ns)
 Converts nano seconds stored as an INT8 to GPS time. More...
 
LIGOTimeGPSXLALGPSSet (LIGOTimeGPS *epoch, INT4 gpssec, INT8 gpsnan)
 Sets GPS time given GPS integer seconds and residual nanoseconds. More...
 
LIGOTimeGPSXLALGPSSetREAL8 (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...
 
LIGOTimeGPSXLALGPSAddGPS (LIGOTimeGPS *epoch, const LIGOTimeGPS *dt)
 Adds two GPS times. More...
 
LIGOTimeGPSXLALGPSAdd (LIGOTimeGPS *epoch, REAL8 dt)
 Adds a double to a GPS time. More...
 
LIGOTimeGPSXLALGPSSubGPS (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)
 
LIGOTimeGPSXLALGPSMultiply (LIGOTimeGPS *gps, REAL8 x)
 Multiply a GPS time by a number. More...
 
LIGOTimeGPSXLALGPSDivide (LIGOTimeGPS *gps, REAL8 x)
 Divide a GPS time by a number. More...
 

Function Documentation

◆ XLALGPSToINT8NS()

INT8 XLALGPSToINT8NS ( const LIGOTimeGPS epoch)

Converts GPS time to nano seconds stored as an INT8.

Definition at line 36 of file XLALTime.c.

◆ XLALINT8NSToGPS()

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.

◆ XLALGPSSet()

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.

◆ XLALGPSSetREAL8()

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.

◆ XLALGPSGetREAL8()

REAL8 XLALGPSGetREAL8 ( const LIGOTimeGPS epoch)

Returns the GPS time as a REAL8.

Definition at line 91 of file XLALTime.c.

◆ XLALGPSModf()

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.

◆ XLALGPSAddGPS()

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.

◆ XLALGPSAdd()

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.

◆ XLALGPSSubGPS()

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.

◆ XLALGPSDiff()

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.

◆ XLALGPSCmp()

int XLALGPSCmp ( const LIGOTimeGPS t0,
const LIGOTimeGPS t1 
)

Compares two GPS times.

Returns:

  • -1 if t0 < t1
  • 0 if t0 == t1
  • 1 if t0 > t1. A NULL GPS time is always less than a non-NULL GPS time, and two NULL GPS times are considered equal.

Definition at line 174 of file XLALTime.c.

◆ split_double()

static void split_double ( double  x,
double *  hi,
double *  lo 
)
static

Definition at line 207 of file XLALTime.c.

◆ XLALGPSMultiply()

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.

◆ XLALGPSDivide()

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.