Changeset 5493 for trunk/psLib/test/astro/tst_psEarthOrientation.c
- Timestamp:
- Nov 9, 2005, 2:13:51 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/astro/tst_psEarthOrientation.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/astro/tst_psEarthOrientation.c
r5483 r5493 5 5 * @author d-Rob, MHPCC 6 6 * 7 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-11- 07 20:52:43$7 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-11-10 00:13:51 $ 9 9 * 10 10 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 69 69 // direction->r = 0.2035; 70 70 // direction->d = 0.2035; 71 direction->r = DEG_TO_RAD(48.0); 71 // direction->r = DEG_TO_RAD(48.0); 72 direction->r = DEG_TO_RAD(-157.0); 72 73 direction->d = DEG_TO_RAD(20.7072); 73 74 … … 108 109 sun->r = 0.2; 109 110 sun->d = 0.2; 110 actual->r = 0. 2035;111 actual->d = 0. 2035;111 actual->r = 0.61001; 112 actual->d = 0.01999; 112 113 113 114 empty = psGravityDeflection(apparent, empty, sun); … … 126 127 apparent = psGravityDeflection(apparent, actual, sun); 127 128 psSphere *result = psSphereSetOffset(actual, apparent, PS_SPHERICAL, PS_RADIAN); 128 printf("\nActual r,d = %.13g,%.13g Apparent r,d = %.1 3g, %.13g \n",129 printf("\nActual r,d = %.13g,%.13g Apparent r,d = %.16g, %.16g \n", 129 130 actual->r, actual->d, result->r, result->d); 130 131 psFree(result); … … 144 145 psS32 testEOCPolar(void) 145 146 { 146 147 // psTime *in = psTimeGetNow(PS_TIME_TAI); 148 psTime *in = psTimeAlloc(PS_TIME_TAI); 149 in->sec = 1131579114; 150 in->nsec = 498489000; 151 in->leapsecond = false; 152 psTime *empty = NULL; 153 psEarthPole *eop = NULL; 154 155 eop = psEOC_PolarTideCorr(empty); 156 if (eop != NULL) { 157 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 158 "psEOC_PolarTideCorr failed to return NULL for NULL input time.\n"); 159 return 1; 160 } 161 162 eop = psEOC_PolarTideCorr(in); 163 if (eop == NULL) { 164 psError(PS_ERR_BAD_PARAMETER_NULL, false, 165 "psEOC_PolarTideCorr returned NULL for valid input time.\n"); 166 return 2; 167 } 168 169 printf(" -- Eop = x=%.8g, y=%.8g, s=%.8g\n", eop->x, eop->y, eop->s); 170 psFree(in); 171 psFree(eop); 147 172 return 0; 148 173 } … … 170 195 psS32 testSphereRot_CEOtoGCRS(void) 171 196 { 197 psEarthPole *in = psEarthPoleAlloc(); 198 psEarthPole *empty = NULL; 199 psSphereRot *rot = NULL; 200 201 in->x = M_PI / 4.0; 202 in->y = M_PI / 6.0; 203 in->s = M_PI / 8.0; 204 205 rot = psSphereRot_CEOtoGCRS(empty); 206 if (rot != NULL) { 207 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 208 "psSphereRot_CEOtoGCRS failed to return NULL for NULL input psEarthPole.\n"); 209 return 1; 210 } 211 212 rot = psSphereRot_CEOtoGCRS(in); 213 if (rot == NULL) { 214 psError(PS_ERR_BAD_PARAMETER_NULL, false, 215 "psSphereRot_CEOtoGCRS return NULL for valid psEarthPole input.\n"); 216 return 2; 217 } 218 219 psSphere *test = psSphereAlloc(); 220 test->r = 0.0; 221 test->d = 0.0; 222 test = psSphereRotApply(test, rot, test); 223 printf("\n Sphere -test- has values r,d = %.8g, %.8g \n", test->r, test->d); 224 225 psFree(test); 226 psFree(rot); 227 psFree(in); 172 228 return 0; 173 229 } … … 175 231 psS32 testSphereRot_ITRStoTEO(void) 176 232 { 177 return 0; 178 } 179 233 psEarthPole *in = psEarthPoleAlloc(); 234 psEarthPole *empty = NULL; 235 psSphereRot *rot = NULL; 236 237 in->x = M_PI / 4.0; 238 in->y = M_PI / 6.0; 239 in->s = M_PI / 8.0; 240 241 rot = psSphereRot_ITRStoTEO(empty); 242 if (rot != NULL) { 243 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 244 "psSphereRot_ITRStoTEO failed to return NULL for NULL input psEarthPole.\n"); 245 return 1; 246 } 247 248 rot = psSphereRot_ITRStoTEO(in); 249 if (rot == NULL) { 250 psError(PS_ERR_BAD_PARAMETER_NULL, false, 251 "psSphereRot_ITRStoTEO return NULL for valid psEarthPole input.\n"); 252 return 2; 253 } 254 255 psSphere *test = psSphereAlloc(); 256 test->r = 0.0; 257 test->d = 0.0; 258 test = psSphereRotApply(test, rot, test); 259 printf("\n Sphere -test- has values r,d = %.8g, %.8g \n", test->r, test->d); 260 261 psFree(test); 262 psFree(rot); 263 psFree(in); 264 return 0; 265 } 266
Note:
See TracChangeset
for help on using the changeset viewer.
