IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 24, 2006, 5:02:47 PM (20 years ago)
Author:
drobbin
Message:

Fixed psMetadataConfigFormat to use %22.15g for F32,F64. Fixed Precess tests. Updated Argument comments.

File:
1 edited

Legend:

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

    r6184 r6189  
    55*  @author d-Rob, MHPCC
    66*
    7 *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
    8 *  @date $Date: 2006-01-23 20:04:31 $
     7*  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
     8*  @date $Date: 2006-01-25 03:02:47 $
    99*
    1010*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    305305    psEarthPole *pmodel = NULL;
    306306    //Return NULL for NULL time input
     307    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
    307308    pmodel = psEOC_PrecessionModel(empty);
    308309    if (pmodel != NULL) {
     
    312313    }
    313314    //Return NULL for UT1 time input
     315    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
    314316    psTime *UT1time = psTimeAlloc(PS_TIME_UT1);
    315317    pmodel = psEOC_PrecessionModel(UT1time);
     
    361363    time2->nsec = 0;
    362364    time2->leapsecond = false;
    363 
    364     //XXX:  MAY Be an Error here... Time for Precession Correction has to be TAI or seg faults
    365     time2 = psTimeConvert(time2, PS_TIME_TAI);
     365    //    time2 = psTimeConvert(time2, PS_TIME_TAI);
     366
    366367    //Tests for Precession Correction function//
    367368    //Return NULL for NULL time input
    368369    psEarthPole *pcorr = NULL;
     370    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
    369371    pcorr = psEOC_PrecessionCorr(empty, PS_IERS_A);
    370372    if (pcorr != NULL) {
     
    375377
    376378    //Return NULL for Invalid IERS table
     379    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
    377380    pcorr = psEOC_PrecessionCorr(time2, 3);
    378381    if (pcorr != NULL) {
     
    522525
    523526    //Return NULL for NULL input time
     527    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
    524528    polarMotion = psEOC_GetPolarMotion(empty, PS_IERS_B);
    525529    if (polarMotion != NULL) {
     
    529533    }
    530534    //Return NULL for incorrect Bulletin.
     535    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
    531536    polarMotion = psEOC_GetPolarMotion(empty, 3);
    532537    if (polarMotion != NULL) {
     
    625630    psEarthPole *eop = NULL;
    626631
     632    //Return NULL for NULL input time
     633    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
    627634    eop = psEOC_PolarTideCorr(empty);
    628635    if (eop != NULL) {
     
    658665
    659666    //Return NULL for NULL input time.
     667    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
    660668    nute = psEOC_NutationCorr(empty);
    661669    if (nute != NULL) {
     
    705713
    706714    //return NULL for NULL input time
     715    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
    707716    rot = psSphereRot_TEOtoCEO(empty, NULL);
    708717    if (rot != NULL) {
     
    783792    q3 = -0.9999999897238481;
    784793
     794    //Return NULL for NULL input earthpole
     795    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
    785796    rot = psSphereRot_CEOtoGCRS(empty);
    786797    if (rot != NULL) {
     
    793804    if (rot == NULL) {
    794805        psError(PS_ERR_BAD_PARAMETER_NULL, false,
    795                 "psSphereRot_CEOtoGCRS return NULL for valid psEarthPole input.\n");
     806                "psSphereRot_CEOtoGCRS returned NULL for valid psEarthPole input.\n");
    796807        return 2;
    797808    }
     
    857868    in->s = SEC_TO_RAD(in->s);
    858869
     870    //Return NULL for NULL input earthpole
     871    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
    859872    rot = psSphereRot_ITRStoTEO(empty);
    860873    if (rot != NULL) {
     
    863876        return 1;
    864877    }
     878
    865879    rot = psSphereRot_ITRStoTEO(in);
    866880    if (rot == NULL) {
     
    10501064    psFree(rot);
    10511065
    1052     // Invoke precess with invalid parameter
    1053     /*
    1054         psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
    1055         outputCoord = psSpherePrecess(inputCoord, fromTime, NULL);
    1056         if(outputCoord != NULL) {
    1057             psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid input");
    1058             return 10;
    1059         }
    1060      
    1061         // Invoke precess with invalid parameter
    1062         psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
    1063         outputCoord = psSpherePrecess(inputCoord, NULL, toTime);
    1064         if(outputCoord != NULL) {
    1065             psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid input");
    1066             return 11;
    1067         }
    1068     */
     1066    //Test other modes (IAU2000A, COMPLETE_[A,B])
     1067    // Set input coordinate
     1068    inputCoord->r = SPHERE_PRECESS_TP1_R;
     1069    inputCoord->d = SPHERE_PRECESS_TP1_D;
     1070    inputCoord->rErr = 0.0;
     1071    inputCoord->dErr = 0.0;
     1072    // Calculate precess
     1073    rot = psSpherePrecess(fromTime, toTime, PS_PRECESS_COMPLETE_A);
     1074    outputCoord = psSphereRotApply(NULL, rot, inputCoord);
     1075    if (outputCoord->r < -0.000001) {
     1076        outputCoord->r += 2.0 * M_PI;
     1077    }
     1078    // Verify return is not NULL
     1079    if(outputCoord == NULL) {
     1080        psError(PS_ERR_UNKNOWN,true,"Returned NULL not expected");
     1081        return 10;
     1082    }
     1083    psFree(outputCoord);
     1084    psFree(rot);
     1085
     1086    rot = psSpherePrecess(fromTime, toTime, PS_PRECESS_COMPLETE_B);
     1087    outputCoord = psSphereRotApply(NULL, rot, inputCoord);
     1088    if (outputCoord->r < -0.000001) {
     1089        outputCoord->r += 2.0 * M_PI;
     1090    }
     1091    // Verify return is not NULL
     1092    if(outputCoord == NULL) {
     1093        psError(PS_ERR_UNKNOWN,true,"Returned NULL not expected");
     1094        return 11;
     1095    }
     1096    psFree(outputCoord);
     1097    psFree(rot);
     1098
     1099    rot = psSpherePrecess(fromTime, toTime, PS_PRECESS_IAU2000A);
     1100    outputCoord = psSphereRotApply(NULL, rot, inputCoord);
     1101    if (outputCoord->r < -0.000001) {
     1102        outputCoord->r += 2.0 * M_PI;
     1103    }
     1104    // Verify return is not NULL
     1105    if(outputCoord == NULL) {
     1106        psError(PS_ERR_UNKNOWN,true,"Returned NULL not expected");
     1107        return 12;
     1108    }
     1109    psFree(outputCoord);
     1110    psFree(rot);
     1111
    10691112    // Invoke precess with invalid parameter
    10701113    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
    10711114    rot = psSpherePrecess(fromTime, toTime, 10);
    1072     //    outputCoord = psSpherePrecess(NULL, fromTime, toTime, PS_PRECESS_ROUGH);
    10731115    if(rot != NULL) {
    1074         //    if(outputCoord != NULL) {
    10751116        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid input");
     1117        return 14;
     1118    }
     1119    // Return NULL for NULL input times
     1120    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
     1121    rot = psSpherePrecess(NULL, NULL, PS_PRECESS_ROUGH);
     1122    if(rot != NULL) {
     1123        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid input");
     1124        return 15;
     1125    }
     1126
     1127    if (!p_psEOCFinalize() ) {
     1128        psError(PS_ERR_BAD_PARAMETER_VALUE, false, "EOC failed finalization!\n");
    10761129        return 12;
    10771130    }
    1078     psFree(rot);
    1079 
    10801131    // Free objects
    10811132    psFree(fromTime);
Note: See TracChangeset for help on using the changeset viewer.