Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

Time


Data Structures

struct  psTime
 Definition of psTime. More...

Enumerations

enum  psTimeType { PS_TIME_TAI, PS_TIME_UTC, PS_TIME_UT1, PS_TIME_TT }
 Time type. More...
enum  psTimeBulletin { PS_IERS_A, PS_IERS_B }
 Time Bulletin type. More...

Functions

psBool p_psTimeInit (const char *fileName)
 Initialize time data.
void psTimeInitialize (const char *timeConfig)
 Initialize time data.
psBool p_psTimeFinalize (void)
 Free memory persistant time data.
void psTimeFinalize (void)
 Frees memory that was allocated by psTime functions.
psTimepsTimeAlloc (psTimeType type)
 Allocate time struct.
bool psMemCheckTime (psPtr ptr)
 Checks the type of a particular pointer.
psTimepsTimeGetNow (psTimeType type)
 Get current time.
psTimepsTimeConvert (psTime *time, psTimeType type)
 Convert psTime to UTC, TAI, UT1, or TT time.
double psTimeToLMST (psTime *time, double longitude)
 Convert psTime to Local Mean Sidereal Time (LMST).
double psTimeGetUT1Delta (const psTime *time, psTimeBulletin bulletin)
 Determine UT1 - UTC from table lookup.
psTimepsTime_TideUT1Corr (const psTime *time)
 Provides tidal corrections to UT1-UTC.
psF64 p_psTimeGetTAIDelta (const psTime *time)
 Determine TAI - UTC from table lookup.
psSpherep_psTimeGetPoleCoords (const psTime *time)
 Determine polar coordinates at a given time.
long psTimeLeapSecondDelta (const psTime *time1, const psTime *time2)
 Calculate the number of leapseconds between two times.
bool psTimeIsLeapSecond (const psTime *utc)
 Determine if UTC time is a leapsecond.
double psTimeToJD (const psTime *time)
 Convert psTime to Julian date time.
double psTimeToMJD (const psTime *time)
 Convert psTime to modified Julian date time.
psString psTimeToISO (const psTime *time)
 Convert psTime to ISO8601 formatted string.
tm * psTimeToTM (const psTime *time)
 Convert psTime to struct tm time.
timeval * psTimeToTimeval (const psTime *time)
 Convert psTime to timeval time.
psTimepsTimeFromJD (double jd)
 Convert JD to psTime.
psTimepsTimeFromMJD (double mjd)
 Convert MJD to psTime.
psTimepsTimeFromISO (const char *input, psTimeType type)
 Convert ISO to psTime.
psTimepsTimeFromTimeval (const struct timeval *input)
 Convert timeval to psTime.
psTimepsTimeFromTT (psS64 sec, psU32 nsec)
 Convert Terrestrial Time to psTime.
psTimepsTimeFromUTC (psS64 sec, psU32 nsec, bool leapsecond)
 Convert UTC time to psTime.
psTimepsTimeFromTM (const struct tm *time)
 Convert tm time to psTime.
psTimepsTimeStrptime (const char *s, const char *format)
 Convert an arbitrary string into a psTime.
psTimepsTimeMath (const psTime *time, double delta)
 Adds delta to time.
double psTimeDelta (const psTime *time1, const psTime *time2)
 Determine difference between two times.
char * p_psGetConfigFileName ()
 Get the filename of the psLib configuration file.
psF64 p_psTimeSearchTables (psF64 index, psU64 column, char *metadataTableNames[], psU32 nTables, psLookupStatusType *status)
 Searches the IERS time tables for a specified entry location.
bool psTimerStart (char *name)
 Stores the current time in a psHash of timers, under the supplied name.
psF64 psTimerClear (char *name)
 Resets the named timer.
psF64 psTimerMark (char *name)
 Returns the elapsed time, in seconds, for the timer specified by name.
psF64 psTimerStop (void)
 Frees all memory associated with all timers and returns the expended time.
psTimep_psTimeCopy (const psTime *inTime)
 Private function for copying a psTime.


Enumeration Type Documentation

enum psTimeBulletin
 

Time Bulletin type.

Enumeration for psTimeBulletin type, A or B.

Enumerator:
PS_IERS_A  IERS Bulletin A.
PS_IERS_B  IERS Bulletin B.

Definition at line 52 of file psTime.h.

enum psTimeType
 

Time type.

Enumeration for psTime types, TAI or UTC time.

Enumerator:
PS_TIME_TAI  Temps Atomique International (TAI) time (time with leapseconds).
PS_TIME_UTC  Universal Time Coordinated (UTC) time (time without leapseconds).
PS_TIME_UT1  Universal Time corrected for polar motion.
PS_TIME_TT  Terrestrial Time.

Definition at line 41 of file psTime.h.


Function Documentation

char* p_psGetConfigFileName  ) 
 

Get the filename of the psLib configuration file.

