Changeset 2001 for trunk/psLib/src/astronomy/psTime.c
- Timestamp:
- Oct 7, 2004, 9:16:49 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/astronomy/psTime.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astronomy/psTime.c
r1864 r2001 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.2 4$ $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 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 67 67 } 68 68 69 /** Preprocessor macro to allocate psTime str ict */69 /** Preprocessor macro to allocate psTime struct */ 70 70 #define ALLOC_TIME(TIME) \ 71 71 TIME = (psTime*)psAlloc(sizeof(psTime)); \ … … 469 469 // Convert Universal Time (UTC) to UT1 470 470 ALLOC_TIME(ut1UtcDelta); 471 ALLOC_TIME(ut1Time);471 // ALLOC_TIME(ut1Time); 472 472 ut1UtcDelta->usec = psGetUT1Delta(utcTime)*1e6; 473 473 ut1Time = psTimeAdd(utcTime, ut1UtcDelta); … … 479 479 480 480 // Calculate Terrestial Dynamical Time (TDT) 481 ALLOC_TIME(tdtTime);481 // ALLOC_TIME(tdtTime); 482 482 ALLOC_TIME(tdtDelta); 483 483 tdtDelta->sec = 32; … … 514 514 double psGetUT1Delta(psTime *time) 515 515 { 516 psImage *iersTable = NULL;516 static psImage* iersTable = NULL; 517 517 double ut1UtcDeltaUsec = 0.0; 518 518 519 519 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 521 527 ut1UtcDeltaUsec = lookupSer7Table(iersTable, time, 6)*1.0e6; 522 528 … … 527 533 { 528 534 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 } 533 544 delta = lookupTaiUtcTable(taiUtcTable, time); 534 545
Note:
See TracChangeset
for help on using the changeset viewer.
