IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 7, 2005, 4:49:04 PM (21 years ago)
Author:
drobbin
Message:

updated tests, got TEOtoCEO working and verified. Currently working on CEOtoGCRS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/astro/tst_psEarthOrientation.c

    r5716 r5749  
    55*  @author d-Rob, MHPCC
    66*
    7 *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    8 *  @date $Date: 2005-12-07 02:13:40 $
     7*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     8*  @date $Date: 2005-12-08 02:49:04 $
    99*
    1010*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6666{
    6767    if (obj == NULL) {
    68         obj = psSphereAlloc();
    69         obj->r = objR;
    70         obj->d = objD;
     68        //        obj = psSphereAlloc();
     69        //        obj->r = objR;
     70        //        obj->d = objD;
     71        psCube *tempCube = psCubeAlloc();
     72        tempCube->x = -0.3598480726985338;
     73        tempCube->y = 0.5555012823608123;
     74        tempCube->z = 0.7496183628158023;
     75        obj = psCubeToSphere(tempCube);
     76        psFree(tempCube);
    7177    }
    7278}
     
    544550        return 2;
    545551    }
    546     printf("\nOutput sphere rotation = %.13g, %.13g, %.13g, %.13g\n\n",
    547            teoceo->q0, teoceo->q1, teoceo->q2, teoceo->q3);
    548552
    549553    objSetup();
    550554    psSphereRot *earthRot = psSphereRotConjugate(NULL, teoceo);
    551555    psSphere *result = psSphereRotApply(NULL, earthRot, obj);
    552     //    psCube *cube = psSphereToCube(obj);
    553556    psCube *cube = psSphereToCube(result);
    554 
    555557
    556558    double x, y, z;
     
    558560    y = -0.6616523084626379;
    559561    z = 0.7496183628158023;
    560     if ( fabs(x-cube->x) > DBL_EPSILON  || fabs(y-cube->y) > DBL_EPSILON ||
    561             fabs(z-cube->z) > DBL_EPSILON) {
     562    if ( fabs(x-cube->x) > FLT_EPSILON  || fabs(y-cube->y) > FLT_EPSILON ||
     563            fabs(z-cube->z) > FLT_EPSILON) {
    562564        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
    563565                "psSphereRot_TEOtoCEO returned incorrect values.\n");
     
    570572    }
    571573    //    psFree(now);
     574    psFree(rot);
     575    psFree(empty);
    572576    psFree(result);
    573577    psFree(obj);
     
    615619    }
    616620
     621    //    psCube *tempCube = psCubeAlloc();
     622    //    tempCube->x = -0.35963388069046304;
     623    //    tempCube->y = 0.5555192509816625;
     624    //    tempCube->z = 0.749078321908413;
     625    //    obj = psCubeToSphere(tempCube);
     626    //    psFree(tempCube);
     627    obj = psSphereAlloc();
     628    obj->r = objR;
     629    obj->d = objD;
     630    psSphereRot *precessionNutation = psSphereRotConjugate(NULL, rot);
     631    psSphere *result = psSphereRotApply(NULL, precessionNutation, obj);
     632    psCube *cube = psSphereToCube(result);
     633    double x, y, z;
     634    x = -0.3598480726985338;
     635    y = 0.5555012823608123;
     636    z = 0.7496183628158023;
     637    printf("\nOutput cube = x,y,z = %.13g, %.13g, %.13g\n", cube->x, cube->y, cube->z);
     638    printf("Expected cube = x,y,z = %.13g, %.13g, %.13g\n", x, y, z);
     639    printf("A difference of:   %.13g, %.13g, %.13g\n\n",
     640           (x-cube->x), (y-cube->y), (z-cube->z));
     641    psFree(obj);
     642
     643
    617644    if (fabs(rot->q0-q0) > DBL_EPSILON || fabs(rot->q1-q1) > DBL_EPSILON ||
    618645            fabs(rot->q2-q2) > DBL_EPSILON || fabs(rot->q3-q3) > DBL_EPSILON) {
     
    635662    printf("\n  Sphere -test- has values r,d = %.8g, %.8g \n", test->r, test->d);
    636663
     664    psFree(precessionNutation);
     665    psFree(result);
     666    psFree(cube);
     667
    637668    psFree(test);
    638669    psFree(rot);
Note: See TracChangeset for help on using the changeset viewer.