Changeset 3332
- Timestamp:
- Feb 25, 2005, 10:52:28 AM (21 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 2 edited
-
astro/psCoord.c (modified) (4 diffs)
-
astronomy/psCoord.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psCoord.c
r3325 r3332 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1.5 3$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-02-25 02:49:00$12 * @version $Revision: 1.54 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-02-25 20:52:28 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 84 84 } 85 85 86 // XXX: Must test psSphereAlloc() and sphereFree().87 // XXX: Must rewrite code and tests to use these functions.88 86 psSphere* psSphereAlloc(void) 89 87 { … … 352 350 psSphereTransform* psSphereTransformEclipticToICRS(psTime *time) 353 351 { 352 psF64 T; 353 354 // Check for null parameter 354 355 PS_PTR_CHECK_NULL(time, NULL); 356 357 // Convert psTime to MJD 355 358 psF64 MJD = psTimeToMJD(time); 356 struct tm *tmTime = psTimeToTM(time); 357 psF64 year = (psF64)(1900 - MJD + tmTime->tm_year); 358 psF64 T = year / 100.0; 359 360 // Check the specified MJD is greater than 1900 361 if ( MJD < MJD_1900 ) { 362 psError(PS_ERR_BAD_PARAMETER_TYPE,true,PS_ERRORTEXT_psCoord_INVALID_MJD); 363 return NULL; 364 } 365 366 // Calculate number of Julian centuries since 1900 367 T = ( MJD - MJD_1900 ) / JULIAN_CENTURY; 368 359 369 psF64 alphaP = 0.0; 360 370 psF64 deltaP = DEG_TO_RAD(23.0) + 361 SEC_TO_RAD(27.0) +362 MIN_TO_RAD(8.0) -371 MIN_TO_RAD(27.0) + 372 SEC_TO_RAD(8.26) - 363 373 (SEC_TO_RAD(46.845) * T) - 364 374 (SEC_TO_RAD(0.0059) * T * T) + … … 366 376 psF64 phiP = 0.0; 367 377 368 psFree(tmTime);369 378 return (psSphereTransformAlloc(alphaP, deltaP, phiP)); 370 379 } -
trunk/psLib/src/astronomy/psCoord.c
r3325 r3332 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1.5 3$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-02-25 02:49:00$12 * @version $Revision: 1.54 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-02-25 20:52:28 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 84 84 } 85 85 86 // XXX: Must test psSphereAlloc() and sphereFree().87 // XXX: Must rewrite code and tests to use these functions.88 86 psSphere* psSphereAlloc(void) 89 87 { … … 352 350 psSphereTransform* psSphereTransformEclipticToICRS(psTime *time) 353 351 { 352 psF64 T; 353 354 // Check for null parameter 354 355 PS_PTR_CHECK_NULL(time, NULL); 356 357 // Convert psTime to MJD 355 358 psF64 MJD = psTimeToMJD(time); 356 struct tm *tmTime = psTimeToTM(time); 357 psF64 year = (psF64)(1900 - MJD + tmTime->tm_year); 358 psF64 T = year / 100.0; 359 360 // Check the specified MJD is greater than 1900 361 if ( MJD < MJD_1900 ) { 362 psError(PS_ERR_BAD_PARAMETER_TYPE,true,PS_ERRORTEXT_psCoord_INVALID_MJD); 363 return NULL; 364 } 365 366 // Calculate number of Julian centuries since 1900 367 T = ( MJD - MJD_1900 ) / JULIAN_CENTURY; 368 359 369 psF64 alphaP = 0.0; 360 370 psF64 deltaP = DEG_TO_RAD(23.0) + 361 SEC_TO_RAD(27.0) +362 MIN_TO_RAD(8.0) -371 MIN_TO_RAD(27.0) + 372 SEC_TO_RAD(8.26) - 363 373 (SEC_TO_RAD(46.845) * T) - 364 374 (SEC_TO_RAD(0.0059) * T * T) + … … 366 376 psF64 phiP = 0.0; 367 377 368 psFree(tmTime);369 378 return (psSphereTransformAlloc(alphaP, deltaP, phiP)); 370 379 }
Note:
See TracChangeset
for help on using the changeset viewer.
