IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 20, 2005, 4:14:02 PM (21 years ago)
Author:
drobbin
Message:

Implemented, debugged, fixed psSphereRot functions/tests. 1 problem remains + testing.

File:
1 edited

Legend:

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

    r5368 r5437  
    66*  @author d-Rob, MHPCC
    77*
    8 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2005-10-18 22:14:47 $
     8*  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2005-10-21 02:14:02 $
    1010*
    1111*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    1919static psS32 testSphereRotApplyCelestial(void);
    2020static psS32 testSphereRotPrecess(void);
     21static psS32 testSphereToFromCube(void);
     22static psS32 testSphereOffset(void);
    2123
    2224testDescription tests[] = {
     
    2628                              {testSphereRotApplyCelestial, 822, "psSphereRotApplyCel()", 0, false},
    2729                              {testSphereRotPrecess, 823, "psSphereRotPrecess()", 0, false},
     30                              {testSphereToFromCube, 824, "testSphereToFromCube()", 0, false},
     31                              {testSphereOffset, 825, "testSphereOffset()", 0, false},
    2832                              {NULL}
    2933                          };
     
    147151    psSphere *temp = NULL;
    148152    psSphere *rc = NULL;
     153    psSphere *temp2 = psSphereAlloc();
    149154    //        psSphereRot *myST = psSphereRotAlloc(0.0, 0.0, 0.0);
    150155    psSphereRot *myST = psSphereRotAlloc(ALPHA_P, DELTA_P, PHI_P);
     156    psSphereRot *yourST =  psSphereRotInvert(ALPHA_P, DELTA_P, PHI_P);
    151157
    152158    for (float r=0.0;r<180.0;r+=DEG_INC) {
     
    157163            in->dErr = 0.0;
    158164
    159             if(psSphereRotApply(out, myST, in) != out) {
    160                 psError(PS_ERR_UNKNOWN,true,"Did not return output pointer.");
    161                 return 1;
    162             }
    163             psSphereRotInvert(myST);
    164             psSphereRotApply(out, myST, out);
     165            temp2 = psSphereRotApply(temp2, myST, in);
     166            out = psSphereRotApply(out, yourST, temp2);
    165167
    166168            if (ERROR_TOL < fabs(out->r - in->r)) {
     
    199201
    200202    psFree(myST);
     203    psFree(yourST);
     204    psFree(temp2);
    201205    psFree(out);
    202206    psFree(in);
     
    209213psS32 testSphereRotApplyCelestial( void)
    210214{
    211 
    212215    int numTestPoints = 3;
    213216    // ICRS coordinates
     
    220223    double l[] =     { 96.337272, 122.93192, 195.639488};
    221224    double b[] =     {-60.188553,  27.12825,  78.353806};
    222 
    223225    double t[] =     {  MJD_2000,  MJD_2000,   MJD_2100};
    224 
    225226    double TOLERANCE = 0.001;
    226 
    227 
    228227
    229228    for (int x = 0; x < numTestPoints; x++) {
     
    286285            //               return 4;
    287286        }
    288 
    289287        psFree(galactic);
    290288        psFree(icrsFromGalactic);
     
    294292        psFree(toGalactic);
    295293        psFree(fromGalactic);
    296 
    297     }
    298 
     294    }
    299295    return 0;
    300296}
     
    432428    return 0;
    433429}
     430
     431psS32 testSphereToFromCube(void)
     432{
     433    return 0;
     434}
     435
     436psS32 testSphereOffset(void)
     437{
     438    return 0;
     439}
     440
Note: See TracChangeset for help on using the changeset viewer.