IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 16, 2005, 5:59:05 PM (21 years ago)
Author:
drobbin
Message:

Implemented function NutationCorr and test. Has yet to be verified.

File:
1 edited

Legend:

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

    r5524 r5533  
    55*  @author d-Rob, MHPCC
    66*
    7 *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    8 *  @date $Date: 2005-11-16 20:52:23 $
     7*  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     8*  @date $Date: 2005-11-17 03:59:05 $
    99*
    1010*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    1414#include "pslib_strict.h"
    1515
    16 //static psS32 testEOCParallax(void);
    17 static psS32 testEOCInit_Final(void);
    1816static psS32 testAberration(void);
    1917static psS32 testGravityDeflect(void);
     
    2624
    2725testDescription tests[] = {
    28                               {testEOCInit_Final, 665, "psEOCInit_Final", 0, false},
    2926                              {testAberration, 666, "psAberration()", 0, false},
    3027                              {testGravityDeflect, 667, "psGravityDeflect()", 0, false},
    31                               //                              {testEOCParallax, 668, "psEOCParallax()", 0, false},
    3228                              {testEOCPrecession, 669, "psEOCPrecession()", 0, false},
    3329                              {testEOCPolar, 670, "psEOCPolar()", 0, false},
     
    5652
    5753    //    return ( ! runTestSuite( stderr, "psEarthOrientation", tests, argc, argv ) );
    58 }
    59 
    60 psS32 testEOCInit_Final(void)
    61 {
    62     return 0;
    6354}
    6455
     
    171162    psFree(UT1time);
    172163    //Check return values from valid precession input
    173 
    174164    pmodel = psEOC_PrecessionModel(time);
    175165    if ( pmodel == NULL ) {
     
    288278psS32 testEOCNutation(void)
    289279{
     280    psTime *in = psTimeAlloc(PS_TIME_TAI);
     281    in->sec = 1131579114;
     282    in->nsec = 498489000;
     283    in->leapsecond = false;
     284    psTime *empty = NULL;
     285    psEarthPole *nute = NULL;
     286
     287    //Return NULL for NULL input time.
     288    nute = psEOC_NutationCorr(empty);
     289    if (nute != NULL) {
     290        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     291                "psEOC_NutationCorr failed to return NULL for NULL input time.\n");
     292        return 1;
     293    }
     294    //Return NULL for UT1 time input
     295    psTime *UT1time = psTimeAlloc(PS_TIME_UT1);
     296    nute = psEOC_NutationCorr(UT1time);
     297    if (nute != NULL) {
     298        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     299                "psEOC_NutationCorr failed to return NULL for UT1 input time.\n");
     300        return 2;
     301    }
     302    psFree(UT1time);
     303    //Check return values from valid nutation time input
     304    nute = psEOC_PrecessionModel(in);
     305    if ( nute == NULL ) {
     306        psError(PS_ERR_BAD_PARAMETER_NULL, false,
     307                "psEOC_NutationCorr returned NULL for valid input.\n");
     308        return 3;
     309    } else {
     310        printf("Nutation Correction output = x,y,s = %.8g, %.8g, %.8g\n\n",
     311               nute->x, nute->y, nute->s);
     312    }
     313    psFree(nute);
     314    psFree(in);
     315
     316    if (!p_psEOCFinalize() ) {
     317        psError(PS_ERR_BAD_PARAMETER_VALUE, false, "EOC failed finalization!\n");
     318        return 12;
     319    }
    290320
    291321    return 0;
Note: See TracChangeset for help on using the changeset viewer.