IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 10, 2004, 2:57:31 PM (22 years ago)
Author:
harman
Message:

Third redesign of time and date functions

File:
1 edited

Legend:

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

    r1614 r1788  
    5454 *  @author Ross Harman, MHPCC
    5555 *
    56  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    57  *  @date $Date: 2004-08-25 01:37:45 $
     56 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     57 *  @date $Date: 2004-09-11 00:55:13 $
    5858 *
    5959 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6868
    6969#include "psType.h"
     70#include "psImage.h"
    7071
    7172/// @addtogroup Time
     
    9192typedef struct psTime
    9293{
    93     psS64 sec;          ///< Seconds since epoch, Jan 1, 1970.
    94     psU32 usec;         ///< Microseconds since last second.
    95     psTimeType type;    ///< Type of time.
     94    psS64 sec;                          ///< Seconds since epoch, Jan 1, 1970.
     95    psU32 usec;                         ///< Microseconds since last second.
     96    psTimeType type;                    ///< Type of time.
    9697}
    9798psTime;
     
    105106 */
    106107psTime* psTimeGetTime(
    107     psTimeType type     ///< Type of time to get (UTC or TAI).
    108 );
    109 
     108    psTimeType type                     ///< Type of time to get (UTC or TAI).
     109);
    110110
    111111/** Convert psTime to UTC or TAI time.
     
    116116 */
    117117psTime* psTimeConvert(
    118     psTime *time,
    119     psTimeType type
     118    psTime *time,                       ///< Time to be converted.
     119    psTimeType type                     ///< Type to be converted to.
    120120);
    121121
     
    128128 */
    129129double psTimeToLST(
    130     psTime *time,       ///< psTime to be converted.
    131     double longitude    ///< Longitude.
    132 );
    133 
    134 /** Convert Local Mean Sidereal Time (LST) to psTime.
    135  *
    136  *  Converts LST time to psTime.
    137  *
    138  *  @return  psTime*: Pointer to psTime.
    139  */
    140 psTime* psLSTToTime(
    141     double time,       ///< LST time to be converted.
    142     double longitude   ///< Longitude.
     130    psTime *time,                       ///< psTime to be converted.
     131    double longitude                    ///< Longitude.
    143132);
    144133
     
    150139 */
    151140double psGetUT1Delta(
    152     psTime *time      ///< psTime to be looked up.
     141    psTime *time                        ///< psTime to be looked up.
    153142);
    154143
     
    160149 */
    161150double psGetTAIDelta(
    162     psTime *time      ///< psTime to be looked up.
     151    psTime *time                        ///< psTime to be looked up.
    163152);
    164153
     
    170159 */
    171160/*psSphere* psGetPoleCoords(
    172     psTime *time      ///< psTime determine polar orientation.
     161    psTime *time                        ///< psTime determine polar orientation.
    173162);*/
     163
     164/** Calculate the number of leapseconds between two times.
     165 *
     166 *  Calculates the number of leapseconds between two times.
     167 *
     168 *  @return  psSphere*: Spherical coordinates of Earth's polar axias.
     169 */
     170psF64 psTimeLeapseconds(
     171    const psTime *time1,                ///< First input time.
     172    const psTime *time2                 ///< Second input time.
     173);
    174174
    175175/** Convert psTime to Julian date time.
     
    215215/** Convert psTime to tm time.
    216216 *
    217  * Converts psTime to tm time. This function does not add or subtract leapseconds.
     217 * Converts psTime to tm time. This function is based on a Perl algorithm availble in the Pan-STARRS Image
     218 * processing Algorithm Design Description (ADD). This function does not add or subtract leapseconds.
    218219 *
    219220 *  @return  tm: tm struct time.
     
    250251 */
    251252psTime* psISOToTime(
    252     char *time                         ///< Input time to be converted.
     253    char *time                          ///< Input time to be converted.
    253254);
    254255
     
    265266/** Convert tm time to psTime.
    266267 *
    267  *  Converts tm time to psTime. This function does not add or subtract leapseconds.
     268 *  Converts tm time to psTime. This function is based on a Perl algorithm availble in the Pan-STARRS Image
     269 * processing Algorithm Design Description (ADD). This function does not add or subtract leapseconds.
    268270 *
    269271 *  @return  psTime*: time.
    270272 */
    271273psTime* psTMToTime(
    272     struct tm *time                    ///< Input time to be converted.
     274    struct tm *time                     ///< Input time to be converted.
    273275);
    274276
     
    279281 *  @return  psTime*: time.
    280282 */
    281 psTime* psTAIAdd(
    282     psTime *tai1,                    ///< First TAI time.
    283     psTime *tai2                     ///< Second TAI time.
     283psTime* psTimeAdd(
     284    psTime *tai1,                       ///< First TAI time.
     285    psTime *tai2                        ///< Second TAI time.
    284286);
    285287
     
    290292 *  @return  psTime*: time.
    291293 */
    292 psTime* psTAISub(
    293     psTime *tai1,                    ///< First TAI time.
    294     psTime *tai2                     ///< Second TAI time.
     294psTime* psTimeSub(
     295    psTime *tai1,                       ///< First TAI time.
     296    psTime *tai2                        ///< Second TAI time.
    295297);
    296298
     
    302304 *  @return  psTime*: time.
    303305 */
    304 psTime* psTAIDelta(
    305     psTime *tai1,                    ///< First TAI time.
    306     psTime *tai2                     ///< Second TAI time.
     306psTime* psTimeDelta(
     307    psTime *tai1,                       ///< First TAI time.
     308    psTime *tai2                        ///< Second TAI time.
     309);
     310
     311
     312/** Read TAI/UTC data file.
     313 *
     314 *  Reads TAI/UTC data file.
     315 *
     316 *  @return  psImage*: Two-dimensional array with table data.
     317 */
     318psImage* readTaiUtcFile(
     319    char *fileName                      ///< Name of file to read.
     320);
     321
     322
     323/** Read SER7 data file.
     324 *
     325 *  Reads SER7 data file.
     326 *
     327 *  @return  psImage*: Two-dimensional array with table data.
     328 */
     329psImage* readSer7File(
     330    char *fileName                      ///< Name of file to read.
     331);
     332
     333/** Read finals data file.
     334 *
     335 *  Reads finals data file.
     336 *
     337 *  @return  psImage*: Two-dimensional array with table data.
     338 */
     339psImage* readFinalsFile(
     340    char *fileName                      ///< Name of file to read.
     341);
     342
     343/** Read EOPC data file.
     344 *
     345 *  Reads EOPC data file.
     346 *
     347 *  @return  psImage*: Two-dimensional array with table data.
     348 */
     349psImage* readEopcFile(
     350    char *fileName                      ///< Name of file to read.
     351);
     352
     353/** Lookup and interpolate TAI-UTC data
     354 *
     355 *  Interpolates TAI-UTC data, given time in MJD format.
     356 *
     357 *  @return  double: Interpolated value.
     358 */
     359double lookupTaiUtcTable(
     360    psImage *table,                     ///< Table with data.
     361    psTime *time                        ///< time to lookup.
     362);
     363
     364/** Lookup and interpolate polar or UT1-UTC data
     365 *
     366 *  Interpolates TAI-UT1 or polar coordinate data, given time in MJD format.
     367 *
     368 *  @return  double: Interpolated value.
     369 */
     370double lookupSer7Table(
     371    psImage *table,                      ///< Table with data.
     372    psTime *time,                        ///< time to lookup.
     373    int col                              ///< Column to lookup.
    307374);
    308375/// @}
Note: See TracChangeset for help on using the changeset viewer.