IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5306


Ignore:
Timestamp:
Oct 13, 2005, 10:23:57 AM (21 years ago)
Author:
drobbin
Message:

Fixed psSphereRotAlloc and test. Correctly verified calculations.

Location:
trunk/psLib
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/pslib.kdevelop

    r5231 r5306  
    4949        <envvar value="1" name="WANT_AUTOMAKE_1_6" />
    5050      </envvars>
    51       <abortonerror>false</abortonerror>
    52       <numberofjobs>3</numberofjobs>
    53       <dontact>false</dontact>
    54       <makebin/>
    55       <prio>0</prio>
    5651    </make>
    5752  </kdevautoproject>
  • trunk/psLib/src/astro/psEarthOrientation.h

    r5012 r5306  
    88*  @author Robert Daniel DeSonia, MHPCC
    99*
    10 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2005-09-13 00:50:04 $
     10*  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2005-10-13 20:23:57 $
    1212*
    1313*  Copyright 2005 Maui High Performance Computing Center, University of Hawaii
     
    2121#include "psSphereOps.h"
    2222
     23/**
     24 *
     25 *
     26 */
    2327typedef struct
    2428{
    25     double x;
    26     double y;
    27     double s;
     29    double x;                          ///<
     30    double y;                          ///<
     31    double s;                          ///<
    2832}
    2933psEarthPole;
    3034
     35/**
     36 *
     37 *
     38 */
    3139typedef enum {
    32     PS_PRECESS_ROUGH,
    33     PS_PRECESS_COMPLETE,
    34     PS_PRECESS_IAU2000A,
     40    PS_PRECESS_ROUGH,                  ///<
     41    PS_PRECESS_COMPLETE,               ///<
     42    PS_PRECESS_IAU2000A,               ///<
    3543} psPrecessMethod;
    3644
     45/**
     46 *
     47 *
     48 *
     49 */
    3750psSphere *psAberration(
    38     psSphere *apparent,
    39     const psSphere *actual,
    40     const psSphere *direction,
    41     double speed
     51    psSphere *apparent,                ///<
     52    const psSphere *actual,            ///<
     53    const psSphere *direction,         ///<
     54    double speed                       ///<
    4255);
    4356
     57/**
     58 *
     59 *
     60 *
     61 */
    4462psSphere *psGravityDeflection(
    45     psSphere *apparent,
    46     psSphere *actual,
    47     psSphere *sun
     63    psSphere *apparent,                ///<
     64    psSphere *actual,                  ///<
     65    psSphere *sun                      ///<
    4866);
    4967
     68/**
     69 *
     70 *
     71 */
    5072double psEOC_ParallaxFactor(
    51     const psSphere *coords,
    52     const psTime *time
     73    const psSphere *coords,            ///<
     74    const psTime *time                 ///<
    5375);
    5476
     77/**
     78 *
     79 *
     80 */
    5581psEarthPole *psEOC_PrecessionModel(
    56     const psTime *time
     82    const psTime *time                 ///<
    5783);
    5884
     85/**
     86 *
     87 *
     88 */
    5989psEarthPole *psEOC_PrecessionCorr(
    60     const psTime *time,
    61     psTimeBulletin bulletin
     90    const psTime *time,                ///<
     91    psTimeBulletin bulletin            ///<
    6292);
    6393
     94/**
     95 *
     96 *
     97 */
    6498psSphereRot *psSphereRot_CEOtoGCRS(
    65     const psEarthPole *pole
     99    const psEarthPole *pole            ///<
    66100);
    67101
     102/**
     103 *
     104 *
     105 */
    68106psSphereRot *psSphereRot_TEOtoCEO(
    69     const psTime *time
     107    const psTime *time                 ///<
    70108);
    71109
     110/**
     111 *
     112 *
     113 */
    72114psEarthPole *psEOC_GetPolarMotion(
    73     const psTime *time,
    74     psTimeBulletin bulletin
     115    const psTime *time,                ///<
     116    psTimeBulletin bulletin            ///<
    75117);
    76118
     119/**
     120 *
     121 *
     122 */
    77123psEarthPole *psEOC_PolarTideCorr(
    78     const psTime *time
     124    const psTime *time                 ///<
    79125);
    80126
     127/**
     128 *
     129 *
     130 *
     131 */
    81132psEarthPole *psEOC_NutationCorr(
    82     psTime *time
     133    psTime *time                       ///<
    83134);
    84135
     136/**
     137 *
     138 *
     139 *
     140 */
    85141psSphereRot *psSphereRot_ITRStoTEO(
    86     const psEarthPole *motion
     142    const psEarthPole *motion          ///<
    87143);
    88144
  • trunk/psLib/src/astro/psSphereOps.c

    r4898 r5306  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-08-30 01:14:10 $
     9 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-10-13 20:23:57 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    153153
    154154    // following came from ADD
    155     out->q0 = b3*a0 + b2*a1 - b1*a2 + b0*a3;
    156     out->q1 = b3*a1 - b2*a0 + b1*a3 + b0*a2;
    157     out->q2 = b3*a2 + b2*a3 + b1*a0 - b0*a1;
    158     out->q3 = b3*a3 - b3*a2 - b1*a1 - b0*a0;
     155    //    out->q0 = b3*a0 + b2*a1 - b1*a2 + b0*a3;
     156    //    out->q1 = b3*a1 - b2*a0 + b1*a3 + b0*a2;
     157    //    out->q2 = b3*a2 + b2*a3 + b1*a0 - b0*a1;
     158    out->q0 = a3*b0 + a0*b3 + a1*b2 - a2*b1;
     159    out->q1 = a3*b1 - a0*b2 + a1*b3 + a2*b0;
     160    out->q2 = a3*b2 + a0*b1 - a1*b0 + a2*b3;
     161
     162    out->q3 = b3*a3 - b2*a2 - b1*a1 - b0*a0;
    159163
    160164    return out;
  • trunk/psLib/src/astro/psSphereOps.h

    r4937 r5306  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-08-31 22:28:35 $
     9 *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-10-13 20:23:57 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7373);
    7474
     75psSphereRot* psSphereRotAlloc2(
     76    double alphaP,                      ///< north pole latitude
     77    double deltaP,                      ///< north pole longitude
     78    double phiP                         ///< defines the longitude in the input system of the equatorial intersection between the two systems (e.g, the first point of Ares).
     79);
     80
     81psSphereRot* psSphereRotAlloc3(
     82    double alphaP,                      ///< north pole latitude
     83    double deltaP,                      ///< north pole longitude
     84    double phiP                         ///< defines the longitude in the input system of the equatorial intersection between the two systems (e.g, the first point of Ares).
     85);
     86
     87psSphereRot* psSphereRotAlloc4(
     88    double alphaP,                      ///< north pole latitude
     89    double deltaP,                      ///< north pole longitude
     90    double phiP                         ///< defines the longitude in the input system of the equatorial intersection between the two systems (e.g, the first point of Ares).
     91);
     92
     93psSphereRot* psSphereRotAlloc5(
     94    double alphaP,                      ///< north pole latitude
     95    double deltaP,                      ///< north pole longitude
     96    double phiP                         ///< defines the longitude in the input system of the equatorial intersection between the two systems (e.g, the first point of Ares).
     97);
     98
     99psSphereRot* psSphereRotAlloc6(
     100    double alphaP,                      ///< north pole latitude
     101    double deltaP,                      ///< north pole longitude
     102    double phiP                         ///< defines the longitude in the input system of the equatorial intersection between the two systems (e.g, the first point of Ares).
     103);
     104
     105psSphereRot* psSphereRotAlloc7(
     106    double alphaP,                      ///< north pole latitude
     107    double deltaP,                      ///< north pole longitude
     108    double phiP                         ///< defines the longitude in the input system of the equatorial intersection between the two systems (e.g, the first point of Ares).
     109);
     110
     111psSphereRot* psSphereRotAlloc8(
     112    double alphaP,                      ///< north pole latitude
     113    double deltaP,                      ///< north pole longitude
     114    double phiP                         ///< defines the longitude in the input system of the equatorial intersection between the two systems (e.g, the first point of Ares).
     115);
     116
    75117
    76118/** Checks the type of a particular pointer.
  • trunk/psLib/test/astro/tst_psEarthOrientation.c

    r5235 r5306  
    1 /** @file  tst_psCoord.c
     1/** @file  tst_psEarthOrientation.c
    22*
    33*  @brief The code will go on ...
     
    66*  @author d-Rob, MHPCC
    77*
    8 *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2005-10-07 21:27:50 $
     8*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2005-10-13 20:23:57 $
    1010*
    1111*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
  • trunk/psLib/test/astro/tst_psSphereOps.c

    r5254 r5306  
    66*  @author GLG, MHPCC
    77*
    8 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2005-10-08 03:51:20 $
     8*  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2005-10-13 20:23:57 $
    1010*
    1111*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4848#define ERROR_TOL   0.0001
    4949
    50 #define ALPHA_P 0.5 * M_PI
    51 #define DELTA_P 1.0 * M_PI
    52 #define PHI_P 1.5 * M_PI
     50#define ALPHA_P M_PI/6
     51#define DELTA_P M_PI/4
     52#define PHI_P M_PI/2
    5353
    5454psS32 testSphereRotAlloc( void )
     
    6262        return 1;
    6363    }
    64     // Verify sin member is updated
    65     double vx = cos(DELTA_P)*cos(ALPHA_P);
    66     double vy = cos(DELTA_P)*sin(ALPHA_P);
    67     double vz = sin(DELTA_P);
    68     double q0 = vx * sin(PHI_P/2.0);
    69     double q1 = vy * sin(PHI_P/2.0);
    70     double q2 = vz * sin(PHI_P/2.0);
    71     double q3 = cos(PHI_P/2.0);
    72     double len = sqrt(q0*q0 + q1*q1 + q2*q2 + q3*q3);
    73     printf("\nvz = %lf\n", vz);
    74     q0 = q0/len;
    75     q1 = q1/len;
    76     q2 = q2/len;
    77     q3 = q3/len;
    78 
     64
     65    double a0 = (ALPHA_P - PHI_P)/2.0;
     66    double a1 = (ALPHA_P - PHI_P)/2.0;
     67    double a2 = (ALPHA_P + PHI_P)/2.0;
     68    double a3 = (ALPHA_P + PHI_P)/2.0;
     69
     70    double q3 = cos(a3)*cos(DELTA_P/2);
     71    double q0 = sin(a0)*sin(DELTA_P/2);
     72    double q1 = cos(a1)*sin(DELTA_P/2);
     73    double q2 = sin(a2)*cos(DELTA_P/2);
     74
     75    printf("\n q0=%lf, q1=%lf, q2=%lf, q3=%lf,\n", q0, q1, q2, q3);
     76    printf("myq0=%lf, myq1=%lf, myq2=%lf, myq3=%lf\n", myST->q0, myST->q1, myST->q2, myST->q3);
    7977    if (FLT_EPSILON < fabs(q0 - myST->q0)) {
    80         psError(PS_ERR_UNKNOWN,true,"myST->q0 is %f, should be %f\n", myST->q0, q0);
     78        psError(PS_ERR_UNKNOWN,true,"myST->q0 is %lf, should be %lf\n", myST->q0, q0);
    8179        return 2;
    8280    }
  • trunk/psLib/test/astro/verified/tst_psSphereOps.stdout

    r5235 r5306  
     1
     2 q0=-0.191342, q1=0.331414, q2=0.800103, q3=0.461940,
     3myq0=-0.191342, myq1=0.331414, myq2=0.800103, myq3=0.461940
Note: See TracChangeset for help on using the changeset viewer.