IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6189


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.

Location:
trunk/psLib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/types/psArguments.h

    r6187 r6189  
    77 *  @author David Robbins, MHPCC
    88 *
    9  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2006-01-23 23:52:15 $
     9 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-01-25 03:02:47 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2828 */
    2929int psArgumentVerbosity(
    30     int *argc,                         ///< number or arguments
     30    int *argc,                         ///< number of arguments
    3131    char **argv                        ///< the argument list
    3232);
     
    3737 */
    3838int psArgumentGet(
    39     int argc,                          ///< number or arguments
     39    int argc,                          ///< number of arguments
    4040    char **argv,                       ///< the argument list
    4141    const char *arg                    ///< the specified argument to match
     
    5050bool psArgumentRemove(
    5151    int argnum,                        ///< the argument to remove
    52     int *argc,                         ///< number or arguments
     52    int *argc,                         ///< number of arguments
    5353    char **argv                        ///< the argument list
    5454);
     
    6565bool psArgumentParse(
    6666    psMetadata *arguments,             ///< metadata container for arguments
    67     int *argc,                         ///< number or arguments
     67    int *argc,                         ///< number of arguments
    6868    char **argv                        ///< the argument list
    6969);
     
    7474);
    7575
     76/** Sets the log level.
     77 *
     78 *  @return psS32:     the log level.
     79 */
    7680psS32 psLogArguments(
    77     int *argc,
    78     char **argv
     81    int *argc,                         ///< number of arguments
     82    char **argv                        ///< the argument list
    7983);
    8084
     85/** Sets trace levels by facility
     86 *
     87 *  @return psS32:      1 (true) if successful or else 2.
     88 */
    8189psS32 psTraceArguments(
    82     int *argc,
    83     char **argv
     90    int *argc,                         ///< number of arguments
     91    char **argv                        ///< the argument list
    8492);
    8593
  • trunk/psLib/src/types/psMetadata.c

    r6187 r6189  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.94 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2006-01-23 23:52:15 $
     14 *  @version $Revision: 1.95 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2006-01-25 03:02:47 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    886886            *status = false;
    887887        } else {
    888             psError(PS_ERR_IO, true, "Couldn't find %s in the metadata.\n");
     888            psError(PS_ERR_IO, true, "Couldn't find %s in the metadata.\n", key);
    889889        }
    890890    } else if (item->type != PS_DATA_METADATA) {
     
    893893            *status = false;
    894894        } else {
    895             psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_DATA_META, as expected.\n");
     895            psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_DATA_META, as expected.\n", key);
    896896        }
    897897        value = NULL;
     
    921921            *status = false;
    922922        } else {
    923             psError(PS_ERR_IO, true, "Couldn't find %s in the metadata.\n");
     923            psError(PS_ERR_IO, true, "Couldn't find %s in the metadata.\n", key);
    924924        }
    925925    } else if (item->type != PS_DATA_STRING) {
     
    928928            *status = false;
    929929        } else {
    930             psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_DATA_STRING, as expected.\n");
     930            psLogMsg(__func__, PS_LOG_WARN, "%s isn't of type PS_DATA_STRING, as expected.\n", key);
    931931        }
    932932        value = NULL;
  • trunk/psLib/src/types/psMetadataConfig.c

    r5841 r6189  
    1010*  @author Eric Van Alst, MHPCC
    1111*
    12 *  @version $Revision: 1.49 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-12-24 00:33:20 $
     12*  @version $Revision: 1.50 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2006-01-25 03:02:47 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    14171417                strncat(mdString, "F32 ", MAXSTR);
    14181418                for (i = 0; ((psVector*)(item->data.V))->data.F32[i] != 0; i++) {
    1419                     snprintf(content, MAXSTR, "%f",
     1419                    snprintf(content, MAXSTR, "%22.15g",
    14201420                             ((psVector*)(item->data.V))->data.F32[i]);
    14211421                    if ( ((psVector*)(item->data.V))->data.F32[i+1] != 0 ) {
     
    14281428                strncat(mdString, "F64 ", MAXSTR);
    14291429                for (i = 0; ((psVector*)(item->data.V))->data.F64[i] != 0; i++) {
    1430                     snprintf(content, MAXSTR, "%lf",
     1430                    snprintf(content, MAXSTR, "%22.15g",
    14311431                             ((psVector*)(item->data.V))->data.F64[i]);
    14321432                    if ( ((psVector*)(item->data.V))->data.F64[i+1] != 0 ) {
  • 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);
  • trunk/psLib/test/astro/tst_psSphereOps.c

    r6039 r6189  
    55*  @author d-Rob, MHPCC
    66*
    7 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
    8 *  @date $Date: 2006-01-18 23:49:06 $
     7*  @version $Revision: 1.16 $ $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
     
    1818static psS32 testSphereRotApply1(void);
    1919static psS32 testSphereRotApplyCelestial(void);
    20 //static psS32 testSphereRotPrecess(void);
    2120static psS32 testSphereOffset(void);
    2221
     
    2625                              {testSphereRotApply1, 821, "psSphereRotApply()", 0, false},
    2726                              {testSphereRotApplyCelestial, 822, "psSphereRotApplyCel()", 0, false},
    28                               //                              {testSphereRotPrecess, 823, "psSphereRotPrecess()", 0, false},
    2927                              {testSphereOffset, 825, "testSphereOffset()", 0, false},
    3028                              {NULL}
Note: See TracChangeset for help on using the changeset viewer.