IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 23, 2006, 10:04:31 AM (21 years ago)
Author:
drobbin
Message:

updated PrecessMethod. Fixed MetadataAddStr to error on NULL input. Time_TideUT1Corr?

File:
1 edited

Legend:

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

    r6039 r6184  
    55*  @author d-Rob, MHPCC
    66*
    7 *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
    8 *  @date $Date: 2006-01-18 23:49:06 $
     7*  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
     8*  @date $Date: 2006-01-23 20:04:31 $
    99*
    1010*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    132132    speed /= c;
    133133
     134    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
    134135    empty = psAberration(empty, apparent, direction, speed);
    135136    if (empty != NULL) {
     
    138139        return 1;
    139140    }
     141    psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message");
    140142    empty = psAberration(empty, actual, apparent, speed);
    141143    if (empty != NULL) {
     
    951953    psTime*       fromTime    = psTimeFromMJD(MJD_2100);
    952954    psTime*       toTime      = psTimeFromMJD(MJD_1900);
    953 
     955    psSphereRot *rot = NULL;
    954956    // Set input coordinate
    955957    inputCoord->r = SPHERE_PRECESS_TP1_R;
     
    959961
    960962    // Calculate precess
    961     outputCoord = psSpherePrecess(inputCoord, fromTime, toTime);
     963    rot = psSpherePrecess(fromTime, toTime, PS_PRECESS_ROUGH);
     964    outputCoord = psSphereRotApply(NULL, rot, inputCoord);
     965    if (outputCoord->r < -0.0001) {
     966        outputCoord->r += 2.0 * M_PI;
     967    }
     968    //    outputCoord = psSpherePrecess(inputCoord, fromTime, toTime, PS_PRECESS_ROUGH);
    962969    // Verify return is not NULL
    963970    if(outputCoord == NULL) {
     
    977984    }
    978985    psFree(outputCoord);
     986    psFree(rot);
    979987
    980988    // Set input coordinate
     
    985993
    986994    // Calculate precess
    987     outputCoord = psSpherePrecess(inputCoord, fromTime, toTime);
     995    rot = psSpherePrecess(fromTime, toTime, PS_PRECESS_ROUGH);
     996    outputCoord = psSphereRotApply(NULL, rot, inputCoord);
     997    if (outputCoord->r < -0.0001) {
     998        outputCoord->r += 2.0 * M_PI;
     999    }
     1000    //    outputCoord = psSpherePrecess(inputCoord, fromTime, toTime, PS_PRECESS_ROUGH);
    9881001    // Verify return is not NULL
    9891002    if(outputCoord == NULL) {
     
    10031016    }
    10041017    psFree(outputCoord);
     1018    psFree(rot);
    10051019
    10061020    // Set input coordinate
     
    10111025
    10121026    // Calculate precess
    1013     outputCoord = psSpherePrecess(inputCoord, fromTime, toTime);
     1027    rot = psSpherePrecess(fromTime, toTime, PS_PRECESS_ROUGH);
     1028    outputCoord = psSphereRotApply(NULL, rot, inputCoord);
     1029    if (outputCoord->r < -0.0001) {
     1030        outputCoord->r += 2.0 * M_PI;
     1031    }
     1032    //    outputCoord = psSpherePrecess(inputCoord, fromTime, toTime, PS_PRECESS_ROUGH);
    10141033    // Verify return is not NULL
    10151034    if(outputCoord == NULL) {
     
    10291048    }
    10301049    psFree(outputCoord);
    1031 
     1050    psFree(rot);
     1051
     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    */
    10321069    // Invoke precess with invalid parameter
    10331070    psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
    1034     outputCoord = psSpherePrecess(inputCoord, fromTime, NULL);
    1035     if(outputCoord != NULL) {
    1036         psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid input");
    1037         return 10;
    1038     }
    1039 
    1040     // Invoke precess with invalid parameter
    1041     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
    1042     outputCoord = psSpherePrecess(inputCoord, NULL, toTime);
    1043     if(outputCoord != NULL) {
    1044         psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid input");
    1045         return 11;
    1046     }
    1047 
    1048     // Invoke precess with invalid parameter
    1049     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
    1050     outputCoord = psSpherePrecess(NULL, fromTime, toTime);
    1051     if(outputCoord != NULL) {
     1071    rot = psSpherePrecess(fromTime, toTime, 10);
     1072    //    outputCoord = psSpherePrecess(NULL, fromTime, toTime, PS_PRECESS_ROUGH);
     1073    if(rot != NULL) {
     1074        //    if(outputCoord != NULL) {
    10521075        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid input");
    10531076        return 12;
    10541077    }
     1078    psFree(rot);
    10551079
    10561080    // Free objects
Note: See TracChangeset for help on using the changeset viewer.