IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6039


Ignore:
Timestamp:
Jan 18, 2006, 1:49:06 PM (20 years ago)
Author:
drobbin
Message:

chgd psMetadataType's to psDataType's. Moved SpherePrecess to EOC. checked in verified tests.

Location:
trunk/psLib
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astro/psEarthOrientation.c

    r6036 r6039  
    88 *  @author Robert Daniel DeSonia, MHPCC
    99 *
    10  *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2006-01-18 20:59:31 $
     10 *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2006-01-18 23:49:06 $
    1212 *
    1313 *  Copyright 2005 Maui High Performance Computing Center, University of Hawaii
     
    470470    // Convert psTime to MJD
    471471    double MJD = psTimeToMJD(time);
     472    if (MJD == NAN) {
     473        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     474                "Time conversion to MJD failed.  Invalid input time.\n");
     475        return NULL;
     476    }
    472477
    473478    // Calculate number of Julian centuries since 2000
     
    630635
    631636    double MJD = psTimeToMJD(time);
    632 
    633     if (MJD < 41684.0 || MJD > 53334.0) {
    634         psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    635                 "Invalid time input.  Date, %lf, is out of range (41684-53334)\n", MJD);
    636         return out;
    637     }
    638 
     637    if (MJD == NAN) {
     638        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     639                "Time conversion to MJD failed.  Invalid input time.\n");
     640        return NULL;
     641    }
     642    /*
     643        if (MJD < 41684.0 || MJD > 53334.0) {
     644            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     645                    "Invalid time input.  Date, %lf, is out of range (41684-53334)\n", MJD);
     646            return out;
     647        }
     648    */
    639649    // Check if EOC data loaded
    640650    if(!eocInitialized) {
     
    854864    }
    855865    double T = psTimeToJD(in);
     866    if (T == NAN) {
     867        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     868                "Time conversion to JD failed.  Invalid input time.\n");
     869        return NULL;
     870    }
    856871    T += -2451545.0;
    857872    double theta = 2.0 * M_PI * (0.7790572732640 + 1.00273781191135448 * T);
     
    874889
    875890    double MJD = psTimeToMJD(time);
    876     /*
    877         if (MJD < 41684.0 || (MJD > 53434.0 && bulletin == PS_IERS_B) ||
    878                 (MJD > 53858.0 && bulletin == PS_IERS_A) ) {
    879             psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    880                     "Invalid time input.  Date, %lf, is out of range\n", MJD);
    881             return out;
    882         }
    883     */
     891    if (MJD == NAN) {
     892        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     893                "Time conversion to MJD failed.  Invalid input time.\n");
     894        return NULL;
     895    }
     896
    884897    // Check if EOC data loaded
    885898    if(! eocInitialized) {
     
    10071020    // Convert psTime to MJD
    10081021    double MJD = psTimeToMJD(time);
     1022    if (MJD == NAN) {
     1023        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     1024                "Time conversion to MJD failed.  Invalid input time.\n");
     1025        return NULL;
     1026    }
    10091027
    10101028    // Calculate number of Julian centuries since 2000
     
    10861104    // Check for null parameter
    10871105    PS_ASSERT_PTR_NON_NULL(time, NULL);
    1088     if (time->type == PS_TIME_UT1) {
    1089         psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    1090                 "Invalid time input.  Time cannot be of type UT1.\n");
    1091         return NULL;
    1092     }
    1093 
     1106    /*    if (time->type == PS_TIME_UT1) {
     1107            psError(PS_ERR_BAD_PARAMETER_VALUE, true,
     1108                    "Invalid time input.  Time cannot be of type UT1.\n");
     1109            return NULL;
     1110        }
     1111    */
    10941112    // Convert psTime to MJD
    10951113    double MJD = psTimeToMJD(time);
     1114    if (MJD == NAN) {
     1115        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     1116                "Time conversion to MJD failed.  Invalid input time.\n");
     1117        return NULL;
     1118    }
    10961119
    10971120    // Calculate number of Julian centuries since 2000
     
    14381461    return out;
    14391462}
     1463
     1464/******************************************************************************
     1465psSpherePrecess(coords, fromTime, toTime):
     1466 
     1467XXX: Use static memory for tmpST.
     1468 *****************************************************************************/
     1469psSphere *psSpherePrecess(psSphere *coords,
     1470                          const psTime *fromTime,
     1471                          const psTime *toTime)
     1472{
     1473    // Check input for NULL pointers
     1474    PS_ASSERT_PTR_NON_NULL(coords, NULL);
     1475    PS_ASSERT_PTR_NON_NULL(fromTime, NULL);
     1476    PS_ASSERT_PTR_NON_NULL(toTime, NULL);
     1477
     1478    // Calculate Julian centuries
     1479    psF64 fromMJD = psTimeToMJD(fromTime);
     1480    psF64 toMJD = psTimeToMJD(toTime);
     1481    psF64 T = (toMJD - fromMJD) / JULIAN_CENTURY;
     1482
     1483    // Calculate conversion constants
     1484    //    psF64 alphaP = DEG_TO_RAD(90.0) - ((DEG_TO_RAD(0.6406161) * T) +
     1485    psF64 alphaP = DEG_TO_RAD(180.0) + ((DEG_TO_RAD(0.6406161) * T) +
     1486                                        (DEG_TO_RAD(0.0000839) * T * T) +
     1487                                        (DEG_TO_RAD(0.000005) * T * T * T));
     1488
     1489    psF64 deltaP = (DEG_TO_RAD(0.5567530) * T) -
     1490                   (DEG_TO_RAD(0.0001185) * T * T) -
     1491                   (DEG_TO_RAD(0.0000116) * T * T * T);
     1492
     1493    //    psF64 phiP = DEG_TO_RAD(90.0) + ((DEG_TO_RAD(0.6406161) * T) +
     1494    psF64 phiP = DEG_TO_RAD(180.0) + ((DEG_TO_RAD(0.6406161) * T) +
     1495                                      (DEG_TO_RAD(0.0003041) * T * T) +
     1496                                      (DEG_TO_RAD(0.0000051) * T * T * T));
     1497
     1498    // Create transform with proper constants
     1499    psSphereRot* tmpST = psSphereRotAlloc(alphaP, deltaP, phiP);
     1500
     1501    // Apply transform to coordinates
     1502    psSphere *out = psSphereRotApply(NULL, tmpST, coords);
     1503    if (out->r < -0.0001) {
     1504        out->r += 2.0 * M_PI;
     1505    }
     1506
     1507    psFree(tmpST);
     1508
     1509    return(out);
     1510}
  • trunk/psLib/src/astro/psEarthOrientation.h

    r6030 r6039  
    99*  @author Robert Daniel DeSonia, MHPCC
    1010*
    11 *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2006-01-18 00:41:29 $
     11*  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2006-01-18 23:49:06 $
    1313*
    1414*  Copyright 2005 Maui High Performance Computing Center, University of Hawaii
     
    176176);
    177177
     178/** Generates the complete spherical rotation to account for precession
     179 *  between two times.  The equinoxes shall be Julian equinoxes.
     180 *
     181 *  @return psSphere* the resulting spherical rotation
     182 */
     183psSphere* psSpherePrecess(
     184    psSphere *coords,                  ///< coordinates (modified in-place)
     185    const psTime *fromTime,            ///< equinox of coords input
     186    const psTime *toTime               ///< equinox of coords output
     187);
     188
     189
    178190#endif // #ifndef PS_EARTH_ORIENTATION
  • trunk/psLib/src/astro/psSphereOps.c

    r5493 r6039  
    88 *  @author Dave Robbins, MHPCC
    99 *
    10  *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-11-10 00:13:50 $
     10 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2006-01-18 23:49:06 $
    1212 *
    1313 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    536536}
    537537
    538 /******************************************************************************
    539 psSpherePrecess(coords, fromTime, toTime):
    540  
    541 XXX: Use static memory for tmpST.
    542  *****************************************************************************/
    543 psSphere *psSpherePrecess(psSphere *coords,
    544                           const psTime *fromTime,
    545                           const psTime *toTime)
    546 {
    547     // Check input for NULL pointers
    548     PS_ASSERT_PTR_NON_NULL(coords, NULL);
    549     PS_ASSERT_PTR_NON_NULL(fromTime, NULL);
    550     PS_ASSERT_PTR_NON_NULL(toTime, NULL);
    551 
    552     // Calculate Julian centuries
    553     psF64 fromMJD = psTimeToMJD(fromTime);
    554     psF64 toMJD = psTimeToMJD(toTime);
    555     psF64 T = (toMJD - fromMJD) / JULIAN_CENTURY;
    556 
    557     // Calculate conversion constants
    558     //    psF64 alphaP = DEG_TO_RAD(90.0) - ((DEG_TO_RAD(0.6406161) * T) +
    559     psF64 alphaP = DEG_TO_RAD(180.0) + ((DEG_TO_RAD(0.6406161) * T) +
    560                                         (DEG_TO_RAD(0.0000839) * T * T) +
    561                                         (DEG_TO_RAD(0.000005) * T * T * T));
    562 
    563     psF64 deltaP = (DEG_TO_RAD(0.5567530) * T) -
    564                    (DEG_TO_RAD(0.0001185) * T * T) -
    565                    (DEG_TO_RAD(0.0000116) * T * T * T);
    566 
    567     //    psF64 phiP = DEG_TO_RAD(90.0) + ((DEG_TO_RAD(0.6406161) * T) +
    568     psF64 phiP = DEG_TO_RAD(180.0) + ((DEG_TO_RAD(0.6406161) * T) +
    569                                       (DEG_TO_RAD(0.0003041) * T * T) +
    570                                       (DEG_TO_RAD(0.0000051) * T * T * T));
    571 
    572     // Create transform with proper constants
    573     psSphereRot* tmpST = psSphereRotAlloc(alphaP, deltaP, phiP);
    574 
    575     // Apply transform to coordinates
    576     psSphere *out = psSphereRotApply(NULL, tmpST, coords);
    577     if (out->r < -0.0001) {
    578         out->r += 2.0 * M_PI;
    579     }
    580 
    581     psFree(tmpST);
    582 
    583     return(out);
    584 }
    585 
     538
  • trunk/psLib/src/astro/psSphereOps.h

    r5483 r6039  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-11-07 20:52:43 $
     9 *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-01-18 23:49:06 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    215215psSphereRot* psSphereRotGalacticToICRS(void);
    216216
    217 /** Generates the complete spherical rotation to account for precession
    218  *  between two times.  The equinoxes shall be Julian equinoxes.
    219  *
    220  *  @return psSphere* the resulting spherical rotation
    221  */
    222 psSphere* psSpherePrecess(
    223     psSphere *coords,                  ///< coordinates (modified in-place)
    224     const psTime *fromTime,            ///< equinox of coords input
    225     const psTime *toTime               ///< equinox of coords output
    226 );
    227 
    228217/// @}
    229218
  • trunk/psLib/src/psErrorText_en.dat

    r5512 r6039  
    3636psAstrometry_NONLINEAR_TRANSFORM       The %s transfrom is not linear.  Only linear transforms are supported.
    3737#
    38 psMetadata_METATYPE_INVALID            Specified psMetadataType, %d, is not supported.
     38psMetadata_METATYPE_INVALID            Specified psDataType, %d, is not supported.
    3939psMetadata_FORMAT_INVALID              Specified print format, %%%c, is not supported.
    40 psMetadata_METATYPE_MISMATCH           Specified psMetadataType, %d, is incorrect. Expected %d.
     40psMetadata_METATYPE_MISMATCH           Specified psDataType, %d, is incorrect. Expected %d.
    4141psMetadata_ADD_LIST_FAILED             Failed to add metadata item, %s, to items list.
    4242psMetadata_ADD_TABLE_FAILED            Failed to add metadata item, %s, to items table.
     
    197197psStats_STATS_FAILED                   Failed to calculate the specified statistic.
    198198psStats_STATS_SAMPLE_MEDIAN_SORT_PROBLEM            Failed to sort input data.
    199 psStats_STATS_VECTOR_BIN_DISECT_PROBLEM         Failed to determine the bin number of a data element.
     199psStats_STATS_VECTOR_BIN_DISECT_PROBLEM     Failed to determine the bin number of a data element.
    200200psStats_STATS_FIT_QUADRATIC_POLYNOMIAL_1D_FIT Failed to fit a 1-dimensional polynomial to the three specified data points.  Returning NAN.
    201201psStats_STATS_FIT_QUADRATIC_POLY_MEDIAN Failed to determine the median of the fitted polynomial.  Returning NAN.
    202 psStats_ROBUST_STATS_CLIPPED_STATS      Failed to determine clipped statistics.
     202psStats_ROBUST_STATS_CLIPPED_STATS  Failed to determine clipped statistics.
    203203psStats_STATS_POLY_MEDIAN_OUT_OF_RANGE The requested y-value does not fall with the specified range of x-values.  Returning NAN.
    204204#
  • trunk/psLib/src/types/psMetadata.h

    r5539 r6039  
    1111*  @author Ross Harman, MHPCC
    1212*
    13 *  @version $Revision: 1.71 $ $Name: not supported by cvs2svn $
    14 *  @date $Date: 2005-11-18 01:51:03 $
     13*  @version $Revision: 1.72 $ $Name: not supported by cvs2svn $
     14*  @date $Date: 2006-01-18 23:49:06 $
    1515*
    1616*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    304304    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    305305    const char *name,                  ///< Name of metadata item.
    306     int format,                        ///< Type of metadata item (psMetadataType) and options (psMetadataFlags)
     306    int format,                        ///< psDataType of metadata item & options (psMetadataFlags)
    307307    const char *comment,               ///< Comment for metadata item.
    308308    ...                                ///< Arguments for name formatting and metadata item data.
     
    320320    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
    321321    const char *name,                  ///< Name of metadata item.
    322     int format,                        ///< Type of metadata item (psMetadataType) and options (psMetadataFlags)
     322    int format,                        ///< psDataType of metadata item & options (psMetadataFlags)
    323323    const char *comment,               ///< Comment for metadata item.
    324324    va_list list                       ///< Arguments for name formatting and metadata item data.
  • trunk/psLib/test/astro/tst_psEarthOrientation.c

    r6030 r6039  
    55*  @author d-Rob, MHPCC
    66*
    7 *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
    8 *  @date $Date: 2006-01-18 00:41:29 $
     7*  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
     8*  @date $Date: 2006-01-18 23:49:06 $
    99*
    1010*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2525static psS32 testSphereRot_CEOtoGCRS(void);
    2626static psS32 testSphereRot_ITRStoTEO(void);
     27static psS32 testSphereRotPrecess(void);
    2728
    2829testDescription tests[] = {
     
    3738                              {testSphereRot_CEOtoGCRS, 675, "psSphereRot_CEOtoGCRS()", 0, false},
    3839                              {testSphereRot_ITRStoTEO, 676, "psSphereRRot_ITRStoTEO()", 0, false},
     40                              {testSphereRotPrecess, 677, "psSphereRotPrecess()", 0, false},
    3941                              {NULL}
    4042                          };
     
    661663    }
    662664    //Return NULL for UT1 time input
    663     psTime *UT1time = psTimeAlloc(PS_TIME_UT1);
    664     nute = psEOC_NutationCorr(UT1time);
    665     if (nute != NULL) {
    666         psError(PS_ERR_BAD_PARAMETER_VALUE, false,
    667                 "psEOC_NutationCorr failed to return NULL for UT1 input time.\n");
    668         return 2;
    669     }
    670     psFree(UT1time);
     665    /*    psTime *UT1time = psTimeAlloc(PS_TIME_UT1);
     666        nute = psEOC_NutationCorr(UT1time);
     667        if (nute != NULL) {
     668            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     669                    "psEOC_NutationCorr failed to return NULL for UT1 input time.\n");
     670            return 2;
     671        }
     672        psFree(UT1time);
     673    */
    671674    //Check return values from valid nutation time input
    672675    nute = psEOC_NutationCorr(in);
     
    925928}
    926929
     930#define SPHERE_PRECESS_TP1_R            0.0               //    0.0       degrees
     931#define SPHERE_PRECESS_TP1_D            0.0               //    0.0       degrees
     932#define SPHERE_PRECESS_TP1_EXPECT_R     6.238453          //  357.437     degrees
     933#define SPHERE_PRECESS_TP1_EXPECT_D    -0.019426          //   -1.113     degrees
     934#define SPHERE_PRECESS_TP2_R            0.0               //    0.0       degrees
     935#define SPHERE_PRECESS_TP2_D            1.570796          //   90.0       degrees
     936#define SPHERE_PRECESS_TP2_EXPECT_R     6.260828          //  358.719     degrees
     937#define SPHERE_PRECESS_TP2_EXPECT_D     1.551353          //   88.886     degrees
     938#define SPHERE_PRECESS_TP3_R            3.141593          //  180.0       degrees
     939#define SPHERE_PRECESS_TP3_D            0.523599          //   30.0       degrees
     940#define SPHERE_PRECESS_TP3_EXPECT_R     3.096616          //  177.423     degrees
     941#define SPHERE_PRECESS_TP3_EXPECT_D     0.543024          //   31.113     degrees
     942#define ERROR_TOL   0.0001
     943#define MJD_1900  15021.0        // Modified Julian Day 1/1/1900 00:00:00
     944#define MJD_2100  88069.0        // Modified Julian Day 1/1/2100 00:00:00
     945
     946psS32 testSphereRotPrecess( void )
     947{
     948
     949    psSphere*     inputCoord  = psSphereAlloc();
     950    psSphere*     outputCoord = NULL;
     951    psTime*       fromTime    = psTimeFromMJD(MJD_2100);
     952    psTime*       toTime      = psTimeFromMJD(MJD_1900);
     953
     954    // Set input coordinate
     955    inputCoord->r = SPHERE_PRECESS_TP1_R;
     956    inputCoord->d = SPHERE_PRECESS_TP1_D;
     957    inputCoord->rErr = 0.0;
     958    inputCoord->dErr = 0.0;
     959
     960    // Calculate precess
     961    outputCoord = psSpherePrecess(inputCoord, fromTime, toTime);
     962    // Verify return is not NULL
     963    if(outputCoord == NULL) {
     964        psError(PS_ERR_UNKNOWN,true,"Returned NULL not expected");
     965        return 1;
     966    }
     967    // Verify return with expected values
     968    if( fabs(outputCoord->r - SPHERE_PRECESS_TP1_EXPECT_R) > ERROR_TOL) {
     969        psError(PS_ERR_UNKNOWN,true,"Precess r = %lg not equal to expected = %lg",
     970                outputCoord->r,SPHERE_PRECESS_TP1_EXPECT_R);
     971        return 2;
     972    }
     973    if( fabs(outputCoord->d - SPHERE_PRECESS_TP1_EXPECT_D) > ERROR_TOL) {
     974        psError(PS_ERR_UNKNOWN,true,"Precess d = %lg not equal to expected = %lg",
     975                outputCoord->d,SPHERE_PRECESS_TP1_EXPECT_D);
     976        return 3;
     977    }
     978    psFree(outputCoord);
     979
     980    // Set input coordinate
     981    inputCoord->r = SPHERE_PRECESS_TP2_R;
     982    inputCoord->d = SPHERE_PRECESS_TP2_D;
     983    inputCoord->rErr = 0.0;
     984    inputCoord->dErr = 0.0;
     985
     986    // Calculate precess
     987    outputCoord = psSpherePrecess(inputCoord, fromTime, toTime);
     988    // Verify return is not NULL
     989    if(outputCoord == NULL) {
     990        psError(PS_ERR_UNKNOWN,true,"Returned NULL not expected");
     991        return 4;
     992    }
     993    // Verify return with expected values
     994    if( fabs(outputCoord->r - SPHERE_PRECESS_TP2_EXPECT_R) > ERROR_TOL) {
     995        psError(PS_ERR_UNKNOWN,true,"Precess r = %lg not equal to expected = %lg",
     996                outputCoord->r,SPHERE_PRECESS_TP2_EXPECT_R);
     997        return 5;
     998    }
     999    if( fabs(outputCoord->d - SPHERE_PRECESS_TP2_EXPECT_D) > ERROR_TOL) {
     1000        psError(PS_ERR_UNKNOWN,true,"Precess d = %lg not equal to expected = %lg",
     1001                outputCoord->d,SPHERE_PRECESS_TP2_EXPECT_D);
     1002        return 6;
     1003    }
     1004    psFree(outputCoord);
     1005
     1006    // Set input coordinate
     1007    inputCoord->r = SPHERE_PRECESS_TP3_R;
     1008    inputCoord->d = SPHERE_PRECESS_TP3_D;
     1009    inputCoord->rErr = 0.0;
     1010    inputCoord->dErr = 0.0;
     1011
     1012    // Calculate precess
     1013    outputCoord = psSpherePrecess(inputCoord, fromTime, toTime);
     1014    // Verify return is not NULL
     1015    if(outputCoord == NULL) {
     1016        psError(PS_ERR_UNKNOWN,true,"Returned NULL not expected");
     1017        return 7;
     1018    }
     1019    // Verify return with expected values
     1020    if( fabs(outputCoord->r - SPHERE_PRECESS_TP3_EXPECT_R) > ERROR_TOL) {
     1021        psError(PS_ERR_UNKNOWN,true,"Precess r = %lg not equal to expected = %lg",
     1022                outputCoord->r,SPHERE_PRECESS_TP3_EXPECT_R);
     1023        return 8;
     1024    }
     1025    if( fabs(outputCoord->d - SPHERE_PRECESS_TP3_EXPECT_D) > ERROR_TOL) {
     1026        psError(PS_ERR_UNKNOWN,true,"Precess d = %lg not equal to expected = %lg",
     1027                outputCoord->d,SPHERE_PRECESS_TP3_EXPECT_D);
     1028        return 9;
     1029    }
     1030    psFree(outputCoord);
     1031
     1032    // Invoke precess with invalid parameter
     1033    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) {
     1052        psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid input");
     1053        return 12;
     1054    }
     1055
     1056    // Free objects
     1057    psFree(fromTime);
     1058    psFree(toTime);
     1059    psFree(inputCoord);
     1060
     1061    return 0;
     1062}
  • trunk/psLib/test/astro/tst_psSphereOps.c

    r5626 r6039  
    55*  @author d-Rob, MHPCC
    66*
    7 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    8 *  @date $Date: 2005-11-30 02:17:17 $
     7*  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     8*  @date $Date: 2006-01-18 23:49:06 $
    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);
     20//static psS32 testSphereRotPrecess(void);
    2121static psS32 testSphereOffset(void);
    2222
     
    2626                              {testSphereRotApply1, 821, "psSphereRotApply()", 0, false},
    2727                              {testSphereRotApplyCelestial, 822, "psSphereRotApplyCel()", 0, false},
    28                               {testSphereRotPrecess, 823, "psSphereRotPrecess()", 0, false},
     28                              //                              {testSphereRotPrecess, 823, "psSphereRotPrecess()", 0, false},
    2929                              {testSphereOffset, 825, "testSphereOffset()", 0, false},
    3030                              {NULL}
     
    298298}
    299299
    300 #define SPHERE_PRECESS_TP1_R            0.0               //    0.0       degrees
    301 #define SPHERE_PRECESS_TP1_D            0.0               //    0.0       degrees
    302 #define SPHERE_PRECESS_TP1_EXPECT_R     6.238453          //  357.437     degrees
    303 #define SPHERE_PRECESS_TP1_EXPECT_D    -0.019426          //   -1.113     degrees
    304 #define SPHERE_PRECESS_TP2_R            0.0               //    0.0       degrees
    305 #define SPHERE_PRECESS_TP2_D            1.570796          //   90.0       degrees
    306 #define SPHERE_PRECESS_TP2_EXPECT_R     6.260828          //  358.719     degrees
    307 #define SPHERE_PRECESS_TP2_EXPECT_D     1.551353          //   88.886     degrees
    308 #define SPHERE_PRECESS_TP3_R            3.141593          //  180.0       degrees
    309 #define SPHERE_PRECESS_TP3_D            0.523599          //   30.0       degrees
    310 #define SPHERE_PRECESS_TP3_EXPECT_R     3.096616          //  177.423     degrees
    311 #define SPHERE_PRECESS_TP3_EXPECT_D     0.543024          //   31.113     degrees
    312 
    313 psS32 testSphereRotPrecess( void )
    314 {
    315 
    316     psSphere*     inputCoord  = psSphereAlloc();
    317     psSphere*     outputCoord = NULL;
    318     psTime*       fromTime    = psTimeFromMJD(MJD_2100);
    319     psTime*       toTime      = psTimeFromMJD(MJD_1900);
    320 
    321     // Set input coordinate
    322     inputCoord->r = SPHERE_PRECESS_TP1_R;
    323     inputCoord->d = SPHERE_PRECESS_TP1_D;
    324     inputCoord->rErr = 0.0;
    325     inputCoord->dErr = 0.0;
    326 
    327     // Calculate precess
    328     outputCoord = psSpherePrecess(inputCoord, fromTime, toTime);
    329     // Verify return is not NULL
    330     if(outputCoord == NULL) {
    331         psError(PS_ERR_UNKNOWN,true,"Returned NULL not expected");
    332         return 1;
    333     }
    334     // Verify return with expected values
    335     if( fabs(outputCoord->r - SPHERE_PRECESS_TP1_EXPECT_R) > ERROR_TOL) {
    336         psError(PS_ERR_UNKNOWN,true,"Precess r = %lg not equal to expected = %lg",
    337                 outputCoord->r,SPHERE_PRECESS_TP1_EXPECT_R);
    338         return 2;
    339     }
    340     if( fabs(outputCoord->d - SPHERE_PRECESS_TP1_EXPECT_D) > ERROR_TOL) {
    341         psError(PS_ERR_UNKNOWN,true,"Precess d = %lg not equal to expected = %lg",
    342                 outputCoord->d,SPHERE_PRECESS_TP1_EXPECT_D);
    343         return 3;
    344     }
    345     psFree(outputCoord);
    346 
    347     // Set input coordinate
    348     inputCoord->r = SPHERE_PRECESS_TP2_R;
    349     inputCoord->d = SPHERE_PRECESS_TP2_D;
    350     inputCoord->rErr = 0.0;
    351     inputCoord->dErr = 0.0;
    352 
    353     // Calculate precess
    354     outputCoord = psSpherePrecess(inputCoord, fromTime, toTime);
    355     // Verify return is not NULL
    356     if(outputCoord == NULL) {
    357         psError(PS_ERR_UNKNOWN,true,"Returned NULL not expected");
    358         return 4;
    359     }
    360     // Verify return with expected values
    361     if( fabs(outputCoord->r - SPHERE_PRECESS_TP2_EXPECT_R) > ERROR_TOL) {
    362         psError(PS_ERR_UNKNOWN,true,"Precess r = %lg not equal to expected = %lg",
    363                 outputCoord->r,SPHERE_PRECESS_TP2_EXPECT_R);
    364         return 5;
    365     }
    366     if( fabs(outputCoord->d - SPHERE_PRECESS_TP2_EXPECT_D) > ERROR_TOL) {
    367         psError(PS_ERR_UNKNOWN,true,"Precess d = %lg not equal to expected = %lg",
    368                 outputCoord->d,SPHERE_PRECESS_TP2_EXPECT_D);
    369         return 6;
    370     }
    371     psFree(outputCoord);
    372 
    373     // Set input coordinate
    374     inputCoord->r = SPHERE_PRECESS_TP3_R;
    375     inputCoord->d = SPHERE_PRECESS_TP3_D;
    376     inputCoord->rErr = 0.0;
    377     inputCoord->dErr = 0.0;
    378 
    379     // Calculate precess
    380     outputCoord = psSpherePrecess(inputCoord, fromTime, toTime);
    381     // Verify return is not NULL
    382     if(outputCoord == NULL) {
    383         psError(PS_ERR_UNKNOWN,true,"Returned NULL not expected");
    384         return 7;
    385     }
    386     // Verify return with expected values
    387     if( fabs(outputCoord->r - SPHERE_PRECESS_TP3_EXPECT_R) > ERROR_TOL) {
    388         psError(PS_ERR_UNKNOWN,true,"Precess r = %lg not equal to expected = %lg",
    389                 outputCoord->r,SPHERE_PRECESS_TP3_EXPECT_R);
    390         return 8;
    391     }
    392     if( fabs(outputCoord->d - SPHERE_PRECESS_TP3_EXPECT_D) > ERROR_TOL) {
    393         psError(PS_ERR_UNKNOWN,true,"Precess d = %lg not equal to expected = %lg",
    394                 outputCoord->d,SPHERE_PRECESS_TP3_EXPECT_D);
    395         return 9;
    396     }
    397     psFree(outputCoord);
    398 
    399     // Invoke precess with invalid parameter
    400     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
    401     outputCoord = psSpherePrecess(inputCoord, fromTime, NULL);
    402     if(outputCoord != NULL) {
    403         psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid input");
    404         return 10;
    405     }
    406 
    407     // Invoke precess with invalid parameter
    408     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
    409     outputCoord = psSpherePrecess(inputCoord, NULL, toTime);
    410     if(outputCoord != NULL) {
    411         psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid input");
    412         return 11;
    413     }
    414 
    415     // Invoke precess with invalid parameter
    416     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error message");
    417     outputCoord = psSpherePrecess(NULL, fromTime, toTime);
    418     if(outputCoord != NULL) {
    419         psError(PS_ERR_UNKNOWN,true,"Did not return NULL with invalid input");
    420         return 12;
    421     }
    422 
    423     // Free objects
    424     psFree(fromTime);
    425     psFree(toTime);
    426     psFree(inputCoord);
    427 
    428     return 0;
    429 }
    430 
    431300psS32 testSphereOffset(void)
    432301{
  • trunk/psLib/test/astro/verified/tst_psSphereOps.stderr

    r5455 r6039  
    4545/***************************** TESTPOINT ******************************************\
    4646*             TestFile: tst_psSphereOps.c                                          *
    47 *            TestPoint: psSphereOps{psSphereRotPrecess()}                          *
    48 *             TestType: Positive                                                   *
    49 \**********************************************************************************/
    50 
    51 <DATE><TIME>|<HOST>|I|testSphereRotPrecess
    52     Following should generate an error message
    53 <DATE><TIME>|<HOST>|E|psSpherePrecess (FILE:LINENO)
    54     Unallowable operation: toTime is NULL.
    55 <DATE><TIME>|<HOST>|I|testSphereRotPrecess
    56     Following should generate an error message
    57 <DATE><TIME>|<HOST>|E|psSpherePrecess (FILE:LINENO)
    58     Unallowable operation: fromTime is NULL.
    59 <DATE><TIME>|<HOST>|I|testSphereRotPrecess
    60     Following should generate an error message
    61 <DATE><TIME>|<HOST>|E|psSpherePrecess (FILE:LINENO)
    62     Unallowable operation: coords is NULL.
    63 
    64 ---> TESTPOINT PASSED (psSphereOps{psSphereRotPrecess()} | tst_psSphereOps.c)
    65 
    66 /***************************** TESTPOINT ******************************************\
    67 *             TestFile: tst_psSphereOps.c                                          *
    6847*            TestPoint: psSphereOps{testSphereOffset()}                            *
    6948*             TestType: Positive                                                   *
  • trunk/psLib/test/astro/verified/tst_psTime_04.stderr

    r5083 r6039  
    8282---> TESTPOINT PASSED (psTime{psTimer} | tst_psTime_04.c)
    8383
     84/***************************** TESTPOINT ******************************************\
     85*             TestFile: tst_psTime_04.c                                            *
     86*            TestPoint: psTime{psTime_TideUT1Corr}                                 *
     87*             TestType: Positive                                                   *
     88\**********************************************************************************/
     89
     90<DATE><TIME>|<HOST>|E|psTime_TideUT1Corr (FILE:LINENO)
     91    Unallowable operation: time is NULL.
     92
     93---> TESTPOINT PASSED (psTime{psTime_TideUT1Corr} | tst_psTime_04.c)
     94
  • trunk/psLib/test/types/verified/tst_psMetadata_02.stderr

    r4547 r6039  
    44    Unallowable operation: name is NULL.
    55<DATE><TIME>|<HOST>|E|psMetadataItemAllocV (FILE:LINENO)
    6     Specified psMetadataType, -1, is not supported.
     6    Specified psDataType, -1, is not supported.
    77<DATE><TIME>|<HOST>|E|psMetadataAddItem (FILE:LINENO)
    88    Unallowable operation: md is NULL.
Note: See TracChangeset for help on using the changeset viewer.