IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 7, 2004, 9:16:49 AM (22 years ago)
Author:
desonia
Message:

changes resulting of testing (bugs found).

File:
1 edited

Legend:

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

    r1864 r2001  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2004-09-23 18:31:49 $
     13 *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2004-10-07 19:16:46 $
    1515 *
    1616 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6767                }
    6868
    69                 /** Preprocessor macro to allocate psTime strict */
     69                /** Preprocessor macro to allocate psTime struct */
    7070                #define ALLOC_TIME(TIME)                                                                                     \
    7171                TIME = (psTime*)psAlloc(sizeof(psTime));                                                                     \
     
    469469    // Convert Universal Time (UTC) to  UT1
    470470    ALLOC_TIME(ut1UtcDelta);
    471     ALLOC_TIME(ut1Time);
     471    // ALLOC_TIME(ut1Time);
    472472    ut1UtcDelta->usec = psGetUT1Delta(utcTime)*1e6;
    473473    ut1Time = psTimeAdd(utcTime, ut1UtcDelta);
     
    479479
    480480    // Calculate Terrestial Dynamical Time (TDT)
    481     ALLOC_TIME(tdtTime);
     481    // ALLOC_TIME(tdtTime);
    482482    ALLOC_TIME(tdtDelta);
    483483    tdtDelta->sec = 32;
     
    514514double psGetUT1Delta(psTime *time)
    515515{
    516     psImage *iersTable = NULL;
     516    static psImage* iersTable = NULL;
    517517    double ut1UtcDeltaUsec = 0.0;
    518518
    519519
    520     iersTable = readSer7File("../../data/ser7.dat");
     520    if (iersTable == NULL) {
     521        iersTable = readSer7File("../../data/ser7.dat");
     522        p_psMemSetPersistent(iersTable,true);
     523        p_psMemSetPersistent(iersTable->data.V,true);
     524        p_psMemSetPersistent(iersTable->rawDataBuffer,true);
     525    }
     526
    521527    ut1UtcDeltaUsec = lookupSer7Table(iersTable, time, 6)*1.0e6;
    522528
     
    527533{
    528534    double delta = 0.0;
    529     psImage *taiUtcTable = NULL;
    530 
    531 
    532     taiUtcTable = readTaiUtcFile("../../data/tai-utc.dat");
     535    static psImage* taiUtcTable = NULL;
     536
     537
     538    if (taiUtcTable == NULL) {
     539        taiUtcTable = readTaiUtcFile("../../data/tai-utc.dat");
     540        p_psMemSetPersistent(taiUtcTable,true);
     541        p_psMemSetPersistent(taiUtcTable->data.V,true);
     542        p_psMemSetPersistent(taiUtcTable->rawDataBuffer,true);
     543    }
    533544    delta = lookupTaiUtcTable(taiUtcTable, time);
    534545
Note: See TracChangeset for help on using the changeset viewer.