Changeset 2998 for trunk/psLib/test/astronomy/tst_psCoord.c
- Timestamp:
- Jan 14, 2005, 1:25:39 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/astronomy/tst_psCoord.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/astronomy/tst_psCoord.c
r2984 r2998 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $9 * @date $Date: 2005-01-1 3 22:53:37$8 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2005-01-14 23:25:39 $ 10 10 * 11 11 * XXX: Must test psSpherePrecess. 12 * XXX: psSphereSetOffset(&position1, &offset, PS_LINEAR, 0) doesn't work? 12 * XXX: THe psProject() and psDeproject() functions do not work fully. They 13 * are not tested here. The SphereGet/SetOffset() code that rely on them 14 * is not tested. 15 * 13 16 * XXX: Test with a bad offfset unit type in the SphereGet/SetOffset() functions. 14 17 * … … 18 21 #include "psTest.h" 19 22 #include "pslib.h" 20 /*21 23 static psS32 test1( void ); 22 24 static psS32 test1b( void ); … … 30 32 static psS32 test7( void ); 31 33 static psS32 test8( void ); 32 static psS32 test20( void );33 static psS32 test21( void );34 //static psS32 test20( void ); 35 //static psS32 test21( void ); 34 36 static psS32 test40( void ); 35 37 static psS32 test41( void ); 36 static psS32 test43( void ); 37 */ 38 static psS32 test42( void ); 38 //static psS32 test42( void ); 39 //static psS32 test43( void ); 39 40 testDescription tests[] = { 40 /* 41 {test1, 0000, "psSphereTransformAlloc()", 0, false}, 42 {test1b, 0000, "psPlaneTransformAlloc()", 0, false}, 43 {test1c, 0000, "psPlaneDistortAlloc()", 0, false}, 44 {test2, 0000, "psPlaneTransformApply()", 0, false}, 45 {test3, 0000, "psPlaneDistortApply()", 0, false}, 46 {test4, 0000, "psPSphereTransformApply()", 0, false}, 47 {test4b, 0000, "psPSphereTransformApply()", 0, false}, 48 {test5, 0000, "psSphereTransformICRSToEcliptic()", 0, false}, 49 {test6, 0000, "psSphereTransformEclipticToICRS()", 0, false}, 50 {test7, 0000, "psSphereTransformICRSToGalatic()", 0, false}, 51 {test8, 0000, "psSphereTransformGalaticToICRS()", 0, false}, 52 {test20, 0000, "psProject()", 0, false}, 53 {test21, 0000, "psDeProject()", 0, false}, 54 {test40, 0000, "psSphereGetOffset()", 0, false}, 55 {test41, 0000, "psSphereSetOffset()", 0, false}, 56 {test43, 0000, "psProject(), psDeproject", 0, false}, 57 */ 58 {test42, 0000, "psProject(), psDeproject", 0, false}, 41 {test1, 0000, "psSphereTransformAlloc()", 0, false}, 42 {test1b, 0000, "psPlaneTransformAlloc()", 0, false}, 43 {test1c, 0000, "psPlaneDistortAlloc()", 0, false}, 44 {test2, 0000, "psPlaneTransformApply()", 0, false}, 45 {test3, 0000, "psPlaneDistortApply()", 0, false}, 46 {test4, 0000, "psPSphereTransformApply()", 0, false}, 47 {test4b, 0000, "psPSphereTransformApply()", 0, false}, 48 {test5, 0000, "psSphereTransformICRSToEcliptic()", 0, false}, 49 {test6, 0000, "psSphereTransformEclipticToICRS()", 0, false}, 50 {test7, 0000, "psSphereTransformICRSToGalatic()", 0, false}, 51 {test8, 0000, "psSphereTransformGalaticToICRS()", 0, false}, 52 // {test20, 0000, "psProject()", 0, false}, 53 // {test21, 0000, "psDeProject()", 0, false}, 54 {test40, 0000, "psSphereGetOffset()", 0, false}, 55 {test41, 0000, "psSphereSetOffset()", 0, false}, 56 // {test42, 0000, "psProject(), psDeproject", 0, false}, 57 // {test43, 0000, "psProject(), psDeproject", 0, false}, 59 58 {NULL} 60 59 }; … … 1033 1032 1034 1033 //HEY /* XXX: This code does not work correctly. 1035 printf("--------------- (%f, %f) to (%f, %f) is (%f, %f) ---------------\n", 1036 position1.r, position1.d, position2.r, position2.d, 1037 offset->r, offset->d); 1038 /* 1039 offset = psSphereGetOffset(&position1, &position2, PS_LINEAR, 0); 1040 PS_COMPARE_TINY_THEN_PRINT_ERROR(offset->r, (position2.r - position1.r), 1); 1041 PS_COMPARE_TINY_THEN_PRINT_ERROR(offset->d, (position2.d - position1.d), 1); 1042 */ 1043 psFree(offset); 1044 // */ 1034 // printf("--------------- (%f, %f) to (%f, %f) is (%f, %f) ---------------\n", 1035 // position1.r, position1.d, position2.r, position2.d, 1036 // offset->r, offset->d); 1037 // offset = psSphereGetOffset(&position1, &position2, PS_LINEAR, 0); 1038 // PS_COMPARE_TINY_THEN_PRINT_ERROR(offset->r, (position2.r - position1.r), 1); 1039 // PS_COMPARE_TINY_THEN_PRINT_ERROR(offset->d, (position2.d - position1.d), 1); 1040 // psFree(offset); 1045 1041 } 1046 1042 } … … 1101 1097 for (float r=0.0;r<180.0;r+=DEG_INC) { 1102 1098 for (float d=0.0;d<90.0;d+=DEG_INC) { 1103 offset.r = DEG_TO_RAD( offset.r);1104 offset.d = DEG_TO_RAD( offset.d);1099 offset.r = DEG_TO_RAD(r); 1100 offset.d = DEG_TO_RAD(d); 1105 1101 offset.rErr = 0.0; 1106 1102 offset.dErr = 0.0; … … 1109 1105 PS_SPHERICAL, PS_RADIAN); 1110 1106 PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->r, (position1.r + offset.r), 1); 1111 PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->d, (position1.d + offset.d), 1);1107 PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->d, (position1.d + offset.d), 2); 1112 1108 psFree(position2); 1113 1109 1114 tmpOffset.r = DEG_TO_RAD(offset.r);1115 tmpOffset.d = DEG_TO_RAD(offset.d);1110 tmpOffset.r = RAD_TO_DEG(offset.r); 1111 tmpOffset.d = RAD_TO_DEG(offset.d); 1116 1112 tmpOffset.rErr = 0.0; 1117 1113 tmpOffset.dErr = 0.0; 1118 1114 position2 = psSphereSetOffset(&position1, &tmpOffset, 1119 1115 PS_SPHERICAL, PS_DEGREE); 1120 PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->r, (position1.r + offset.r), 1);1121 PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->d, (position1.d + offset.d), 1);1116 PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->r, (position1.r + offset.r), 3); 1117 PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->d, (position1.d + offset.d), 4); 1122 1118 psFree(position2); 1123 1119 … … 1128 1124 position2 = psSphereSetOffset(&position1, &tmpOffset, 1129 1125 PS_SPHERICAL, PS_ARCMIN); 1130 PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->r, (position1.r + offset.r), 1);1131 PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->d, (position1.d + offset.d), 1);1126 PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->r, (position1.r + offset.r), 5); 1127 PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->d, (position1.d + offset.d), 6); 1132 1128 psFree(position2); 1133 1129 … … 1138 1134 position2 = psSphereSetOffset(&position1, &tmpOffset, 1139 1135 PS_SPHERICAL, PS_ARCSEC); 1140 PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->r, (position1.r + offset.r), 1);1141 PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->d, (position1.d + offset.d), 1);1136 PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->r, (position1.r + offset.r), 7); 1137 PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->d, (position1.d + offset.d), 8); 1142 1138 psFree(position2); 1143 1139 … … 1245 1241 return(false); 1246 1242 } 1247 return( false);1243 return(true); 1248 1244 } 1249 1245 … … 1255 1251 ensure that the resulting spherical coordinates are identical to the start 1256 1252 coordinates. 1253 1254 Currently, this test works only for angles near the first quadrant. 1257 1255 *****************************************************************************/ 1258 1256 psS32 test42( void ) … … 1264 1262 psPlane *planeCoords; 1265 1263 1266 #define PROG_CENTER_R_DEG 20.01264 #define PROG_CENTER_R_DEG 15.0 1267 1265 #define PROG_CENTER_D_DEG 20.0 1268 1266 … … 1302 1300 printf(" endCoords (R, D) is (%f, %f)\n", endCoords->r, endCoords->d); 1303 1301 } 1304 1305 1302 psFree(planeCoords); 1306 1303 psFree(endCoords);
Note:
See TracChangeset
for help on using the changeset viewer.
