IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 31, 2005, 11:48:13 AM (21 years ago)
Author:
evanalst
Message:

SDR-14 function updates.

File:
1 edited

Legend:

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

    r3713 r4051  
    11/** @file  psTime.h
    22 *
    3  *  @brief Definitions for time, time utilities, and conversion functions for use with psLib astronomy
    4  *  functions.
    5  *
    6  *  A collection of functions are required by psLib to manipulate time data. These functions primarily consist
    7  *  of conversions between specific time formats.  They use the UNIX timeval time system as the
    8  *  base upon which International Atomic Time (TAI) and Universal Time Coordinated (UTC) are calculated.
     3 *  @brief Definitions for time, time utilities, and conversion functions for use
     4 *  with psLib astronomy functions.
     5 *
     6 *  A collection of functions are required by psLib to manipulate time data. These
     7 *  functions primarily consist of conversions between specific time formats.  They
     8 *  use the UNIX timeval time system as the base upon which International Atomic
     9 *  Time (TAI) and Universal Time Coordinated (UTC) are calculated.
    910 *
    1011 *  @author Ross Harman, MHPCC
    1112 *
    12  *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-04-19 02:44:12 $
     13 *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-05-31 21:47:46 $
    1415 *
    1516 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
    1617 */
    17 
    1818
    1919#ifndef PSTIME_H
     
    8888/** Allocate time struct.
    8989 *
    90  * Allocates an empty time struct. User must specify the psTimeType (PS_TIME_TAI or PS_TIME_UTC) in the argument.
    91  * The seconds and microseconds members of the struct are set to zero.
     90 * Allocates an empty time struct. User must specify the psTimeType
     91 * (PS_TIME_TAI or PS_TIME_UTC) in the argument. The seconds and microseconds members
     92 * of the struct are set to zero.
    9293 *
    9394 * @return  psTime*: Struct with empty time.
     
    99100/** Get current time.
    100101 *
    101  * Gets current time from the system clock. User must specify the psTimeType (PS_TIME_TAI or PS_TIME_UTC) in
    102  * the argument.
     102 * Gets current time from the system clock. User must specify the psTimeType
     103 * (PS_TIME_TAI or PS_TIME_UTC) in the argument.
    103104 *
    104105 *  @return  psTime*: Struct with current time.
     
    121122/** Convert psTime to Local Mean Sidereal Time (LMST).
    122123 *
    123  *  Converts psTime at the given longitude to LMST time. If the input time is not in UTC format, then it is
    124  *  converted.
    125  *
    126  *  @return  double: LST Time.
    127  */
    128 double psTimeToLMST(
     124 *  Converts psTime at the given longitude to LMST time. If the input time is not
     125 *  in UTC format, then it is converted.
     126 *
     127 *  @return  psF64: LST Time.
     128 */
     129psF64 psTimeToLMST(
    129130    psTime *time,                       ///< psTime to be converted.
    130     double longitude                    ///< Longitude.
     131    psF64 longitude                    ///< Longitude.
    131132);
    132133
     
    135136 *  This function is necessary to for various SLALIB functions.
    136137 *
    137  *  @return  double: Time difference.
    138  */
    139 double psTimeGetUT1Delta(
     138 *  @return  psF64: Time difference.
     139 */
     140psF64 psTimeGetUT1Delta(
     141    const psTime *time,                 ///< psTime to be looked up.
     142    psTimeBulletin bulletin             ///< IERS bulletin to use
     143);
     144
     145/** Determine TAI - UTC from table lookup.
     146 *
     147 *  This function is necessary to for various psTime functions.
     148 *
     149 *  @return  psF64: Time difference.
     150 */
     151psF64 p_psTimeGetTAIDelta(
    140152    const psTime *time                  ///< psTime to be looked up.
    141153);
    142154
    143 /** Determine TAI - UTC from table lookup.
    144  *
    145  *  This function is necessary to for various psTime functions.
    146  *
    147  *  @return  double: Time difference.
    148  */
    149 double psTimeGetTAIDelta(
    150     const psTime *time                  ///< psTime to be looked up.
    151 );
    152 
    153155/** Determine polar coordinates at a given time.
    154156 *
     
    157159 *  @return  psSphere*: Spherical coordinates of Earth's polar axias.
    158160 */
    159 struct psSphere* psTimeGetPoleCoords(
    160                 const psTime *time                  ///< psTime determine polar orientation.
     161struct psSphere* p_psTimeGetPoleCoords(
     162                const psTime *time      ///< psTime determine polar orientation.
    161163            );
    162164
     
    172174);
    173175
     176/** Determine if UTC time is a leapsecond.
     177 *
     178 *  Determines if the specified UTC time is a valid leapsecond.
     179 *
     180 *  @return  psBool: valid leap second
     181 */
     182psBool psTimeIsLeapSecond(
     183    const psTime* utc                  ///< UTC to verify if leap second
     184);
     185
    174186/** Convert psTime to Julian date time.
    175187 *
    176  *  Converts psTime to Julian date (JD) time. This function does not add or subtract leapseconds.
    177  *
    178  *  @return  double: Julian Date (JD) time.
    179  */
    180 double psTimeToJD(
     188 *  Converts psTime to Julian date (JD) time. This function does not add or
     189 *  subtract leapseconds.
     190 *
     191 *  @return  psF64: Julian Date (JD) time.
     192 */
     193psF64 psTimeToJD(
    181194    const psTime* time                  ///< Input time to be converted.
    182195);
    183196/** Convert psTime to modified Julian date time.
    184197 *
    185  *  Converts psTime to modified Julian date (MJD) time. This function does not add or subtract leapseconds.
    186  *
    187  *  @return  double: Modified Julian Days (MJD) time.
    188  */
    189 double psTimeToMJD(
     198 *  Converts psTime to modified Julian date (MJD) time. This function does not
     199 *  add or subtract leapseconds.
     200 *
     201 *  @return  psF64: Modified Julian Days (MJD) time.
     202 */
     203psF64 psTimeToMJD(
    190204    const psTime* time                  ///< Input time to be converted.
    191205);
     
    193207/** Convert psTime to ISO8601 formatted string.
    194208 *
    195  *  Converts psTime to a null terminated string in the form of YYYY-MM-DDThh:mm:ss.sss. This function does not
    196  *  add or subtract leapseconds.
     209 *  Converts psTime to a null terminated string in the form of YYYY-MM-DDThh:mm:ss.sss.
     210 *  This function does not add or subtract leapseconds.
    197211 *
    198212 *  @return  char*: Pointer null terminated array of chars in ISO time.
     
    206220 *  Converts psTime to timeval time. This function does not add or subtract leapseconds.
    207221 *
    208  *  @return  timeval: timeval struct time.
    209  */
    210 struct timeval psTimeToTimeval(
    211                 const psTime* time                  ///< Input time to be converted.
     222 *  @return  timeval*: timeval struct time.
     223 */
     224struct timeval* psTimeToTimeval(
     225                const psTime* time     ///< Input time to be converted.
    212226            );
    213227
    214 /** Convert psTime to tm time.
    215  *
    216  * Converts psTime to tm time. This function is based on a Perl algorithm availble in the Pan-STARRS Image
    217  * processing Algorithm Design Description (ADD). This function does not add or subtract leapseconds.
     228/*
     229 * Convert psTime to tm time.
     230 *
     231 * Converts psTime to tm time. This function is based on a Perl algorithm availble
     232 * in the Pan-STARRS Image processing Algorithm Design Description (ADD). This function
     233 * does not add or subtract leapseconds.
    218234 *
    219235 *  @return  tm: tm struct time.
    220  */
    221 struct tm* psTimeToTM(
    222                 const psTime *time                  ///< Input time to be converted.
     236 *
     237struct tm* p_psTimeToTM(
     238                const psTime *time     ///< Input time to be converted.
    223239            );
    224 
     240*/
    225241/** Convert JD to psTime.
    226242 *
     
    230246 */
    231247psTime* psTimeFromJD(
    232     double time                         ///< Input time to be converted.
     248    psF64 time                       ///< Input time to be converted.
    233249);
    234250
     
    240256 */
    241257psTime* psTimeFromMJD(
    242     double time                         ///< Input time to be converted.
     258    psF64 time                      ///< Input time to be converted.
    243259);
    244260
     
    250266 */
    251267psTime* psTimeFromISO(
    252     const char* time                    ///< Input time to be converted.
     268    const char* time                 ///< Input time to be converted.
    253269);
    254270
     
    260276 */
    261277psTime* psTimeFromTimeval(
    262     const struct timeval *time          ///< Input time to be converted.
     278    const struct timeval *time       ///< Input time to be converted.
     279);
     280
     281/** Convert Terrestrial Time to psTime
     282 *
     283 *  Converts Terrestial Time to psTime.  This function assumes resultant time is of type TT.
     284 *
     285 *  @return psTime*: time (TT)
     286 */
     287psTime* psTimeFromTT(
     288    psS64 sec,                      ///< Input terrestrial time in seconds
     289    psU32 nsec                      ///< Input terrestrial time fraction of seconds (nanoseconds)
     290);
     291
     292/** Convert UTC time to psTime
     293 *
     294 *  Converts UTC time to psTime.  It will verify if time specified is a leapsecond.
     295 *
     296 *  @return psTime*: time (UTC)
     297 */
     298psTime* psTimeFromUTC(
     299    psS64  sec,                    ///< Input time in seconds
     300    psU32  nsec,                   ///< Input time fraction of seconds (nanoseconds)
     301    psBool leapsecond              ///< Input time is a leapsecond
    263302);
    264303
    265304/** Convert tm time to psTime.
    266305 *
    267  *  Converts tm time to psTime. This function is based on a Perl algorithm availble in the Pan-STARRS Image
    268  * processing Algorithm Design Description (ADD). This function does not add or subtract leapseconds.
     306 *  Converts tm time to psTime. This function is based on a Perl algorithm availble
     307 *  in the Pan-STARRS Image processing Algorithm Design Description (ADD). This function
     308 *  does not add or subtract leapseconds.
    269309 *
    270310 *  @return  psTime*: time.
    271311 */
    272 psTime* psTimeFromTM(
    273     const struct tm *time               ///< Input time to be converted.
     312psTime* p_psTimeFromTM(
     313    const struct tm *time            ///< Input time to be converted.
    274314);
    275315
     
    281321 */
    282322psTime* psTimeMath(
    283     const psTime *time,                 ///< Time.
    284     psF64 delta                         ///< Time delta.
     323    const psTime *time,              ///< Time.
     324    psF64 delta                      ///< Time delta.
    285325);
    286326
     
    292332 */
    293333psF64 psTimeDelta(
    294     const psTime *time1,                ///< First time.
    295     const psTime *time2                 ///< Second time.
     334    const psTime *time1,             ///< First time.
     335    const psTime *time2              ///< Second time.
    296336);
    297337
Note: See TracChangeset for help on using the changeset viewer.