Changeset 3325
- Timestamp:
- Feb 24, 2005, 4:49:00 PM (21 years ago)
- Location:
- trunk/psLib/src
- Files:
-
- 4 edited
-
astro/psCoord.c (modified) (3 diffs)
-
astronomy/psAstronomyErrors.dat (modified) (1 diff)
-
astronomy/psAstronomyErrors.h (modified) (2 diffs)
-
astronomy/psCoord.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psCoord.c
r3292 r3325 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1.5 2$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-02- 19 02:43:11$12 * @version $Revision: 1.53 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-02-25 02:49:00 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 32 32 /******************************************************************************/ 33 33 34 // None 34 // Modified Julian Day 01/01/1900 00:00:00 35 #define MJD_1900 15021.0 36 37 // Days in Julian century 38 #define JULIAN_CENTURY 36525.0 35 39 36 40 /******************************************************************************/ … … 315 319 psSphereTransform* psSphereTransformICRSToEcliptic(psTime *time) 316 320 { 321 psF64 T; 322 323 // Check for null parameter 317 324 PS_PTR_CHECK_NULL(time, NULL); 325 326 // Convert psTime to MJD 318 327 psF64 MJD = psTimeToMJD(time); 319 struct tm *tmTime = psTimeToTM(time); 320 psF64 year = (psF64)(1900 - MJD + tmTime->tm_year); 321 psF64 T = year / 100.0; 328 329 // Check the specified MJD is greater than 1900 330 if ( MJD < MJD_1900 ) { 331 psError(PS_ERR_BAD_PARAMETER_TYPE,true,PS_ERRORTEXT_psCoord_INVALID_MJD); 332 return NULL; 333 } 334 335 // Calculate number of Julian centuries since 1900 336 T = ( MJD - MJD_1900 ) / JULIAN_CENTURY; 337 322 338 psF64 alphaP = 0.0; 323 339 psF64 deltaP = DEG_TO_RAD(23.0) + 324 SEC_TO_RAD(27.0) +325 MIN_TO_RAD(8.0) -340 MIN_TO_RAD(27.0) + 341 SEC_TO_RAD(8.26) - 326 342 (SEC_TO_RAD(46.845) * T) - 327 343 (SEC_TO_RAD(0.0059) * T * T) + 328 344 (SEC_TO_RAD(0.00181) * T * T * T); 329 345 psF64 phiP = 0.0; 330 331 psFree(tmTime);332 346 333 347 // Don't neglect the minus sign on deltaP (bug 244): -
trunk/psLib/src/astronomy/psAstronomyErrors.dat
r2648 r3325 32 32 psCoord_UNITS_UNKNOWN Specified units, 0x%x, is not supported. 33 33 psCoord_OFFSET_MODE_UNKNOWN Specified offset mode, 0x%x, is not supported. 34 psCoord_INVALID_MJD Specified time is less than 1900. 34 35 # 35 36 psAstrometry_NONLINEAR_TRANSFORM The %s transfrom is not linear. Only linear transforms are supported. -
trunk/psLib/src/astronomy/psAstronomyErrors.h
r3264 r3325 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $10 * @date $Date: 2005-02- 17 19:26:23$9 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2005-02-25 02:49:00 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 52 52 #define PS_ERRORTEXT_psCoord_UNITS_UNKNOWN "Specified units, 0x%x, is not supported." 53 53 #define PS_ERRORTEXT_psCoord_OFFSET_MODE_UNKNOWN "Specified offset mode, 0x%x, is not supported." 54 #define PS_ERRORTEXT_psCoord_INVALID_MJD "Specified time is less than 1900." 54 55 #define PS_ERRORTEXT_psAstrometry_NONLINEAR_TRANSFORM "The %s transfrom is not linear. Only linear transforms are supported." 55 56 #define PS_ERRORTEXT_psMetadata_METATYPE_INVALID "Specified psMetadataType, %d, is not supported." -
trunk/psLib/src/astronomy/psCoord.c
r3292 r3325 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1.5 2$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-02- 19 02:43:11$12 * @version $Revision: 1.53 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-02-25 02:49:00 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 32 32 /******************************************************************************/ 33 33 34 // None 34 // Modified Julian Day 01/01/1900 00:00:00 35 #define MJD_1900 15021.0 36 37 // Days in Julian century 38 #define JULIAN_CENTURY 36525.0 35 39 36 40 /******************************************************************************/ … … 315 319 psSphereTransform* psSphereTransformICRSToEcliptic(psTime *time) 316 320 { 321 psF64 T; 322 323 // Check for null parameter 317 324 PS_PTR_CHECK_NULL(time, NULL); 325 326 // Convert psTime to MJD 318 327 psF64 MJD = psTimeToMJD(time); 319 struct tm *tmTime = psTimeToTM(time); 320 psF64 year = (psF64)(1900 - MJD + tmTime->tm_year); 321 psF64 T = year / 100.0; 328 329 // Check the specified MJD is greater than 1900 330 if ( MJD < MJD_1900 ) { 331 psError(PS_ERR_BAD_PARAMETER_TYPE,true,PS_ERRORTEXT_psCoord_INVALID_MJD); 332 return NULL; 333 } 334 335 // Calculate number of Julian centuries since 1900 336 T = ( MJD - MJD_1900 ) / JULIAN_CENTURY; 337 322 338 psF64 alphaP = 0.0; 323 339 psF64 deltaP = DEG_TO_RAD(23.0) + 324 SEC_TO_RAD(27.0) +325 MIN_TO_RAD(8.0) -340 MIN_TO_RAD(27.0) + 341 SEC_TO_RAD(8.26) - 326 342 (SEC_TO_RAD(46.845) * T) - 327 343 (SEC_TO_RAD(0.0059) * T * T) + 328 344 (SEC_TO_RAD(0.00181) * T * T * T); 329 345 psF64 phiP = 0.0; 330 331 psFree(tmTime);332 346 333 347 // Don't neglect the minus sign on deltaP (bug 244):
Note:
See TracChangeset
for help on using the changeset viewer.
