IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 12, 2005, 9:12:01 AM (21 years ago)
Author:
desonia
Message:

massive restructuring of codebase.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astronomy/psCoord.h

    r4401 r4540  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-06-27 20:38:11 $
     12*  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-07-12 19:12:00 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2424#include "psList.h"
    2525#include "psFunctions.h"
    26 #include "psTime.h"
     26// N.B. inclusion of psTime.h was done to after the typedefs to handle cross-dependency of typedefs
    2727
    2828/// @addtogroup CoordinateTransform
     
    3838typedef struct
    3939{
    40     double x;                   ///< x position
    41     double y;                   ///< y position
    42     double xErr;                ///< Error in x position
    43     double yErr;                ///< Error in y position
     40    double x;                          ///< x position
     41    double y;                          ///< y position
     42    double xErr;                       ///< Error in x position
     43    double yErr;                       ///< Error in y position
    4444}
    4545psPlane;
     
    5252 *
    5353 */
    54 typedef struct psSphere
    55 {
    56     double r;                   ///< RA
    57     double d;                   ///< Dec
    58     double rErr;                ///< Error in RA
    59     double dErr;                ///< Error in Dec
     54typedef struct
     55{
     56    double r;                          ///< RA
     57    double d;                          ///< Dec
     58    double rErr;                       ///< Error in RA
     59    double dErr;                       ///< Error in Dec
    6060}
    6161psSphere;
     62
     63/** Cubic Coordinate System
     64 *
     65 */
     66typedef struct
     67{
     68    double x;                          ///< cos (DEC) cos (RA)
     69    double y;                          ///< cos (DEC) sic (RA)
     70    double z;                          ///< sin (DEC)
     71    double xErr;                       ///< Error in x
     72    double yErr;                       ///< Error in y
     73    double zErr;                       ///< Error in z
     74}
     75psCube;
     76
     77/** Spherical rotations represent coordinate transformation in 3-D, as well as
     78 *  the effects of precession and nutation.  The structure contains the
     79 *  elements of a quaternion to represent the spherical rotational.
     80 *
     81 */
     82typedef struct
     83{
     84    double q0;                         ///< first element of the quaternion
     85    double q1;                         ///< second element of the quaternion
     86    double q2;                         ///< third element of the quaternion
     87    double q3;                         ///< fourth element of the quaternion
     88}
     89psSphereRot;
    6290
    6391/** 2D Polynomial Transform
     
    94122}
    95123psPlaneDistort;
    96 
    97 /** Spherical Transform Definition
    98  *
    99  *  We need to be able to convert between ICRS, Galactic and Ecliptic
    100  *  coordinates, and potentially between arbitrary spherical coordinate
    101  *  systems. All of these basic spherical transformations represent rotations
    102  *  of the spherical coordinate reference. We specify a general
    103  *  transformation function which takes a structure, psSphereTransform,
    104  *  defining the transformation between two spherical coordinate systems
    105  *
    106  */
    107 typedef struct
    108 {
    109     double alphaP;                    ///< Longitude of the target system pole in the source system
    110     double cosDeltaP;                 ///< Cosine of target pole latitude in the source system
    111     double sinDeltaP;                 ///< Sine of target pole latitude in the source system
    112     double phiP;                      ///< Longitude of the ascending node in the target system
    113 }
    114 psSphereTransform;
    115124
    116125/** Projection type for projection/deprojection
     
    167176} psSphereOffsetUnit;
    168177
     178#include "psTime.h"
     179
    169180/** Allocates a psPlane
    170181 *
     
    178189 *  @return psSphere*     resulting sphere structure.
    179190 */
    180 
    181191psSphere* psSphereAlloc(void);
    182192
     193/** psSphereRot allocator which defines the rotation in terms of the coordinate
     194 *  of the pole and the rotation about that pole.
     195 *
     196 *  @return psSphereRot*       Newly allocated psSphereRot object
     197 */
     198psSphereRot* psSphereRotAlloc(
     199    double alphaP,
     200    double deltaP,
     201    double phiP
     202);
     203
     204/** psSphereRot allocator which defines the rotation from the elements of the
     205 *  quaternion.
     206 *
     207 *  @return psSphereRot*       Newly allocated psSphereRot object
     208 */
     209psSphereRot* psSphereRotQuat(
     210    double q0,
     211    double q1,
     212    double q2,
     213    double q3
     214);
    183215
    184216/** Allocates a psPlaneTransform transform.
     
    186218 *  @return psPlaneTransform*     resulting plane transform
    187219 */
    188 
    189220psPlaneTransform* psPlaneTransformAlloc(
    190221    int n1,                            ///< The order of the x term in the transform.
     
    227258);
    228259
    229 /** Allocator for psSphereTransform
    230  *
    231  *  @return psSphereTransform*         newly allocated struct
    232  */
    233 
    234 psSphereTransform* psSphereTransformAlloc(
    235     double alphaP,                      ///< north pole latitude
    236     double deltaP,                      ///< north pole longitude?
    237     double phiP                         ///< defines the longitude in the input system of the equatorial intersection between the two systems (e.g, the first point of Ares).
    238 );
    239 
    240 /** Applies the psSphereTransform transform for a specified coordinate
     260
     261/** Applies the psSphereRot transform for a specified coordinate
    241262 *
    242263 *  @return psSphere*      resulting coordinate based on transform
    243264 */
    244 psSphere* psSphereTransformApply(
     265psSphere* psSphereRotApply(
    245266    psSphere* out,                     ///< a psSphere to recycle.  If NULL, a new one is generated.
    246     const psSphereTransform* transform,///< the transform to apply
     267    const psSphereRot* transform,      ///< the transform to apply
    247268    const psSphere* coord              ///< the coordinate to apply the transform above.x
     269);
     270
     271/** Combines two rotations to produce a single rotation which is equivalent of
     272 *  applying the first rotation and then the second.
     273 *
     274 *  @return psSphereRot*               new psSphereRot transform
     275 */
     276psSphereRot* psSphereRotCombine(
     277    psSphereRot* out,
     278    const psSphereRot* rot1,
     279    const psSphereRot* rot2
     280);
     281
     282/** Inverts a psSphereRot's rotation.
     283 *
     284 *  @return psSphereRot*               The inverted psSphereRot
     285 */
     286psSphereRot* psSphereRotInvert(
     287    psSphereRot* rot                   ///< the psSphereRot to invert
    248288);
    249289
     
    251291 *  coordinate systems.
    252292 *
    253  *  @return psSphereTransform*     transform for ICRS->Ecliptic coordinate systems
    254  */
    255 psSphereTransform* psSphereTransformICRSToEcliptic(
    256     psTime *time                        ///< the time for which the resulting transform will be valid
     293 *  @return psSphereRot*               transform for ICRS->Ecliptic coordinate systems
     294 */
     295psSphereRot* psSphereRotICRSToEcliptic(
     296    const psTime* time                 ///< the time for which the resulting transform will be valid
    257297);
    258298
     
    260300 *  coordinate systems.
    261301 *
    262  *  @return psSphereTransform*     transform for Ecliptic->ICRS coordinate systems
    263  */
    264 psSphereTransform* psSphereTransformEclipticToICRS(
    265     psTime *time                        ///< the time for which the resulting transform will be valid
     302 *  @return psSphereRot*               transform for Ecliptic->ICRS coordinate systems
     303 */
     304psSphereRot* psSphereRotEclipticToICRS(
     305    const psTime* time                 ///< the time for which the resulting transform will be valid
    266306);
    267307
     
    270310 *
    271311 */
    272 psSphereTransform* psSphereTransformICRSToGalactic(void);
     312psSphereRot* psSphereRotICRSToGalactic(void);
    273313
    274314/** Creates the appropriate transform for converting from Galactic to ICRS
     
    276316 *
    277317 */
    278 psSphereTransform* psSphereTransformGalacticToICRS(void);
     318psSphereRot* psSphereRotGalacticToICRS(void);
    279319
    280320/** Allocates memory for a psProjection structure
Note: See TracChangeset for help on using the changeset viewer.