IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 7, 2004, 4:28:10 PM (22 years ago)
Author:
Paul Price
Message:

Distinguished between coordinates in a plane and coordinates on the surface of a sphere. psCoord --> psPlaneCoord and psSphereCoord.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/archive/pslib/include/psPosition.h

    r396 r623  
    99/** Structures *********************/
    1010
    11 /** A point in 2-D space, with errors.
    12  */
    13 typedef union {
    14     struct {
    15         double x;                       ///< x position
    16         double y;                       ///< y position
    17         double xErr;                    ///< Error in x position
    18         double yErr;                    ///< Error in y position
    19     } xy;
    20     struct {
    21         double r;                       ///< RA
    22         double d;                       ///< Dec
    23         double rErr;                    ///< Error in RA
    24         double dErr;                    ///< Error in Dec
    25     } rd;
    26 } psCoord;
     11/** A point in 2-D space, with errors. */
     12typedef struct {
     13    double x;                           ///< x position
     14    double y;                           ///< y position
     15    double xErr;                        ///< Error in x position
     16    double yErr;                        ///< Error in y position
     17} psPlaneCoord;
     18
     19/** A point on the surface of a sphere, with errors */
     20typedef struct {
     21    double r;                           ///< RA
     22    double d;                           ///< Dec
     23    double rErr;                        ///< Error in RA
     24    double dErr;                        ///< Error in Dec
     25} psSphereCoord;
    2726
    2827/** A polynomial transformation between coordinate frames.  This may be a linear relationship, or may
     
    3231    psDPolynomial2D *x;
    3332    psDPolynomial2D *y;
    34 } psCoordXform;
     33} psPlaneCoordXform;
    3534
    3635/** The optical distortion terms.  The lowest two terms are the x and y axis of the target system.  The higher
     
    4039    psDPolynomial4D *x;
    4140    psDPolynomial4D *y;
    42 } psDistortion;
     41} psPlaneDistortion;
    4342
    4443/** Functions **************************************************************/
     
    4847
    4948/** apply the coordinate transformation to the given coordinate */
    50 psCoord *psCoordXformApply (psCoord *out, ///< Output coordinates, or NULL
    51                             const psCoordXform *frame, ///< coordinate transformation
    52                             const psCoord *coords ///< input coordiate
     49psPlaneCoord *psPlaneCoordXformApply (psPlaneCoord *out, ///< Output coordinates, or NULL
     50                                      const psPlaneCoordXform *frame, ///< coordinate transformation
     51                                      const psPlaneCoord *coords ///< input coordiate
    5352    );
    5453
    5554/** apply the optical distortion to the given coordinate, magnitude, color */
    56 psCoord *psDistortionApply (psCoord *out, ///< Output coordinates, or NULL
    57                             const psDistortion *pattern, ///< optical distortion pattern
    58                             const psCoord *coords, ///< input coordinate
    59                             float mag,  ///< magnitude of object
    60                             float color ///< color of object
     55psPlaneCoord *psPlaneDistortionApply (psPlaneCoord *out, ///< Output coordinates, or NULL
     56                                      const psPlaneDistortion *pattern, ///< optical distortion pattern
     57                                      const psPlaneCoord *coords, ///< input coordinate
     58                                      float mag, ///< magnitude of object
     59                                      float color ///< color of object
    6160    );
    6261
    6362/** Get offset (RA,Dec) on the sky between two positions position1 and position2 may not be identical */
    64 psCoord *
    65 psGetOffset(const psCoord *restrict position1, ///< Position 1
    66             const psCoord *restrict position2, ///< Position 2
     63psSphereCoord *
     64psGetOffset(const psSphereCoord *restrict position1, ///< Position 1
     65            const psSphereCoord *restrict position2, ///< Position 2
    6766            const char *type            ///< Type of offset: Linear, Spherical/Arcsec, Spherical/Degreees etc
    6867    );
    6968
    7069/** Apply an offset to a position */
    71 psCoord *
    72 psApplyOffset(const psCoord *restrict position, ///< Position
    73               const psCoord *restrict offset, ///< Offset
     70psSphereCoord *
     71psApplyOffset(const psSphereCoord *restrict position, ///< Position
     72              const psSphereCoord *restrict offset, ///< Offset
    7473              const char *type          ///< Type of offset: Linear, Spherical/Arcsec, Spherical/Degreees etc
    7574    );
     
    7877
    7978/** Get Sun Position */
    80 psCoord *
     79psSphereCoord *
    8180psGetSunPos(float mjd                   ///< MJD to get position for
    8281    );
    8382
    8483/** Get Moon position */
    85 psCoord *
     84psSphereCoord *
    8685psGetMoonPos(float mjd,                 ///< MJD to get position for
    8786             double latitude,           ///< Latitude for apparent position
     
    9594
    9695/** Get Planet positions */
    97 psCoord *
     96psSphereCoord *
    9897psGetSolarSystemPos(const char *solarSystemObject, ///< Named S.S. object
    9998                    float mjd           ///< MJD to get position for
     
    105104
    106105/** Convert ICRS to Ecliptic */
    107 psCoord *
    108 psCoordinatesItoE(const psCoord *restrict coordinates ///< ICRS coordinates to convert
     106psSphereCoord *
     107psCoordinatesItoE(const psSphereCoord *restrict coordinates ///< ICRS coordinates to convert
    109108    );
    110109
    111110/** Convert Ecliptic to ICRS */
    112 psCoord *
    113 psCoordinatesEtoI(const psCoord *restrict coordinates ///< Ecliptic coordinates to convert
     111psSphereCoord *
     112psCoordinatesEtoI(const psSphereCoord *restrict coordinates ///< Ecliptic coordinates to convert
    114113    );
    115114
    116115/** Convert ICRS to Galactic */
    117 psCoord *
    118 psCoordinatesItoG(const psCoord *restrict coordinates ///< ICRS coordinates to convert
     116psSphereCoord *
     117psCoordinatesItoG(const psSphereCoord *restrict coordinates ///< ICRS coordinates to convert
    119118    );
    120119
    121120/** Convert Galactic to ICRS */
    122 psCoord *
    123 psCoordinatesGtoI(const psCoord *restrict coordinates ///< Galactic coordinates to convert
     121psSphereCoord *
     122psCoordinatesGtoI(const psSphereCoord *restrict coordinates ///< Galactic coordinates to convert
    124123    );
    125124
Note: See TracChangeset for help on using the changeset viewer.