Returns:
char* If a PS_CONFIG_FILE environment variable exists, that is returned, otherwise the default location dependent on the installation location.

psTime* p_psTimeCopy const psTime inTime  ) 
 

Private function for copying a psTime.

Returns:
psTime*: New copy of existing psTime.
Parameters:
inTime  input time to copy.

psBool p_psTimeFinalize void   ) 
 

Free memory persistant time data.

Frees time data to be held in memory until the end of successful program execution.

Returns:
void: void.

psSphere* p_psTimeGetPoleCoords const psTime time  ) 
 

Determine polar coordinates at a given time.

Determines the orientation of the polar axis at the given time.

Returns:
psSphere*: Spherical coordinates of Earth's polar axias.
Parameters:
time  psTime determine polar orientation.

psF64 p_psTimeGetTAIDelta const psTime time  ) 
 

Determine TAI - UTC from table lookup.

This function is necessary to for various psTime functions.

Returns:
psF64: Time difference.
Parameters:
time  psTime to be looked up.

psBool p_psTimeInit const char *  fileName  ) 
 

Initialize time data.

Reads config and data files associated with various time conversions.

Returns:
bool: True for success, false for failure.
Parameters:
fileName  File name containing config/data info

psF64 p_psTimeSearchTables psF64  index,
psU64  column,
char *  metadataTableNames[],
psU32  nTables,
psLookupStatusType status
 

Searches the IERS time tables for a specified entry location.

Returns the interpolated double precision (arcsec) value at the specified entry location. Inputs to specify are the time index in mjd, the column number corresponding to Xp, Yp, or Sp (UT1-UTC) in IERS A or B, the time table names, and the number of time tables.

Returns:
psF64: Resulting table entry for specified parameters.
Parameters:
index  time index for which to search
column  column number of specified index
metadataTableNames  names of IERS tables to search
nTables  number of IERS tables to search
status  status of table search

bool psMemCheckTime psPtr  ptr  ) 
 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psTime structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

psTime* psTime_TideUT1Corr const psTime time  ) 
 

Provides tidal corrections to UT1-UTC.

Uses the Ray model of Simon et al.

Returns:
psTime*: The corrected time in UT1.
Parameters:
time  psTime to be corrected.

psTime* psTimeAlloc psTimeType  type  ) 
 

Allocate time struct.

Allocates an empty time struct. User must specify the psTimeType (PS_TIME_TAI or PS_TIME_UTC) in the argument. The seconds and microseconds members of the struct are set to zero.

Returns:
psTime*: Struct with empty time.
Parameters:
type  Type of time to create (UTC or TAI).

psTime* psTimeConvert psTime time,
psTimeType  type
 

Convert psTime to UTC, TAI, UT1, or TT time.

Converts psTime to UTC, TAI, UT1, or TT time based on the psTimeType argument.

Returns:
psTime*: Pointer to psTime.
Parameters:
time  Time to be converted.
type  Type to be converted to.

double psTimeDelta const psTime time1,
const psTime time2
 

Determine difference between two times.

Result is in TAI time.

Determine difference between two times. Input times are converted to TAI format if necessary.

Returns:
double: Time difference.
Parameters:
time1  First time.
time2  Second time.

void psTimeFinalize void   ) 
 

Frees memory that was allocated by psTime functions.

Allows a subsequent search for leaked memory.

psTime* psTimeFromISO const char *  input,
psTimeType  type
 

Convert ISO to psTime.

Converts ISO time to psTime. This function does not add or subtract leapseconds.

Returns:
psTime*: time
Parameters:
input  Input time to be converted.
type  Time type.

psTime* psTimeFromJD double  jd  ) 
 

Convert JD to psTime.

Converts JD time to psTime. This function does not add or subtract leapseconds.

Returns:
psTime: time.
Parameters:
jd  Input time to be converted.

psTime* psTimeFromMJD double  mjd  ) 
 

Convert MJD to psTime.

Converts MJD time to psTime. This function does not add or subtract leapseconds.

Returns:
psTime: time.
Parameters:
mjd  Input time to be converted.

psTime* psTimeFromTimeval const struct timeval *  input  ) 
 

Convert timeval to psTime.

Converts timeval time to psTime. This function does not add or subtract leapseconds.

Returns:
psTime*: time.
Parameters:
input  Input time to be converted.

psTime* psTimeFromTM const struct tm *  time  ) 
 

Convert tm time to psTime.

Converts tm time to psTime. This function is based on a Perl algorithm availble in the Pan-STARRS Image processing Algorithm Design Description (ADD). This function does not add or subtract leapseconds.

Returns:
psTime*: time.
Parameters:
time  Input time to be converted.

psTime* psTimeFromTT psS64  sec,
psU32  nsec
 

Convert Terrestrial Time to psTime.

Converts Terrestial Time to psTime. This function assumes resultant time is of type TT.

Returns:
psTime*: time (TT)
Parameters:
sec  Input terrestrial time in seconds
nsec  Input terrestrial time fraction of seconds (nanoseconds)

