IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 20, 2004, 6:12:37 PM (22 years ago)
Author:
eugene
Message:

substantial API changes based on change to PSLib SDRS

File:
1 edited

Legend:

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

    r710 r753  
    88
    99/** Structures *********************/
     10
     11/** projection types */
     12typedef enum {                          ///< type of val is:
     13    PS_PROJ_TAN,                        ///< Tangent projection
     14    PS_PROJ_SIN,                        ///< Sine projection
     15    PS_PROJ_AIT,                        ///< Aitoff projection
     16    PS_PROJ_PAR,                        ///< Par projection
     17    PS_PROJ_GLS,                        ///< GLS projection
     18    PS_PROJ_NTYPE                       ///< Number of types; must be last
     19} psProjectionType;
    1020
    1121/** A point in 2-D space, with errors. */
     
    1525    double xErr;                        ///< Error in x position
    1626    double yErr;                        ///< Error in y position
    17 } psPlaneCoord;
     27} psPlane;
    1828
    1929/** A point on the surface of a sphere, with errors */
     
    2333    double rErr;                        ///< Error in RA
    2434    double dErr;                        ///< Error in Dec
    25 } psSphereCoord;
     35} psSphere;
    2636
    2737/** A polynomial transformation between coordinate frames.  This may be a linear relationship, or may
     
    3141    psDPolynomial2D *x;
    3242    psDPolynomial2D *y;
    33 } psPlaneCoordXform;
     43} psPlaneTransform;
    3444
    3545/** The optical distortion terms.  The lowest two terms are the x and y axis of the target system.  The higher
     
    3949    psDPolynomial4D *x;
    4050    psDPolynomial4D *y;
    41 } psPlaneDistortion;
     51} psPlaneDistort;
     52
     53/** General spherical transformation */
     54typedef struct {
     55  double sinNPlon;                       ///< sin of North Pole longitude
     56  double cosNPlon;                       ///< cos of North Pole longitude
     57  double sinNPlat;                       ///< sin of North Pole lattitude
     58  double cosNPlat;                       ///< cos of North Pole lattitude
     59  double sinZP;                          ///< sin of First PT of Ares lon
     60  double cosZP;                          ///< cos of First PT of Ares lon
     61} psSphereTransform;
     62
     63/** Spherical <-> Linear projections */
     64typedef struct {
     65    double R, D;                         ///< coordinates of projection center
     66    double Xs, Ys;                       ///< plate-scale in X and Y directions
     67    psProjectionType type;               ///< projection type
     68} psProjection;
    4269
    4370/** Functions **************************************************************/
     
    4774
    4875/** apply the coordinate transformation to the given coordinate */
    49 psPlaneCoord *psPlaneCoordXformApply (psPlaneCoord *out, ///< Output coordinates, or NULL
    50                                       const psPlaneCoordXform *frame, ///< coordinate transformation
    51                                       const psPlaneCoord *coords ///< input coordiate
    52     );
     76psPlane *psPlaneTransformApply (psPlane *out, ///< Output coordinates, or NULL
     77                                const psPlaneTransform *frame, ///< coordinate transformation
     78                                const psPlane *coords) ///< input coordiate
     79;
    5380
    5481/** apply the optical distortion to the given coordinate, magnitude, color */
    55 psPlaneCoord *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
    60     );
     82psPlane *psPlaneDistortApply (psPlane *out, ///< Output coordinates, or NULL
     83                              const psPlaneDistort *pattern, ///< optical distortion pattern
     84                              const psPlane *coords, ///< input coordinate
     85                              float mag, ///< magnitude of object
     86                              float color) ///< color of object
     87;
     88
     89/* Celestial coordinate conversions */
     90
     91/** Constructor */
     92psSphereTransform *
     93psSphereTransformAlloc(double pole1, ///< First location of pole
     94                       double pole2, ///< Second location of pole
     95                       double rotation) ///< Rotation between systems
     96;
     97
     98/** Destructor */
     99void psSphereTransformFree(psSphereTransform *trans) ///< Transform to destroy
     100;
     101
     102/** Apply general spherical transformation */
     103psSphere *
     104psSphereTransformApply(const psSphere *coord, ///< Coordinates to convert
     105                       const psSphereTransform *sys) ///< System to use to convert
     106;
     107
     108/** Return transformation structure to convert ICRS to Ecliptic */
     109psSphereTransform *psSphereTransformItoE(void);
     110
     111/** Return transformation structure to convert Ecliptic to ICRS */
     112psSphereTransform *psSphereTransformEtoI(void);
     113
     114/** Return transformation structure to convert ICRS to Galactic */
     115psSphereTransform *psSphereTransformItoG(void);
     116
     117/** Return transformation structure to convert Galactic to ICRS */
     118psSphereTransform *psSphereTransformGtoI(void);
     119
     120/***********************************************************************************************************/
     121
     122
     123/** Project spherical system onto a plane */
     124psPlane *
     125psCoordProject(const psSphere *coord, ///< Spherical coordinates to project
     126               const psProjection *projection)  ///< Projection to use
     127;
     128
     129/** Deproject plane onto spherical system */
     130psSphere *
     131psCoordDeproject(const psPlane *coord, ///< Plane coordinates to deproject
     132                 const psProjection *projection)        ///< Projection to use
     133;
    61134
    62135/** Get offset (RA,Dec) on the sky between two positions position1 and position2 may not be identical */
    63 psSphereCoord *
    64 psSphereCoordGetOffset(const psSphereCoord *restrict position1, ///< Position 1
    65                        const psSphereCoord *restrict position2, ///< Position 2
    66                        const char *type         ///< Type of offset: Linear, Spherical/Arcsec,
    67                                                 ///< Spherical/Degreees etc
    68     );
     136psSphere *
     137psSphereGetOffset(const psSphere *restrict position1, ///< Position 1
     138                  const psSphere *restrict position2, ///< Position 2
     139                  const char *type)     ///< Type of offset: Spherical/Arcsec, Spherical/Degreees etc
     140;
    69141
    70142/** Apply an offset to a position */
    71 psSphereCoord *
    72 psSphereCoordApplyOffset(const psSphereCoord *restrict position, ///< Position
    73                          const psSphereCoord *restrict offset, ///< Offset
    74                          const char *type               ///< Type of offset: Linear, Spherical/Arcsec,
    75                                                         ///< Spherical/Degreees etc
    76     );
     143psSphere *
     144psSphereApplyOffset(const psSphere *restrict position, ///< Position
     145                    const psSphere *restrict offset, ///< Offset
     146                    const char *type)   ///< Type of offset: Spherical/Arcsec, Spherical/Degreees etc
     147;
    77148
    78149/* Positions of well-known objects */
    79150
    80151/** Get Sun Position */
    81 psSphereCoord *
    82 psGetSunPos(float mjd                   ///< MJD to get position for
    83     );
    84 
    85 /** Get Moon position */
    86 psSphereCoord *
    87 psGetMoonPos(float mjd,                 ///< MJD to get position for
    88              double latitude,           ///< Latitude for apparent position
    89              double longitude           ///< Longitude for apparent position
    90     );
     152psSphere *
     153psSunGetPos(psTime time)                ///< MJD to get position for
     154;
     155
     156/** Get Sun Rise time */
     157psSphere *
     158psSunGetRise(psTime *twi15,             ///< corresponding 15 deg twilight
     159             psTime *twi18,             ///< corresponding 18 deg twilight
     160             psTime time)               ///< get rise closest to this time
     161;
     162
     163/** Get Sun Set time */
     164psSphere *
     165psSunGetSet(psTime *twi15,              ///< corresponding 15 deg twilight
     166            psTime *twi18,              ///< corresponding 18 deg twilight
     167            psTime time)                ///< get set closest to this time
     168;
     169
     170/** Get Length of closest night */
     171float
     172psNightLength(psTime time)              ///< MJD to get position for
     173;
     174
     175/** Get Moon Position */
     176psSphere *
     177psMoonGetPos(psTime time)               ///< MJD to get position for
     178;
     179
     180/** Get Moon Rise time */
     181psSphere *
     182psMoonGetRise(psTime time)              ///< get rise closest to this time
     183;
     184
     185/** Get Moon Set time */
     186psSphere *
     187psMoonGetSet(psTime time)               ///< get set closest to this time
     188;
    91189
    92190/** Get Moon phase */
    93191float
    94 psGetMoonPhase(float mjd                ///< MJD to get phase for
    95     );
     192psMoonGetPhase(psTime time)             ///< MJD to get phase for
     193;
    96194
    97195/** Get Planet positions */
    98 psSphereCoord *
    99 psGetSolarSystemPos(const char *solarSystemObject, ///< Named S.S. object
    100                     float mjd           ///< MJD to get position for
    101     );
     196psSphere *
     197psPlanetGetPos(const char *solarSystemObject, ///< Named S.S. object
     198               psTime time)             ///< MJD to get position for
     199;
    102200
    103201/***********************************************************************************************************/
    104202
    105 /* Celestial coordinate conversions */
    106 
    107 /** General spherical transformation */
    108 typedef struct {
    109     double sin1, sin2, sin3, cos1, cos2, cos3; ///< Sines and cosines for transformation
    110 } psSphereCoordTransformation;
    111 
    112 /** Constructor */
    113 psSphereCoordTransformation *
    114 psSphereCoordTransformationAlloc(double pole1, ///< First location of pole
    115                                  double pole2, ///< Second location of pole
    116                                  double rotation ///< Rotation between systems
    117     );
    118 
    119 /** Destructor */
    120 void psSphereCoordTranformationFree(psSphereCoordTransformation *trans ///< Transformation to destroy
    121     );
    122 
    123 /** Apply general spherical transformation */
    124 psSphereCoord *
    125 psSphereCoordTransform(const psSphereCoord *coord, ///< Coordinates to convert
    126                        const psSphereCoordTransformation *sys ///< System to use to convert
    127     );
    128 
    129 /** Return transformation structure to convert ICRS to Ecliptic */
    130 psSphereCoordTransformation *psSphereCoordTransformationItoE(void);
    131 
    132 /** Return transformation structure to convert Ecliptic to ICRS */
    133 psSphereCoordTransformation *psSphereCoordTransformationEtoI(void);
    134 
    135 /** Return transformation structure to convert ICRS to Galactic */
    136 psSphereCoordTransformation *psSphereCoordTransformationItoG(void);
    137 
    138 /** Return transformation structure to convert Galactic to ICRS */
    139 psSphereCoordTransformation *psSphereCoordTransformationGtoI(void);
    140 
    141 /***********************************************************************************************************/
    142 
    143 
    144 /** Project spherical system onto a plane */
    145 psPlaneCoord *
    146 psCoordProject(const psSphereCoord *coord, ///< Spherical coordinates to project
    147                const char *projection   ///< Projection to use
    148     );
    149 
    150 /** Deproject plane onto spherical system */
    151 psSphereCoord *
    152 psCoordDeproject(const psPlaneCoord *coord, ///< Plane coordinates to deproject
    153                  const char *projection ///< Projection to use
    154     );
    155 
    156203/* \} */ // End of AstroGroup Functions
    157204
Note: See TracChangeset for help on using the changeset viewer.