IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4409 for trunk/psLib/src/astro


Ignore:
Timestamp:
Jun 28, 2005, 10:17:52 AM (21 years ago)
Author:
drobbin
Message:

updated files in accordance with requested revisions in apidelta-report-cycle6

Location:
trunk/psLib/src/astro
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astro/psTime.c

    r4330 r4409  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.64 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-06-21 03:01:37 $
     12 *  @version $Revision: 1.65 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-06-28 20:17:52 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    11661166}
    11671167
    1168 char* psTimeToISO(const psTime *time)
     1168psString psTimeToISO(const psTime *time)
    11691169{
    11701170    psS32 ds = 0;
     
    13531353}
    13541354
    1355 psTime* psTimeFromISO(const char *time)
     1355psTime* psTimeFromISO(const char *input)
    13561356{
    13571357    psS32 millisecond;
     
    13601360
    13611361    // Check for NULL string
    1362     PS_ASSERT_PTR_NON_NULL(time,NULL);
     1362    PS_ASSERT_PTR_NON_NULL(input,NULL);
    13631363
    13641364    // Convert YYYY-MM-DDThh:mm:ss.sss in string form to tm time
    1365     if (sscanf(time, "%d-%d-%dT%d:%d:%d,%d", &tmTime.tm_year, &tmTime.tm_mon, &tmTime.tm_mday,
     1365    if (sscanf(input, "%d-%d-%dT%d:%d:%d,%d", &tmTime.tm_year, &tmTime.tm_mon, &tmTime.tm_mday,
    13661366               &tmTime.tm_hour, &tmTime.tm_min, &tmTime.tm_sec,&millisecond) < 7) {
    1367         psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_ISOTIME_MALFORMED, time);
     1367        psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psTime_ISOTIME_MALFORMED, input);
    13681368        return NULL;
    13691369    }
     
    14261426}
    14271427
    1428 psTime* psTimeFromTimeval(const struct timeval *time)
     1428psTime* psTimeFromTimeval(const struct timeval *input)
    14291429{
    14301430    psTime *outTime = NULL;
     
    14321432
    14331433    // Error check
    1434     PS_ASSERT_PTR_NON_NULL(time,NULL);
     1434    PS_ASSERT_PTR_NON_NULL(input,NULL);
    14351435
    14361436    // Allocate psTime struct
     
    14381438
    14391439    // Convert to psTime
    1440     outTime->sec = time->tv_sec;
    1441     outTime->nsec = time->tv_usec * 1000;
     1440    outTime->sec = input->tv_sec;
     1441    outTime->nsec = input->tv_usec * 1000;
    14421442
    14431443    // Error check
  • trunk/psLib/src/astro/psTime.h

    r4330 r4409  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-06-21 03:01:37 $
     13 *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-06-28 20:17:52 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3838 */
    3939typedef enum {
    40     PS_TIME_TAI,        ///< Temps Atomique International (TAI) time (time with leapseconds).
    41     PS_TIME_UTC,        ///< Universal Time Coordinated (UTC) time (time without leapseconds).
    42     PS_TIME_UT1,        ///< Universal Time corrected for polar motion
    43     PS_TIME_TT,         ///< Terrestrial Time
     40    PS_TIME_TAI,                       ///< Temps Atomique International (TAI) time (time with leapseconds)
     41    PS_TIME_UTC,                       ///< Universal Time Coordinated (UTC) time (time without leapseconds)
     42    PS_TIME_UT1,                       ///< Universal Time corrected for polar motion
     43    PS_TIME_TT,                        ///< Terrestrial Time
    4444} psTimeType;
    4545
     
    4949 */
    5050typedef enum {
    51     PS_IERS_A,          ///< IERS Bulletin A
    52     PS_IERS_B,          ///< IERS Bulletin B
     51    PS_IERS_A,                         ///< IERS Bulletin A
     52    PS_IERS_B,                         ///< IERS Bulletin B
    5353} psTimeBulletin;
    5454
     
    6262typedef struct psTime
    6363{
    64     psS64 sec;          ///< Seconds since epoch, Jan 1, 1970.
    65     psU32 nsec;         ///< Nanoseconds since last second.
    66     psBool leapsecond;  ///< if time falls on UTC leapsecond
    67     psTimeType type;    ///< Type of time.
     64    psS64 sec;                         ///< Seconds since epoch, Jan 1, 1970.
     65    psU32 nsec;                        ///< Nanoseconds since last second.
     66    psBool leapsecond;                 ///< if time falls on UTC leapsecond
     67    psTimeType type;                   ///< Type of time.
    6868}
    6969psTime;
     
    9797 */
    9898psTime* psTimeAlloc(
    99     psTimeType type                     ///< Type of time to create (UTC or TAI).
     99    psTimeType type                    ///< Type of time to create (UTC or TAI).
    100100);
    101101
     
    108108 */
    109109psTime* psTimeGetNow(
    110     psTimeType type                     ///< Type of time to get (UTC or TAI).
     110    psTimeType type                    ///< Type of time to get (UTC or TAI).
    111111);
    112112
     
    118118 */
    119119psTime* psTimeConvert(
    120     psTime *time,                       ///< Time to be converted.
    121     psTimeType type                     ///< Type to be converted to.
     120    psTime *time,                      ///< Time to be converted.
     121    psTimeType type                    ///< Type to be converted to.
    122122);
    123123
     
    131131double psTimeToLMST(
    132132    psTime *time,                      ///< psTime to be converted.
    133     double longitude                    ///< Longitude.
     133    double longitude                   ///< Longitude.
    134134);
    135135
     
    141141 */
    142142double psTimeGetUT1Delta(
    143     const psTime *time,                 ///< psTime to be looked up.
    144     psTimeBulletin bulletin             ///< IERS bulletin to use
     143    const psTime *time,                ///< psTime to be looked up.
     144    psTimeBulletin bulletin            ///< IERS bulletin to use
    145145);
    146146
     
    152152 */
    153153psF64 p_psTimeGetTAIDelta(
    154     const psTime *time                  ///< psTime to be looked up.
     154    const psTime *time                 ///< psTime to be looked up.
    155155);
    156156
     
    212212 *  This function does not add or subtract leapseconds.
    213213 *
    214  *  @return  char*: Pointer null terminated array of chars in ISO time.
    215  */
    216 char* psTimeToISO(
     214 *  @return  psString:    Pointer null terminated array of chars in ISO time.
     215 */
     216psString psTimeToISO(
    217217    const psTime* time                  ///< Input time to be converted.
    218218);
     
    268268 */
    269269psTime* psTimeFromISO(
    270     const char* time                   ///< Input time to be converted.
     270    const char* input                  ///< Input time to be converted.
    271271);
    272272
     
    278278 */
    279279psTime* psTimeFromTimeval(
    280     const struct timeval *time         ///< Input time to be converted.
     280    const struct timeval *input        ///< Input time to be converted.
    281281);
    282282
     
    296296 *  Converts UTC time to psTime.  It will verify if time specified is a leapsecond.
    297297 *
    298  *  @return psTime*: time (UTC)
     298 *  @return psTime*: time (UTC)time
    299299 */
    300300psTime* psTimeFromUTC(
Note: See TracChangeset for help on using the changeset viewer.