Changeset 6189
- Timestamp:
- Jan 24, 2006, 5:02:47 PM (20 years ago)
- Location:
- trunk/psLib
- Files:
-
- 5 edited
-
src/types/psArguments.h (modified) (6 diffs)
-
src/types/psMetadata.c (modified) (5 diffs)
-
src/types/psMetadataConfig.c (modified) (3 diffs)
-
test/astro/tst_psEarthOrientation.c (modified) (15 diffs)
-
test/astro/tst_psSphereOps.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/types/psArguments.h
r6187 r6189 7 7 * @author David Robbins, MHPCC 8 8 * 9 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $10 * @date $Date: 2006-01-2 3 23:52:15$9 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-01-25 03:02:47 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 28 28 */ 29 29 int psArgumentVerbosity( 30 int *argc, ///< number o rarguments30 int *argc, ///< number of arguments 31 31 char **argv ///< the argument list 32 32 ); … … 37 37 */ 38 38 int psArgumentGet( 39 int argc, ///< number o rarguments39 int argc, ///< number of arguments 40 40 char **argv, ///< the argument list 41 41 const char *arg ///< the specified argument to match … … 50 50 bool psArgumentRemove( 51 51 int argnum, ///< the argument to remove 52 int *argc, ///< number o rarguments52 int *argc, ///< number of arguments 53 53 char **argv ///< the argument list 54 54 ); … … 65 65 bool psArgumentParse( 66 66 psMetadata *arguments, ///< metadata container for arguments 67 int *argc, ///< number o rarguments67 int *argc, ///< number of arguments 68 68 char **argv ///< the argument list 69 69 ); … … 74 74 ); 75 75 76 /** Sets the log level. 77 * 78 * @return psS32: the log level. 79 */ 76 80 psS32 psLogArguments( 77 int *argc, 78 char **argv 81 int *argc, ///< number of arguments 82 char **argv ///< the argument list 79 83 ); 80 84 85 /** Sets trace levels by facility 86 * 87 * @return psS32: 1 (true) if successful or else 2. 88 */ 81 89 psS32 psTraceArguments( 82 int *argc, 83 char **argv 90 int *argc, ///< number of arguments 91 char **argv ///< the argument list 84 92 ); 85 93 -
trunk/psLib/src/types/psMetadata.c
r6187 r6189 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.9 4$ $Name: not supported by cvs2svn $15 * @date $Date: 2006-01-2 3 23:52:15$14 * @version $Revision: 1.95 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2006-01-25 03:02:47 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 886 886 *status = false; 887 887 } else { 888 psError(PS_ERR_IO, true, "Couldn't find %s in the metadata.\n" );888 psError(PS_ERR_IO, true, "Couldn't find %s in the metadata.\n", key); 889 889 } 890 890 } else if (item->type != PS_DATA_METADATA) { … … 893 893 *status = false; 894 894 } else { 895 psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_DATA_META, as expected.\n" );895 psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_DATA_META, as expected.\n", key); 896 896 } 897 897 value = NULL; … … 921 921 *status = false; 922 922 } else { 923 psError(PS_ERR_IO, true, "Couldn't find %s in the metadata.\n" );923 psError(PS_ERR_IO, true, "Couldn't find %s in the metadata.\n", key); 924 924 } 925 925 } else if (item->type != PS_DATA_STRING) { … … 928 928 *status = false; 929 929 } else { 930 psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_DATA_STRING, as expected.\n" );930 psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_DATA_STRING, as expected.\n", key); 931 931 } 932 932 value = NULL; -
trunk/psLib/src/types/psMetadataConfig.c
r5841 r6189 10 10 * @author Eric Van Alst, MHPCC 11 11 * 12 * @version $Revision: 1. 49$ $Name: not supported by cvs2svn $13 * @date $Date: 200 5-12-24 00:33:20$12 * @version $Revision: 1.50 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2006-01-25 03:02:47 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 1417 1417 strncat(mdString, "F32 ", MAXSTR); 1418 1418 for (i = 0; ((psVector*)(item->data.V))->data.F32[i] != 0; i++) { 1419 snprintf(content, MAXSTR, "% f",1419 snprintf(content, MAXSTR, "%22.15g", 1420 1420 ((psVector*)(item->data.V))->data.F32[i]); 1421 1421 if ( ((psVector*)(item->data.V))->data.F32[i+1] != 0 ) { … … 1428 1428 strncat(mdString, "F64 ", MAXSTR); 1429 1429 for (i = 0; ((psVector*)(item->data.V))->data.F64[i] != 0; i++) { 1430 snprintf(content, MAXSTR, "% lf",1430 snprintf(content, MAXSTR, "%22.15g", 1431 1431 ((psVector*)(item->data.V))->data.F64[i]); 1432 1432 if ( ((psVector*)(item->data.V))->data.F64[i+1] != 0 ) { -
trunk/psLib/test/astro/tst_psEarthOrientation.c
r6184 r6189 5 5 * @author d-Rob, MHPCC 6 6 * 7 * @version $Revision: 1.2 8$ $Name: not supported by cvs2svn $8 * @date $Date: 2006-01-2 3 20:04:31$7 * @version $Revision: 1.29 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2006-01-25 03:02:47 $ 9 9 * 10 10 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 305 305 psEarthPole *pmodel = NULL; 306 306 //Return NULL for NULL time input 307 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 307 308 pmodel = psEOC_PrecessionModel(empty); 308 309 if (pmodel != NULL) { … … 312 313 } 313 314 //Return NULL for UT1 time input 315 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 314 316 psTime *UT1time = psTimeAlloc(PS_TIME_UT1); 315 317 pmodel = psEOC_PrecessionModel(UT1time); … … 361 363 time2->nsec = 0; 362 364 time2->leapsecond = false; 363 364 //XXX: MAY Be an Error here... Time for Precession Correction has to be TAI or seg faults 365 time2 = psTimeConvert(time2, PS_TIME_TAI); 365 // time2 = psTimeConvert(time2, PS_TIME_TAI); 366 366 367 //Tests for Precession Correction function// 367 368 //Return NULL for NULL time input 368 369 psEarthPole *pcorr = NULL; 370 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 369 371 pcorr = psEOC_PrecessionCorr(empty, PS_IERS_A); 370 372 if (pcorr != NULL) { … … 375 377 376 378 //Return NULL for Invalid IERS table 379 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 377 380 pcorr = psEOC_PrecessionCorr(time2, 3); 378 381 if (pcorr != NULL) { … … 522 525 523 526 //Return NULL for NULL input time 527 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 524 528 polarMotion = psEOC_GetPolarMotion(empty, PS_IERS_B); 525 529 if (polarMotion != NULL) { … … 529 533 } 530 534 //Return NULL for incorrect Bulletin. 535 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 531 536 polarMotion = psEOC_GetPolarMotion(empty, 3); 532 537 if (polarMotion != NULL) { … … 625 630 psEarthPole *eop = NULL; 626 631 632 //Return NULL for NULL input time 633 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 627 634 eop = psEOC_PolarTideCorr(empty); 628 635 if (eop != NULL) { … … 658 665 659 666 //Return NULL for NULL input time. 667 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 660 668 nute = psEOC_NutationCorr(empty); 661 669 if (nute != NULL) { … … 705 713 706 714 //return NULL for NULL input time 715 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 707 716 rot = psSphereRot_TEOtoCEO(empty, NULL); 708 717 if (rot != NULL) { … … 783 792 q3 = -0.9999999897238481; 784 793 794 //Return NULL for NULL input earthpole 795 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 785 796 rot = psSphereRot_CEOtoGCRS(empty); 786 797 if (rot != NULL) { … … 793 804 if (rot == NULL) { 794 805 psError(PS_ERR_BAD_PARAMETER_NULL, false, 795 "psSphereRot_CEOtoGCRS return NULL for valid psEarthPole input.\n");806 "psSphereRot_CEOtoGCRS returned NULL for valid psEarthPole input.\n"); 796 807 return 2; 797 808 } … … 857 868 in->s = SEC_TO_RAD(in->s); 858 869 870 //Return NULL for NULL input earthpole 871 psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message"); 859 872 rot = psSphereRot_ITRStoTEO(empty); 860 873 if (rot != NULL) { … … 863 876 return 1; 864 877 } 878 865 879 rot = psSphereRot_ITRStoTEO(in); 866 880 if (rot == NULL) { … … 1050 1064 psFree(rot); 1051 1065 1052 // Invoke precess with invalid parameter 1053 /* 1054 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message"); 1055 outputCoord = psSpherePrecess(inputCoord, fromTime, NULL); 1056 if(outputCoord != NULL) { 1057 psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid input"); 1058 return 10; 1059 } 1060 1061 // Invoke precess with invalid parameter 1062 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message"); 1063 outputCoord = psSpherePrecess(inputCoord, NULL, toTime); 1064 if(outputCoord != NULL) { 1065 psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid input"); 1066 return 11; 1067 } 1068 */ 1066 //Test other modes (IAU2000A, COMPLETE_[A,B]) 1067 // Set input coordinate 1068 inputCoord->r = SPHERE_PRECESS_TP1_R; 1069 inputCoord->d = SPHERE_PRECESS_TP1_D; 1070 inputCoord->rErr = 0.0; 1071 inputCoord->dErr = 0.0; 1072 // Calculate precess 1073 rot = psSpherePrecess(fromTime, toTime, PS_PRECESS_COMPLETE_A); 1074 outputCoord = psSphereRotApply(NULL, rot, inputCoord); 1075 if (outputCoord->r < -0.000001) { 1076 outputCoord->r += 2.0 * M_PI; 1077 } 1078 // Verify return is not NULL 1079 if(outputCoord == NULL) { 1080 psError(PS_ERR_UNKNOWN,true,"Returned NULL not expected"); 1081 return 10; 1082 } 1083 psFree(outputCoord); 1084 psFree(rot); 1085 1086 rot = psSpherePrecess(fromTime, toTime, PS_PRECESS_COMPLETE_B); 1087 outputCoord = psSphereRotApply(NULL, rot, inputCoord); 1088 if (outputCoord->r < -0.000001) { 1089 outputCoord->r += 2.0 * M_PI; 1090 } 1091 // Verify return is not NULL 1092 if(outputCoord == NULL) { 1093 psError(PS_ERR_UNKNOWN,true,"Returned NULL not expected"); 1094 return 11; 1095 } 1096 psFree(outputCoord); 1097 psFree(rot); 1098 1099 rot = psSpherePrecess(fromTime, toTime, PS_PRECESS_IAU2000A); 1100 outputCoord = psSphereRotApply(NULL, rot, inputCoord); 1101 if (outputCoord->r < -0.000001) { 1102 outputCoord->r += 2.0 * M_PI; 1103 } 1104 // Verify return is not NULL 1105 if(outputCoord == NULL) { 1106 psError(PS_ERR_UNKNOWN,true,"Returned NULL not expected"); 1107 return 12; 1108 } 1109 psFree(outputCoord); 1110 psFree(rot); 1111 1069 1112 // Invoke precess with invalid parameter 1070 1113 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message"); 1071 1114 rot = psSpherePrecess(fromTime, toTime, 10); 1072 // outputCoord = psSpherePrecess(NULL, fromTime, toTime, PS_PRECESS_ROUGH);1073 1115 if(rot != NULL) { 1074 // if(outputCoord != NULL) {1075 1116 psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid input"); 1117 return 14; 1118 } 1119 // Return NULL for NULL input times 1120 psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message"); 1121 rot = psSpherePrecess(NULL, NULL, PS_PRECESS_ROUGH); 1122 if(rot != NULL) { 1123 psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid input"); 1124 return 15; 1125 } 1126 1127 if (!p_psEOCFinalize() ) { 1128 psError(PS_ERR_BAD_PARAMETER_VALUE, false, "EOC failed finalization!\n"); 1076 1129 return 12; 1077 1130 } 1078 psFree(rot);1079 1080 1131 // Free objects 1081 1132 psFree(fromTime); -
trunk/psLib/test/astro/tst_psSphereOps.c
r6039 r6189 5 5 * @author d-Rob, MHPCC 6 6 * 7 * @version $Revision: 1.1 5$ $Name: not supported by cvs2svn $8 * @date $Date: 2006-01- 18 23:49:06$7 * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2006-01-25 03:02:47 $ 9 9 * 10 10 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 18 18 static psS32 testSphereRotApply1(void); 19 19 static psS32 testSphereRotApplyCelestial(void); 20 //static psS32 testSphereRotPrecess(void);21 20 static psS32 testSphereOffset(void); 22 21 … … 26 25 {testSphereRotApply1, 821, "psSphereRotApply()", 0, false}, 27 26 {testSphereRotApplyCelestial, 822, "psSphereRotApplyCel()", 0, false}, 28 // {testSphereRotPrecess, 823, "psSphereRotPrecess()", 0, false},29 27 {testSphereOffset, 825, "testSphereOffset()", 0, false}, 30 28 {NULL}
Note:
See TracChangeset
for help on using the changeset viewer.
