IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5626 for trunk/psLib/src/astro


Ignore:
Timestamp:
Nov 29, 2005, 4:17:17 PM (21 years ago)
Author:
drobbin
Message:

Edited psCubeToSphere, tests. EOC - gravity still fails. Others still unchecked.

Location:
trunk/psLib/src/astro
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astro/psCoord.c

    r5624 r5626  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.94 $ $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 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    11371137    //    sphere->rErr = arctan(cube->xErr/cube->yErr);
    11381138    //    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);
    11431158
    11441159    return(sphere);
  • trunk/psLib/src/astro/psEarthOrientation.c

    r5533 r5626  
    88 *  @author Robert Daniel DeSonia, MHPCC
    99 *
    10  *  @version $Revision: 1.18 $ $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 $
    1212 *
    1313 *  Copyright 2005 Maui High Performance Computing Center, University of Hawaii
     
    307307    psCube* sunVector = psSphereToCube(sun);
    308308    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);
    310316    // use dot product to calculate the angle of separation
    311317    // N.B., assuming the psSphereToCube function returns a unit vector.
     
    314320                    sunVector->y*actualVector->y +
    315321                    sunVector->z*actualVector->z);
    316 
     322    printf("\n Theta = %.13g ", theta);
    317323    double r0 = PS_AU * tan(theta);
     324    printf("   r0 = %.13g", r0);
    318325    double deflection = 4.0*PS_G*PS_M/(PS_C0*PS_C0*r0);
    319 
     326    printf("   deflection = %.13g \n", deflection);
    320327    // make sure the deflection is not greater than 1.75 arcsec
    321328    double limit = SEC_TO_RAD(1.75);
     
    345352    deflection = SEC_TO_RAD(deflection);
    346353    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);
    349358    apparent->r = theta;
    350359    apparent->d = phi;
     
    950959    Y = psPolynomial1DEval(yPoly,t);
    951960    for (int i = 0; i < 10; i++) {
    952         //        tj = SEC_TO_RAD(pow(t, i));
    953961        tj = pow(t, i);
    954962        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];
     
    960968    pole->x = X;
    961969    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;
    963971
    964972    return pole;
Note: See TracChangeset for help on using the changeset viewer.