Changeset 9976 for trunk/psLib/src/astro/psEarthOrientation.c
- Timestamp:
- Nov 14, 2006, 11:15:43 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/astro/psEarthOrientation.c (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psEarthOrientation.c
r9665 r9976 8 8 * @author Robert Daniel DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1.4 0$ $Name: not supported by cvs2svn $11 * @date $Date: 2006-1 0-20 00:17:21$10 * @version $Revision: 1.41 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2006-11-14 21:15:43 $ 12 12 * 13 13 * Copyright 2005 Maui High Performance Computing Center, University of Hawaii … … 284 284 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 285 285 "Aberration speed should not be equal to 0.\n"); 286 return NULL; 287 } 288 if (fabs(speed) > 1.0) { 289 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 290 "Aberration speed should not greater than the speed of light!.\n"); 286 291 return NULL; 287 292 } … … 445 450 // Convert psTime to MJD 446 451 double MJD = psTimeToMJD(time); 447 if ( MJD == NAN) {452 if (isnan(MJD)) { 448 453 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 449 454 "Time conversion to MJD failed. Invalid input time.\n"); … … 594 599 //Convert the input time to MJD. If NAN is returned, return NULL for the function. 595 600 double MJD = psTimeToMJD(time); 596 if ( MJD == NAN) {601 if (isnan(MJD)) { 597 602 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 598 603 "Time conversion to MJD failed. Invalid input time.\n"); … … 762 767 //Check if tidal corrections should be included. 763 768 //If so, make sure values are positive and in the correct range. 764 if (tidalCorr != NULL && tidalCorr->s != 0.0) {769 if (tidalCorr != NULL && fabs(tidalCorr->s) > FLT_EPSILON) { 765 770 int nsec = in->nsec + (int)(tidalCorr->s * 1e9); 766 771 if (nsec > 1e9) { … … 777 782 //Calculate the Julian Date from the input time in UT1 format. 778 783 double T = psTimeToJD(in); 779 if ( T == NAN) {784 if (isnan(T)) { 780 785 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 781 786 "Time conversion to JD failed. Invalid input time.\n"); … … 803 808 804 809 double MJD = psTimeToMJD(time); 805 if ( MJD == NAN) {810 if ( isnan(MJD) ) { 806 811 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 807 812 "Time conversion to MJD failed. Invalid input time.\n"); … … 858 863 k = 2; 859 864 } 860 if (k > (numRows-2)) {861 k = numRows-2;862 }865 // if (k > (numRows-2)) { 866 // k = numRows-2; 867 // } 863 868 for (int m = k-1; m <= k+2; m++) { 864 869 xTerm = X->data.F64[m]; … … 935 940 // Convert psTime to MJD 936 941 double MJD = psTimeToMJD(time); 937 if ( MJD == NAN) {942 if (isnan(MJD)) { 938 943 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 939 944 "Time conversion to MJD failed. Invalid input time.\n"); … … 1019 1024 double MJD = psTimeToMJD(time); 1020 1025 // printf("\nMJD check = %.13g\n", MJD); 1021 if ( MJD == NAN) {1026 if (isnan(MJD)) { 1022 1027 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 1023 1028 "Time conversion to MJD failed. Invalid input time.\n"); … … 1252 1257 // Calculate Julian centuries 1253 1258 //If either input time is NULL, assume it to be J2000 -> from SDRS as of rev 18 1259 psTime *from = NULL; 1260 psTime *to = NULL; 1254 1261 if (fromTime == NULL) { 1255 1262 fromMJD = MJD_2000; 1263 from = psTimeFromMJD(fromMJD); 1256 1264 } else { 1257 1265 fromMJD = psTimeToMJD(fromTime); 1266 from = psTimeCopy(fromTime); 1258 1267 } 1259 1268 if (toTime == NULL) { 1260 1269 toMJD = MJD_2000; 1270 to = psTimeFromMJD(toMJD); 1261 1271 } else { 1262 1272 toMJD = psTimeToMJD(toTime); 1263 } 1264 psTime *from = NULL; 1265 psTime *to = NULL; 1273 to = psTimeCopy(toTime); 1274 } 1266 1275 if (fromMJD > toMJD) { 1267 1276 psWarning("From time is later than to time in psSpherePrecess.\n"); … … 1290 1299 // Create transform with proper constants 1291 1300 psSphereRot* tmpST = psSphereRotAlloc(alphaP, deltaP, phiP); 1301 psFree(from); 1302 psFree(to); 1292 1303 return tmpST; 1293 1304 } else if (mode == PS_PRECESS_IAU2000A) { … … 1296 1307 //rotation corresponding to fromTime to the toTime rotation. 1297 1308 1298 //Since the time inputs are allowed to be NULL, either convert the MJD time1299 //or copy to non-NULL time1300 if (fromTime == NULL) {1301 from = psTimeFromMJD(fromMJD);1302 } else {1303 from = psTimeCopy(fromTime);1304 }1305 if (toTime == NULL) {1306 to = psTimeFromMJD(toMJD);1307 } else {1308 to = psTimeCopy(toTime);1309 }1310 1309 //Calculate the earthpoles and quaternions corresponding to each time (from, to). 1311 1310 //Combine the quaternions to produce the output psSphereRot. … … 1329 1328 //for COMPLETE_A come from the IERS Bulletin A. 1330 1329 1331 //Since the time inputs are allowed to be NULL, either convert the MJD time1332 //or copy to non-NULL time1333 if (fromTime == NULL) {1334 from = psTimeFromMJD(fromMJD);1335 } else {1336 from = psTimeCopy(fromTime);1337 }1338 if (toTime == NULL) {1339 to = psTimeFromMJD(toMJD);1340 } else {1341 to = psTimeCopy(toTime);1342 }1343 1330 //Calculate the earthpoles and quaternions corresponding to each time (from, to). 1344 1331 //Add in the precession corrections from IERS bulletin A. … … 1371 1358 //for COMPLETE_B come from the IERS Bulletin B. 1372 1359 1373 //Since the time inputs are allowed to be NULL, either convert the MJD time1374 //or copy to non-NULL time1375 if (fromTime == NULL) {1376 from = psTimeFromMJD(fromMJD);1377 } else {1378 from = psTimeCopy(fromTime);1379 }1380 if (toTime == NULL) {1381 to = psTimeFromMJD(toMJD);1382 } else {1383 to = psTimeCopy(toTime);1384 }1385 1386 1360 //Calculate the earthpoles and quaternions corresponding to each time (from, to). 1387 1361 //Add in the precession corrections from IERS bulletin B.
Note:
See TracChangeset
for help on using the changeset viewer.
