IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5447


Ignore:
Timestamp:
Oct 27, 2005, 10:38:19 AM (21 years ago)
Author:
drobbin
Message:

Updated EarthOrientation - Gravity Deflection and tests

Location:
trunk/psLib
Files:
3 edited

Legend:

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

    r5446 r5447  
    99*  @author Robert Daniel DeSonia, MHPCC
    1010*
    11 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2005-10-26 01:20:15 $
     11*  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2005-10-27 20:38:18 $
    1313*
    1414*  Copyright 2005 Maui High Performance Computing Center, University of Hawaii
     
    158158}
    159159
    160 psSphere *psAberration(psSphere *apparent, const psSphere *actual, const psSphere *direction, double speed)
    161 {
    162 
    163 
    164     return NULL;
    165 }
    166 
    167 psSphere *psGravityDeflection(psSphere *apparent, psSphere *actual, psSphere *sun)
     160psSphere *psAberration(psSphere *actual,
     161                       const psSphere *apparent,
     162                       const psSphere *direction,
     163                       double speed)
     164{
     165
     166
     167    return NULL;
     168}
     169
     170psSphere *psGravityDeflection(psSphere *actual,
     171                              psSphere *apparent,
     172                              psSphere *sun)
    168173{
    169174    PS_ASSERT_PTR_NON_NULL(apparent, NULL);
     
    223228
    224229
    225 double psEOC_ParallaxFactor(const psSphere *coords, const psTime *time)
     230double psEOC_ParallaxFactor(const psSphere *coords,
     231                            const psTime *time)
    226232{
    227233
     
    373379
    374380
    375 psEarthPole *psEOC_PrecessionCorr(const psTime *time, psTimeBulletin bulletin)
     381psEarthPole *psEOC_PrecessionCorr(const psTime *time,
     382                                  psTimeBulletin bulletin)
    376383{
    377384    return NULL;
     
    391398
    392399
    393 psEarthPole* psEOC_GetPolarMotion(const psTime *time, psTimeBulletin bulletin)
     400psEarthPole* psEOC_GetPolarMotion(const psTime *time,
     401                                  psTimeBulletin bulletin)
    394402{
    395403    return NULL;
  • trunk/psLib/src/astro/psEarthOrientation.h

    r5446 r5447  
    99*  @author Robert Daniel DeSonia, MHPCC
    1010*
    11 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2005-10-26 01:20:15 $
     11*  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2005-10-27 20:38:18 $
    1313*
    1414*  Copyright 2005 Maui High Performance Computing Center, University of Hawaii
     
    2222#include "psSphereOps.h"
    2323
    24 /**
    25  *
    26  *
    27  */
     24/** Structure for respresenting the Earth's pole at any moment or determine velocity
     25 *  at the pole.  This structure carries the polar coordinate information.       */
    2826typedef struct
    2927{
    30     double x;                          ///<
    31     double y;                          ///<
    32     double s;                          ///<
     28    double x;                          ///< X component of the earth's pole
     29    double y;                          ///< Y component of the earth's pole
     30    double s;                          ///< s component of the earth's pole
    3331}
    3432psEarthPole;
    3533
    36 /**
     34/** Method for spherical precession used to specify the level of detail used in
     35 *  calculation.
    3736 *
     37 *  @see psSpherePrecess
    3838 *
    3939 */
    4040typedef enum {
    41     PS_PRECESS_ROUGH,                  ///<
    42     PS_PRECESS_COMPLETE,               ///<
    43     PS_PRECESS_IAU2000A,               ///<
     41    PS_PRECESS_ROUGH,                  ///< roughest, lowest level of detail
     42    PS_PRECESS_COMPLETE,               ///< complete level of detail
     43    PS_PRECESS_IAU2000A,               ///< highest level of detail
    4444} psPrecessMethod;
    4545
    46 /**
     46/** Calculates the actual position of a star, given its apparent position and the
     47 *  velocity vector of the observer.
    4748 *
     49 *  The actual and apparent positions are represented as psSphere entries, as is the
     50 *  direction of motion.  The speed in that direction is given in units of the speed
     51 *  of light.  If the value of actual is NULL, a new psSphere is allocated, otherwise
     52 *  the point to actual is used for the result.
    4853 *
    49  *
     54 *  @return psSphere*:      the actual position of a star.
    5055 */
    5156psSphere *psAberration(
    52     psSphere *apparent,                ///<
    53     const psSphere *actual,            ///<
    54     const psSphere *direction,         ///<
    55     double speed                       ///<
     57    psSphere *actual,                  ///< actual position of star
     58    const psSphere *apparent,          ///< apparent position of star
     59    const psSphere *direction,         ///< direction of motion of observer
     60    double speed                       ///< speed of motion of observer
    5661);
    5762
     
    6671 */
    6772psSphere *psGravityDeflection(
     73    psSphere *actual,                  ///< actual position of star
    6874    psSphere *apparent,                ///< apparent position of star
    69     psSphere *actual,                  ///< actual position of star
    7075    psSphere *sun                      ///< position of the sun
    7176);
    7277
    73 /**
     78/** Calculate the parallax factor for the given position and time.
    7479 *
    75  *
     80 *  @return double:     the calculated parallax factor.
    7681 */
    7782double psEOC_ParallaxFactor(
    78     const psSphere *coords,            ///<
    79     const psTime *time                 ///<
     83    const psSphere *coords,            ///< specified position
     84    const psTime *time                 ///< specified time
    8085);
    8186
    82 /**
     87/** Calculates the components of the rotation between the CEO and GCRS frames, X, Y,
     88 *  and s, using the IAU2000A precession & nutation model.
    8389 *
     90 *  The input time may be represented in any format other than UT1.  This routine must
     91 *  give results identical to the IERS XYS2000A subroutine.
    8492 *
     93 *  @return psEarthPole*:       the calculated components of the rotation.
    8594 */
    8695psEarthPole *psEOC_PrecessionModel(
    87     const psTime *time                 ///<
     96    const psTime *time                 ///< specified time
    8897);
    8998
    90 /**
     99/** Provides interpolated corrections to the X and Y components of the polar
     100 *  coordinates from the tables provided by the IERS, just as it does for UT1 and
     101 *  polar motion.
    91102 *
    92  *
     103 *  @return psEarthPole*:       interpolated corrections to the precession components.
    93104 */
    94105psEarthPole *psEOC_PrecessionCorr(
    95     const psTime *time,                ///<
    96     psTimeBulletin bulletin            ///<
     106    const psTime *time,                ///< specified time
     107    psTimeBulletin bulletin            ///< IERS tables for polar coordinate components.
    97108);
    98109
    99 /**
     110/** Constructs the spherical rotation for transforming from CEO to GCRS coordinates.
    100111 *
     112 *  The resulting psSphereRot may be used to determine the rotation from CIP/CEO to
     113 *  GCRS.  This function must give results identical to the IERS BPN2000.
    101114 *
     115 *  @return psSphereRot*:       spherical rotation for CEO to GCRS transformation.
    102116 */
    103117psSphereRot *psSphereRot_CEOtoGCRS(
    104     const psEarthPole *pole            ///<
     118    const psEarthPole *pole            ///< input coordinates to transform
    105119);
    106120
    107 /**
     121/** Calculates the rotation of the Earth about the CIP.
    108122 *
    109  *
     123 *  @return psSphereRot*:       sphereical rotation
    110124 */
    111125psSphereRot *psSphereRot_TEOtoCEO(
    112     const psTime *time                 ///<
     126    const psTime *time                 ///< specified time
    113127);
    114128
    115 /**
     129/** Provides interpolated values of the polar motion components extracted from the
     130 *  IERS tables.
    116131 *
    117  *
     132 *  @return psEarthPole*:       interpolated polar motion components.
    118133 */
    119134psEarthPole *psEOC_GetPolarMotion(
    120     const psTime *time,                ///<
    121     psTimeBulletin bulletin            ///<
     135    const psTime *time,                ///< specified time
     136    psTimeBulletin bulletin            ///< IERS tables for polar coordinate components.
    122137);
    123138
    124 /**
     139/** Provides tidal corrections to the polar motion components using the Ray model
     140 *  of Simon et al.
    125141 *
    126  *
     142 *  @return psEarthPole*:       corrected polar motion components.
    127143 */
    128144psEarthPole *psEOC_PolarTideCorr(
    129     const psTime *time                 ///<
     145    const psTime *time                 ///< specified time
    130146);
    131147
    132 /**
     148/** Provides the additional corrections due to nutation terms with periods less than
     149 *  or equal to two days, as well as the correction to the s-prime component of polar
     150 *  motion.
    133151 *
    134  *
    135  *
     152 *  @return psEarthPole*:       corrected polar motion components.
    136153 */
    137154psEarthPole *psEOC_NutationCorr(
    138     psTime *time                       ///<
     155    psTime *time                       ///< specified time
    139156);
    140157
    141 /**
     158/** Converts the polar motion corrections to a spherical rotation.
    142159 *
     160 *  This function should give identical results to the IERS POM2000 subroutine.
    143161 *
    144  *
     162 *  @return psSphereRot*:       ITRS to TEO sphere rotation.
    145163 */
    146164psSphereRot *psSphereRot_ITRStoTEO(
    147     const psEarthPole *motion          ///<
     165    const psEarthPole *motion          ///< corrected polar motion components
    148166);
    149167
  • trunk/psLib/test/astro/tst_psEarthOrientation.c

    r5446 r5447  
    66*  @author d-Rob, MHPCC
    77*
    8 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2005-10-26 01:20:15 $
     8*  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2005-10-27 20:38:19 $
    1010*
    1111*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    5959    psSphere *apparent = psSphereAlloc();
    6060    psSphere *sun = psSphereAlloc();
     61    psSphere *empty = NULL;
    6162
    6263    sun->r = 0.2;
     
    6566    apparent->d = 0.2035;
    6667
    67     actual = psGravityDeflection(apparent, actual, sun);
     68    empty = psGravityDeflection(empty, actual, sun);
     69    if (empty != NULL) {
     70        psError(PS_ERR_BAD_PARAMETER_NULL, true,
     71                "psGravityDeflection Failed to return NULL for NULL apparent input sphere.\n");
     72        return 1;
     73    }
     74    empty = psGravityDeflection(empty, apparent, actual);
     75    if (empty != NULL) {
     76        psError(PS_ERR_BAD_PARAMETER_NULL, true,
     77                "psGravityDeflection Failed to return NULL for NULL sun input sphere.\n");
     78        return 2;
     79    }
     80
     81
     82    actual = psGravityDeflection(actual, apparent, sun);
    6883    psSphere *result = psSphereSetOffset(apparent, actual, PS_SPHERICAL, PS_RADIAN);
    6984    printf("\nApparent r,d = %.13g,%.13g    Actual r,d = %.13g, %.13g \n",
Note: See TracChangeset for help on using the changeset viewer.