IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5515


Ignore:
Timestamp:
Nov 14, 2005, 6:03:36 PM (21 years ago)
Author:
drobbin
Message:

edited VectorsReadFromFile per bug 577 and added Precession Model to EOC testing but fails to init correct tables

Location:
trunk/psLib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/types/psLookupTable.c

    r4898 r5515  
    77*  @author Ross Harman, MHPCC
    88*
    9 *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
    10 *  @date $Date: 2005-08-30 01:14:13 $
     9*  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
     10*  @date $Date: 2005-11-15 04:03:36 $
    1111*
    1212*  Copyright 2004-2005 Maui High Performance Computing Center, Univ. of Hawaii
     
    152152
    153153    value = (psS32)strtol(inString, &end, 0);
    154     if(*end != '\0') {
     154    if(*end != '\0' && !isspace(*end)) {
    155155        *status = PS_PARSE_ERROR_VALUE;
    156156    } else if(inString==end) {
     
    169169
    170170    value = (psS64)strtoll(inString, &end, 0);
    171     if(*end != '\0') {
     171    if(*end != '\0' && !isspace(*end)) {
    172172        *status = PS_PARSE_ERROR_VALUE;
    173173    } else if(inString==end) {
     
    186186
    187187    value = (psF32)strtof(inString, &end);
    188     if(*end != '\0') {
     188    if(*end != '\0' && !isspace(*end)) {
    189189        *status = PS_PARSE_ERROR_VALUE;
    190190    } else if(inString==end) {
     
    203203
    204204    value = (psF64)strtod(inString, &end);
    205     if(*end != '\0') {
     205    if(*end != '\0' && !isspace(*end)) {
    206206        *status = PS_PARSE_ERROR_VALUE;
    207207    } else if(inString==end) {
     
    444444    // Parse the format string to determine how many vectors
    445445    // and whether the format string is valid
    446     while((strValue=getToken((char**)&tempFormat," ",&parseStatus))) {
     446    while((strValue=getToken((char**)&tempFormat,"    ",&parseStatus))) {
    447447
    448448        // Check for %d format sub string
     
    511511
    512512                    // Loop through format and line strings to get values in text table file
    513                     while((strValue=getToken((char**)&tempFormat," ",&parseStatus)) &&
    514                             (strNum=getToken((char**)&linePtr," ",&parseStatus)) ) {
     513                    while((strValue=getToken((char**)&tempFormat,"    ",&parseStatus)) &&
     514                            (strNum=getToken((char**)&linePtr,"    ",&parseStatus)) ) {
    515515
    516516                        // Set column vector
  • trunk/psLib/test/astro/tst_psEarthOrientation.c

    r5507 r5515  
    55*  @author d-Rob, MHPCC
    66*
    7 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    8 *  @date $Date: 2005-11-12 03:37:34 $
     7*  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     8*  @date $Date: 2005-11-15 04:03:36 $
    99*
    1010*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    1515
    1616//static psS32 testEOCParallax(void);
     17static psS32 testEOCInit_Final(void);
    1718static psS32 testAberration(void);
    1819static psS32 testGravityDeflect(void);
     
    2526
    2627testDescription tests[] = {
     28                              {testEOCInit_Final, 665, "psEOCInit_Final", 0, false},
    2729                              {testAberration, 666, "psAberration()", 0, false},
    2830                              {testGravityDeflect, 667, "psGravityDeflect()", 0, false},
     
    5658}
    5759
     60psS32 testEOCInit_Final(void)
     61{
     62    return 0;
     63}
     64
    5865psS32 testAberration(void)
    5966{
     
    145152    time->leapsecond = false;
    146153
     154    //Tests for Precession Model //
     155    psEarthPole *pmodel = NULL;
     156    //Return NULL for NULL time input
     157    pmodel = psEOC_PrecessionModel(empty);
     158    if (pmodel != NULL) {
     159        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     160                "psEOC_PrecessionModel failed to return NULL for NULL time input.\n");
     161        return 1;
     162    }
     163    //Return NULL for UT1 time input
     164    psTime *UT1time = psTimeAlloc(PS_TIME_UT1);
     165    pmodel = psEOC_PrecessionModel(UT1time);
     166    if (pmodel != NULL) {
     167        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     168                "psEOC_PrecessionModel failed to return NULL for UT1 input time.\n");
     169        return 2;
     170    }
     171    psFree(UT1time);
     172    //Check return values from valid precession input
     173    pmodel = psEOC_PrecessionModel(time);
     174    if ( pmodel == NULL ) {
     175        psError(PS_ERR_BAD_PARAMETER_NULL, false,
     176                "psEOC_PrecessionModel returned NULL for valid input.\n");
     177        return 3;
     178    } else {
     179        printf("Precession Model output = x,y,s = %.8g, %.8g, %.8g\n",
     180               pmodel->x, pmodel->y, pmodel->s);
     181    }
     182    psFree(pmodel);
     183
    147184
    148185    //Tests for Precession Correction function//
Note: See TracChangeset for help on using the changeset viewer.