psTime* psTimeFromUTC psS64  sec,
psU32  nsec,
bool  leapsecond
 

Convert UTC time to psTime.

Converts UTC time to psTime. It will verify if time specified is a leapsecond.

Returns:
psTime*: time (UTC)time
Parameters:
sec  Input time in seconds
nsec  Input time fraction of seconds (nanoseconds)
leapsecond  Input time is a leapsecond

psTime* psTimeGetNow psTimeType  type  ) 
 

Get current time.

Gets current time from the system clock. User must specify the psTimeType (PS_TIME_TAI or PS_TIME_UTC) in the argument.

Returns:
psTime*: Struct with current time.
Parameters:
type  Type of time to get (UTC or TAI).

double psTimeGetUT1Delta const psTime time,
psTimeBulletin  bulletin
 

Determine UT1 - UTC from table lookup.

This function is necessary to for various SLALIB functions.

Returns:
double: Time difference.
Parameters:
time  psTime to be looked up.
bulletin  IERS bulletin to use

void psTimeInitialize const char *  timeConfig  ) 
 

Initialize time data.

Reads the configuration file and sets up the appropriate psTimeTables and predictions.

Parameters:
timeConfig  psTime configuration file

bool psTimeIsLeapSecond const psTime utc  ) 
 

Determine if UTC time is a leapsecond.

Determines if the specified UTC time is a valid leapsecond.

Returns:
bool: valid leap second
Parameters:
utc  UTC to verify if leap second

long psTimeLeapSecondDelta const psTime time1,
const psTime time2
 

Calculate the number of leapseconds between two times.

Calculates the number of leapseconds between two times.

Returns:
long: leapseconds added between given times
Parameters:
time1  First input time.
time2  Second input time.

psTime* psTimeMath const psTime time,
double  delta
 

Adds delta to time.

Result is in TAI time.

Adds delta to time. Input time is converted to TAI format if necessary.

Returns:
psTime*: time.
Parameters:
time  Time.
delta  Time delta.

psF64 psTimerClear char *  name  ) 
 

Resets the named timer.

Returns:
psF64: The time elapsed since start.
Parameters:
name  timer name to clear

psF64 psTimerMark char *  name  ) 
 

Returns the elapsed time, in seconds, for the timer specified by name.

Returns:
psF64: The elapsed time in seconds since timer start.
Parameters:
name  timer name to mark

bool psTimerStart char *  name  ) 
 

Stores the current time in a psHash of timers, under the supplied name.

Returns:
bool: True if successful, otherwise false.
Parameters:
name  timer name to start

psF64 psTimerStop void   ) 
 

Frees all memory associated with all timers and returns the expended time.

Returns:
psF64: The maximum time expended.

psTime* psTimeStrptime const char *  s,
const char *  format
 

Convert an arbitrary string into a psTime.

Converts a string, using a strptime(3) format, into a psTime. See strptime(3) for documentation on this format.

Returns:
psTime*: time.
Parameters:
s  string to be converted
format  strptime format

psString psTimeToISO const psTime time  ) 
 

Convert psTime to ISO8601 formatted string.

Converts psTime to a null terminated string in the form of YYYY-MM-DDThh:mm:ss.sss. This function does not add or subtract leapseconds.

Returns:
psString: Pointer null terminated array of chars in ISO time.
Parameters:
time  Input time to be converted.

double psTimeToJD const psTime time  ) 
 

Convert psTime to Julian date time.

Converts psTime to Julian date (JD) time. This function does not add or subtract leapseconds.

Returns:
double: Julian Date (JD) time.
Parameters:
time  Input time to be converted.

double psTimeToLMST psTime time,
double  longitude
 

Convert psTime to Local Mean Sidereal Time (LMST).

Converts psTime at the given longitude to LMST time. If the input time is not in UTC format, then it is converted.

Returns:
double: LST Time.
Parameters:
time  psTime to be converted.
longitude  Longitude.

double psTimeToMJD const psTime time  ) 
 

Convert psTime to modified Julian date time.

Converts psTime to modified Julian date (MJD) time. This function does not add or subtract leapseconds.

Returns:
double: Modified Julian Days (MJD) time.
Parameters:
time  Input time to be converted.

struct timeval* psTimeToTimeval const psTime time  ) 
 

Convert psTime to timeval time.

Converts psTime to timeval time. This function does not add or subtract leapseconds.

Returns:
timeval*: timeval struct time.
Parameters:
time  Input time to be converted.

struct tm* psTimeToTM const psTime time  ) 
 

Convert psTime to struct tm time.

Converts psTime to struct tm time. This function should handle UTC leapseconds correctly.

Returns:
tm*: tm struct.
Parameters:
time  Input time to be converted.


Generated on Mon Jul 3 14:15:13 2006 for Pan-STARRS Foundation Library by  doxygen 1.4.4