IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 20, 2004, 3:29:33 PM (22 years ago)
Author:
harman
Message:

Added more time functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astronomy/psTime.h

    r1223 r1247  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2004-07-15 19:02:13 $
     14 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2004-07-21 01:29:22 $
    1616 *
    1717 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2929/// @addtogroup Time
    3030/// @{
     31
     32/******************************************************************************/
     33/*  DEFINE STATEMENTS                                                         */
     34/******************************************************************************/
     35
     36/** Number of available leapsecond updates */
     37#define NUM_LEAPSECOND_UPDATES 23
     38
     39/** Maximum length of time string */
     40#define MAX_TIME_STRING_LENGTH 256
     41
     42/** Seconds per minute */
     43#define  SEC_PER_MINUTE   60
     44
     45/** Seconds per hour */
     46#define  SEC_PER_HOUR     60*SEC_PER_MINUTE
     47
     48/** Seconds per day */
     49#define  SEC_PER_DAY      24*SEC_PER_HOUR
     50
     51/** Seconds per year */
     52#define  SEC_PER_YEAR    365*SEC_PER_DAY
     53
     54/** Microseconds per day */
     55#define USEC_PER_DAY 86400000000.0
    3156
    3257/******************************************************************************/
     
    6388/** Convert psTime to ISO time in TAI units.
    6489 *
    65  * Converts psTime to a null terminated string in the form of: YYYY/MM/DD,HH:MM:SS.SSS. The result from this
    66  * function is in TAI units.
    67  *
    68  *  @return  char*: Pointer null terminated array of chars in ISO/TAI time.
     90 * Converts psTime to a null terminated string in the form of: YYYY/MM/DD,HH:MM:SS.SSS. This function assumes
     91 * the input time already is in TAI time and does not add or subtract leapseconds.
     92 *
     93 *  @return  char*: Pointer null terminated array of chars in ISO time.
    6994 */
    7095char* psTimeToISO(
     
    7499/** Convert psTime to UTC time.
    75100 *
    76  * Converts psTime to UTC time in double precision floating point notation. The result from this function is
    77  * not in TAI units, but that of UTC, which does not contain leapseconds.
    78  *
    79  *  @return  double: UTC time in floating point notation.
    80  */
    81 double psTimeToUTC(
     101 * Converts psTime to UTC time in double precision floating point notation. The input to this must already be
     102 * int TAI time. The result from this function is not in TAI units, but that of UTC, which does not contain
     103 * leapseconds.
     104 *
     105 *  @return  psTime: UTC time psTime format.
     106 */
     107psTime psTimeToUTC(
    82108    psTime time    /** Input time to be converted. */
    83109);
     
    85111/** Convert psTime to modified Julian date time.
    86112 *
    87  * Converts psTime to modified Julian date (MJD) time. The result from this function is in TAI units.
    88  *
    89  *  @return  double: MJD/TAI time in floating point notation.
     113 * Converts psTime to modified Julian date (MJD) time. This function assumes the input time already is in TAI
     114 * time and does not add or subtract leapseconds.
     115 *
     116 *  @return  double: Modified Julian Days (MJD) time.
    90117 */
    91118double psTimeToMJD(
     
    95122/** Convert psTime to Julian date time.
    96123 *
    97  * Converts psTime to Julian date (JD) time. The result from this function is in TAI units.
    98  *
    99  *  @return  double: JD/TAI time in floating point notation.
     124 * Converts psTime to Julian date (JD) time. This function assumes the input time already is in TAI time and
     125 * does not add or subtract leapseconds.
     126 *
     127 *  @return  double: Julian Date (JD) time.
    100128 */
    101129double psTimeToJD(
     
    105133/** Convert psTime to timeval time.
    106134 *
    107  * Converts psTime to timeval time. The result from this function is in TAI units.
    108  *
    109  *  @return  timeval: timeval/TAI time.
     135 * Converts psTime to timeval time. This function assumes the input time already is in TAI time and does not
     136 * add or subtract leapseconds.
     137 *
     138 *  @return  timeval: timeval struct time.
    110139 */
    111140struct timeval psTimeToTimeval(
     
    115144/** Convert psTime to tm time.
    116145 *
    117  * Converts psTime to tm time. The result from this function is in TAI units.
    118  *
    119  *  @return  tm: tm/TAI time.
     146 * Converts psTime to tm time. This function assumes the input time already is in TAI time and does not add or
     147 * subtract leapseconds.
     148 *
     149 *  @return  tm: tm struct time.
    120150 */
    121151struct tm* psTimeToTM(
     
    125155/** Convert ISO to psTime.
    126156 *
    127  * Converts ISO time to psTime. The result from this function is in TAI units.
     157 * Converts ISO time to psTime. This function assumes the input time already is in TAI time and does not add
     158 * or subtract leapseconds.
     159 *
     160 *  @return  psTime: time
     161 */
     162psTime psISOToTime(
     163    char *time  /** Input time to be converted. */
     164);
     165
     166/** Convert UTC to psTime.
     167 *
     168 * Converts UTC time to psTime. This function assumes the input time already is in TAI time and add or
     169 * subtracts the necessary leapseconds.
    128170 *
    129171 *  @return  psTime: time in TAI units.
    130172 */
    131 psTime psISOToTime(char *time);
    132 
    133 /** Convert UTC to psTime.
    134  *
    135  * Converts UTC time to psTime. The result from this function is in TAI units.
    136  *
    137  *  @return  psTime: time in TAI units.
    138  */
    139 psTime psUTCToTime(double time);
     173psTime psUTCToTime(
     174    psTime time /** Input time to be converted. */
     175);
    140176
    141177/** Convert MJD to psTime.
    142178 *
    143  * Converts MJD time to psTime. The result from this function is in TAI units.
    144  *
    145  *  @return  psTime: time in TAI units.
    146  */
    147 psTime psMJDToTime(double time);
     179 * Converts MJD time to psTime. This function assumes the input time already is in TAI time and does not add
     180 * or subtract leapseconds.
     181 *
     182 *  @return  psTime: time.
     183 */
     184psTime psMJDToTime(
     185    double time /** Input time to be converted. */
     186);
    148187
    149188/** Convert JD to psTime.
    150189 *
    151  * Converts JD time to psTime. The result from this function is in TAI units.
    152  *
    153  *  @return  psTime: time in TAI units.
    154  */
    155 psTime psJDToTime(double time);
     190 * Converts JD time to psTime. This function assumes the input time already is in TAI time and does not add
     191 * or subtract leapseconds.
     192 *
     193 *  @return  psTime: time.
     194 */
     195psTime psJDToTime(
     196    double time /** Input time to be converted. */
     197);
    156198
    157199/** Convert timeval to psTime.
    158200 *
    159  * Converts timeval time to psTime. The result from this function is in TAI units.
    160  *
    161  *  @return  psTime: time in TAI units.
    162  */
    163 psTime psTimevalToTime(struct timeval *time);
     201 * Converts timeval time to psTime. This function assumes the input time already is in TAI time and does not
     202 * add or subtract leapseconds.
     203 *
     204 *  @return  psTime: time.
     205 */
     206psTime psTimevalToTime(
     207    struct timeval *time    /** Input time to be converted. */
     208);
    164209
    165210/** Convert tm time to psTime.
    166211 *
    167  * Converts tm time to psTime. The result from this function is in TAI units.
    168  *
    169  *  @return  psTime: time in TAI units.
    170  */
    171 psTime psTMToTime(struct tm *time);
     212 * Converts tm time to psTime. This function assumes the input time already is in TAI time and does not add
     213 * or subtract leapseconds.
     214 *
     215 *  @return  psTime: time.
     216 */
     217psTime psTMToTime(
     218    struct tm *time /** Input time to be converted. */
     219);
    172220/// @}
    173221
Note: See TracChangeset for help on using the changeset viewer.