Changeset 5626
- Timestamp:
- Nov 29, 2005, 4:17:17 PM (21 years ago)
- Location:
- trunk/psLib
- Files:
-
- 5 edited
-
src/astro/psCoord.c (modified) (2 diffs)
-
src/astro/psEarthOrientation.c (modified) (6 diffs)
-
test/astro/tst_psEarthOrientation.c (modified) (3 diffs)
-
test/astro/tst_psSphereOps.c (modified) (2 diffs)
-
test/astro/verified/tst_psEarthOrientation.stdout (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psCoord.c
r5624 r5626 10 10 * @author GLG, MHPCC 11 11 * 12 * @version $Revision: 1.9 4$ $Name: not supported by cvs2svn $13 * @date $Date: 2005-11-30 02: 00:00$12 * @version $Revision: 1.95 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2005-11-30 02:17:17 $ 14 14 * 15 15 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 1137 1137 // sphere->rErr = arctan(cube->xErr/cube->yErr); 1138 1138 // sphere->dErr = arctan(sqrt(cube->xErr*cube->xErr + cube->yErr*cube->yErr)/cube->zErr); 1139 sphere->r = 1 / (atan(cube->x/cube->y)); 1140 sphere->d = 1 / (atan(sqrt(cube->x*cube->x + cube->y*cube->y)/cube->z)); 1141 sphere->rErr = 1 / (atan(cube->xErr/cube->yErr)); 1142 sphere->dErr = 1 / (atan(sqrt(cube->xErr*cube->xErr + cube->yErr*cube->yErr)/cube->zErr)); 1139 // sphere->r = 1 / (atan(cube->x/cube->y)); 1140 // sphere->d = 1 / (atan(sqrt(cube->x*cube->x + cube->y*cube->y)/cube->z)); 1141 // sphere->rErr = 1 / (atan(cube->xErr/cube->yErr)); 1142 // sphere->dErr = 1 / (atan(sqrt(cube->xErr*cube->xErr + cube->yErr*cube->yErr)/cube->zErr)); 1143 psCube *cube2 = psCubeAlloc(); 1144 *cube2 = *cube; 1145 double mag = sqrt(cube->x*cube->x + cube->y*cube->y + cube->z*cube->z); 1146 if (mag > 1.0) { 1147 cube2->x = cube2->x/mag; 1148 cube2->y = cube2->y/mag; 1149 cube2->z = cube2->z/mag; 1150 } 1151 1152 sphere->r = atan2(cube2->y, cube2->x); 1153 sphere->d = asin(cube2->z); 1154 // sphere->d = atan2((cube->x*cube->x + cube->y*cube->y), cube->z); 1155 sphere->rErr = atan2(cube2->yErr, cube2->xErr); 1156 sphere->dErr = asin(cube2->zErr); 1157 psFree(cube2); 1143 1158 1144 1159 return(sphere); -
trunk/psLib/src/astro/psEarthOrientation.c
r5533 r5626 8 8 * @author Robert Daniel DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1.1 8$ $Name: not supported by cvs2svn $11 * @date $Date: 2005-11- 17 03:59:05$10 * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-11-30 02:17:17 $ 12 12 * 13 13 * Copyright 2005 Maui High Performance Computing Center, University of Hawaii … … 307 307 psCube* sunVector = psSphereToCube(sun); 308 308 psCube* actualVector = psSphereToCube(actual); 309 309 printf("\n Actual sphere = %.13g, %.13g", actual->r, actual->d); 310 printf("\n Actual cube = %.13g, %.13g, %.13g \n", actualVector->x, actualVector->y, actualVector->z); 311 printf("\n SUN sphere = %.13g, %.13g", sun->r, sun->d); 312 printf("\n SUN cube = %.13g, %.13g, %.13g \n", sunVector->x, sunVector->y, sunVector->z); 313 psSphere *new = psCubeToSphere(actualVector); 314 printf(" New sphere = %.13g, %.13g", new->r, new->d); 315 psFree(new); 310 316 // use dot product to calculate the angle of separation 311 317 // N.B., assuming the psSphereToCube function returns a unit vector. … … 314 320 sunVector->y*actualVector->y + 315 321 sunVector->z*actualVector->z); 316 322 printf("\n Theta = %.13g ", theta); 317 323 double r0 = PS_AU * tan(theta); 324 printf(" r0 = %.13g", r0); 318 325 double deflection = 4.0*PS_G*PS_M/(PS_C0*PS_C0*r0); 319 326 printf(" deflection = %.13g \n", deflection); 320 327 // make sure the deflection is not greater than 1.75 arcsec 321 328 double limit = SEC_TO_RAD(1.75); … … 345 352 deflection = SEC_TO_RAD(deflection); 346 353 theta = atan(r0/PS_AU) * tan(deflection); 347 phi = sqrt( deflection*deflection - theta*theta ); 348 // phi = deflection * cos(asin(theta/deflection)); 354 printf(" deflection = %.13g Theta=%.13g ", deflection, theta); 355 // phi = sqrt( deflection*deflection - theta*theta ); 356 phi = deflection * cos(asin(theta/deflection)); 357 printf(" Phi = %.13g \n", phi); 349 358 apparent->r = theta; 350 359 apparent->d = phi; … … 950 959 Y = psPolynomial1DEval(yPoly,t); 951 960 for (int i = 0; i < 10; i++) { 952 // tj = SEC_TO_RAD(pow(t, i));953 961 tj = pow(t, i); 954 962 arg = w_l[i]*F[0] + w_l_p[i]*F[1] + w_F[i]*F[2] + w_D[i]*F[3] + w_Omega[i]*F[4]; … … 960 968 pole->x = X; 961 969 pole->y = Y; 962 pole->s = SEC_TO_RAD(4.7e-5) * t; //XXX: This conv. should include t?970 pole->s = SEC_TO_RAD(4.7e-5) * t; 963 971 964 972 return pole; -
trunk/psLib/test/astro/tst_psEarthOrientation.c
r5534 r5626 5 5 * @author d-Rob, MHPCC 6 6 * 7 * @version $Revision: 1.1 5$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-11- 17 04:04:30$7 * @version $Revision: 1.16 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-11-30 02:17:17 $ 9 9 * 10 10 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 102 102 psSphere *actual = psSphereAlloc(); 103 103 psSphere *apparent = NULL; 104 psSphere *sun = psSphereAlloc();104 // psSphere *sun = psSphereAlloc(); 105 105 psSphere *empty = NULL; 106 106 107 sun->r = 0.2; 108 sun->d = 0.2; 109 actual->r = 0.61001; 110 actual->d = 0.01999; 107 // sun->r = 0.2; 108 // sun->d = 0.2; 109 // actual->r = 0.61001; 110 // actual->d = 0.01999; 111 actual->r = DEG_TO_RAD(122.9153182445501); 112 actual->d = DEG_TO_RAD(48.562968978679194); 113 psCube *sunCube = psCubeAlloc(); 114 sunCube->x = 1.467797790127511e11; 115 sunCube->y = 2.5880956908748722e10; 116 sunCube->z = 1.1220046291457653e10; 117 // double sum = sqrt(sunCube->x*sunCube->x + sunCube->y*sunCube->y + sunCube->z*sunCube->z); 118 // sunCube->x = sunCube->x/sum; 119 // sunCube->y = sunCube->y/sum; 120 // sunCube->z = sunCube->z/sum; 121 // printf("\n <<<<SUNvec = x,y,z = %.13g, %.13g %.13g", sunCube->x, sunCube->y, sunCube->z); 122 psSphere *sun = psCubeToSphere(sunCube); 123 printf("\n <<<<SUN = r,d = %.13g, %.13g\n", sun->r, sun->d); 111 124 112 125 empty = psGravityDeflection(apparent, empty, sun); … … 123 136 } 124 137 125 apparent = psGravityDeflection( apparent, actual, sun);138 apparent = psGravityDeflection(NULL, actual, sun); 126 139 psSphere *result = psSphereSetOffset(actual, apparent, PS_SPHERICAL, PS_RADIAN); 127 140 printf("\nActual r,d = %.13g,%.13g Apparent r,d = %.16g, %.16g \n", 128 141 actual->r, actual->d, result->r, result->d); 142 psCube *outCube = psSphereToCube(result); 143 printf(" -- outCube = x,y,z = %.13g, %.13g, %.13g -- \n", outCube->x, outCube->y, outCube->z); 144 psFree(outCube); 145 psCube *outCube2 = psSphereToCube(apparent); 146 printf(" -- outCube = x,y,z = %.13g, %.13g, %.13g -- \n", outCube2->x, outCube2->y, outCube2->z); 147 psFree(outCube2); 148 psFree(sunCube); 149 129 150 psFree(result); 130 151 psFree(actual); -
trunk/psLib/test/astro/tst_psSphereOps.c
r5514 r5626 5 5 * @author d-Rob, MHPCC 6 6 * 7 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-11- 15 00:04:30$7 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-11-30 02:17:17 $ 9 9 * 10 10 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 494 494 } 495 495 */ 496 output->r *= -1.0;497 output->d *= -1.0;496 // output->r *= -1.0; 497 // output->d *= -1.0; 498 498 empty = psSphereGetOffset(origin, output, PS_LINEAR, PS_RADIAN); 499 if ( fabs(offset->r - empty->r) > 0.0001 || abs(offset->d - empty->r) > 0.0001 ) {499 if ( fabs(offset->r - empty->r) > 0.0001 || fabs(offset->d - empty->d) > 0.0001 ) { 500 500 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 501 501 "psSphereGetOffset failed to return correct linear offset values.\n"); -
trunk/psLib/test/astro/verified/tst_psEarthOrientation.stdout
r5534 r5626 1 1 2 apparent = r,d = 1.0900423, 0.755023532 apparent = r,d = 0.65340071, 0.2463343 3 3 4 Actual r,d = 0.61001,0.01999 Apparent r,d = 0.6100100000001365, 0.01999000000006505 4 <<<<SUN = r,d = 0.1745310859793, 0.0751383461293 5 6 Actual sphere = 2.145277004504, 0.8475837032218 7 Actual cube = -0.3596195125758, 0.5555613903456, 0.7496834983725 8 9 SUN sphere = 0.1745310859793, 0.0751383461293 10 SUN cube = 0.9820293796219, 0.1731564131522, 0.0750676637684 11 New sphere = 2.145277004504, 0.8475837032218 12 Theta = -0.2006809204081 r0 = -30431058247.35 deflection = -1.941413573621e-07 13 deflection = -9.412238611831e-13 Theta=1.888856707723e-13 Phi = -9.220762225745e-13 14 15 Actual r,d = 2.145277004504,0.8475837032218 Apparent r,d = 2.145277004504245, 0.8475837032208979 16 -- outCube = x,y,z = -0.3596195125763, 0.5555613903461, 0.7496834983719 -- 17 -- outCube = x,y,z = 1, 1.888856707723e-13, -9.220762225745e-13 -- 5 18 Precession Model output = x,y,s = 1.1557751e+08, 8865375.4, -5.1231901e+14 6 19
Note:
See TracChangeset
for help on using the changeset viewer.
