IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 623


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.

Location:
trunk/archive/pslib/include
Files:
2 edited

Legend:

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

    r621 r623  
    9696
    9797    psMetadata *md;                     ///< Chip-level metadata
    98     psCoordXform *chipToFPA;            ///< Transformations from chip coordinates to FPA coordinates
    99     psCoordXform *FPAtoChip;            ///< Transformations from FPA coordinates to chip
     98    psPlaneCoordXform *chipToFPA;       ///< Transformations from chip coordinates to FPA coordinates
     99    psPlaneCoordXform *FPAtoChip;       ///< Transformations from FPA coordinates to chip
    100100
    101101    struct psFPA *parentFPA;            ///< FPA which contains this chip
     
    110110    psMetadata *md;                     ///< Cell-level metadata
    111111
    112     psCoordXform *cellToChip;           ///< Transformations from cell coordinates to chip coordinates
    113     psCoordXform *cellToFPA;            ///< Transformations from cell coordinates to FPA coordinates
    114     psCoordXform *cellToSky;            ///< Quick and Dirty transformations from cell coordinates to sky
     112    psPlaneCoordXform *cellToChip;      ///< Transformations from cell coordinates to chip coordinates
     113    psPlaneCoordXform *cellToFPA;       ///< Transformations from cell coordinates to FPA coordinates
     114    psPlaneCoordXform *cellToSky;       ///< Quick and Dirty transformations from cell coordinates to sky
    115115
    116116    struct psChip  *parentChip;         ///< chip which contains this cell
     
    137137psChip *
    138138psChipInFPA (psChip *out,               ///< Chip to return, or NULL
     139             const psPlaneCoord *coord  ///< coordinate in FPA
    139140             const psFPA *fpa,          ///< FPA description
    140              const psCoord *coord       ///< coordinate in FPA
    141141             );
    142142
     
    144144psCell *
    145145psCellInChip(psCell *out,               ///< Cell to return, or NULL
     146             const psPlaneCoord *coord  ///< coordinate in chip
    146147             const psChip *chip,        ///< chip description
    147              const psCoord *coord       ///< coordinate in chip
    148148             );
    149149
     
    151151psCell *
    152152psCellInFPA(psCell *out,                ///< Cell to return, or NULL
     153            const psPlaneCoord *coord   ///< Coordinate in FPA
    153154            const psFPA *fpa,           ///< FPA description
    154             const psCoord *coord        ///< Coordinate in FPA
    155155            );
    156156
    157157
    158158/** Convert (RA,Dec) to cell and cell coordinates */
    159 psCoord *
    160 psCoordSkyToCell(psCoord *out,          ///< Coordinates to return, or NULL
     159psPlaneCoord *
     160psCoordSkyToCell(psPlaneCoord *out,     ///< Coordinates to return, or NULL
    161161                 psCell *cell,          ///< Cell to return
     162                 const psSphereCoord *in, ///< Input coordinates
    162163                 const psFPA *fpa       ///< FPA description
    163164                 );
    164165
    165166/** Convert cell and cell coordinate to (RA,Dec) */
    166 psCoord *
    167 psCoordCellToSky(psCoord *out,          ///< Coordinates to return, or NULL
     167psSphereCoord *
     168psCoordCellToSky(psSphereCoord *out,    ///< Coordinates to return, or NULL
     169                 const psPlaneCoord *coord ///< cell coordinates to transform
    168170                 const psCell *cell,    ///< Cell to get coordinates for
    169                  const psCoord *coord   ///< cell coordinates to transform
    170171                 );
    171172
    172173/** Quick and dirty cell to (RA,Dec) --- employs cellToSky transformation */
    173 psCoord *
    174 psCoordCellToSkyQuick(psCoord *out,     ///< Coordinates to return, or NULL
     174psSphereCoord *
     175psCoordCellToSkyQuick(psSphereCoord *out, ///< Coordinates to return, or NULL
     176                      const psPlaneCoord *coord ///< cell coordinates to transform
    175177                      const psCell *cell, ///< Cell description
    176                       const psCoord *coord ///< cell coordinates to transform
    177178                      );
    178179
    179180/** Convert (RA,Dec) to tangent plane coords */
    180 psCoord *
    181 psCoordSkyToTP(psCoord *out,            ///< Coordinates to return, or NULL
    182                const psExposure *exp,   ///< Exposure description
    183                const psCoord *coord     ///< input Sky coordinate
     181psPlaneCoord *
     182psCoordSkyToTP(psPlaneCoord *out,       ///< Coordinates to return, or NULL
     183               const psSphereCoord *coord ///< input Sky coordinate
     184               const psGrommit *grommit, ///< Grommit for fast conversion
    184185               );
    185186
    186187/** Convert tangent plane coords to focal plane coordinates */
    187 psCoord *
    188 psCoordTPtoFPA(psCoord *out,            ///< Coordinates to return, or NULL
     188psPlaneCoord *
     189psCoordTPtoFPA(psPlaneCoord *out,       ///< Coordinates to return, or NULL
     190               const psPlaneCoord *coord ///< input TP coordinate
    189191               const psFPA *fpa,        ///< FPA description
    190                const psCoord *coord     ///< input TP coordinate
    191192               );
    192193
    193194/** converts the specified FPA coord to the coord on the given Chip */
    194 psCoord *
    195 psCoordFPAtoChip (psCoord *out,         ///< Coordinates to return, or NULL
     195psPlaneCoord *
     196psCoordFPAtoChip (psPlaneCoord *out,    ///< Coordinates to return, or NULL
     197                  const psPlaneCoord *coord ///< input FPA coordinate
    196198                  const psChip *chip,   ///< Chip of interest
    197                   const psCoord *coord  ///< input FPA coordinate
    198199                  );
    199200
    200201/** converts the specified Chip coord to the coord on the given Cell */
    201 psCoord *
    202 psCoordChiptoCell (psCoord *out,        ///< Coordinates to return, or NULL
     202psPlaneCoord *
     203psCoordChiptoCell (psPlaneCoord *out,   ///< Coordinates to return, or NULL
     204                   const psPlaneCoord *coord ///< input Chip coordinate
    203205                   const psCell *cell,  ///< Cell of interest
    204                    const psCoord *coord ///< input Chip coordinate
    205206                   );
    206207
    207208/** converts the specified Cell coord to the coord on the parent Chip */
    208 psCoord *
    209 psCoordCelltoChip (psCoord *out,        ///< Coordinates to return, or NULL
     209psPlaneCoord *
     210psCoordCelltoChip (psPlaneCoord *out,   ///< Coordinates to return, or NULL
     211                   const psPlaneCoord *coord ///< input Cell coordinate
    210212                   const psCell *cell,  ///< Cell description
    211                    const psCoord *coord ///< input Cell coordinate
    212213                   );
    213214
    214215/** converts the specified Chip coord to the coord on the parent FPA */
    215 psCoord *
    216 psCoordChiptoFPA (psCoord *out,         ///< Coordinates to return, or NULL
     216psPlaneCoord *
     217psCoordChiptoFPA (psPlaneCoord *out,            ///< Coordinates to return, or NULL
     218                  const psPlaneCoord *coord     ///< input Chip coordinate
    217219                  const psChip *chip,   ///< Chip description
    218                   const psCoord *coord  ///< input Chip coordinate
    219220                  );
    220221
    221222/** Convert focal plane coords to tangent plane coordinates */
    222 psCoord *
    223 psCoordFPAToTP(psCoord *out,            ///< Coordinates to return, or NULL
     223psPlaneCoord *
     224psCoordFPAToTP(psPlaneCoord *out,               ///< Coordinates to return, or NULL
     225               const psPlaneCoord *coord ///< input FPA coordinate
    224226               const psFPA *fpa,        ///< FPA description
    225                const psCoord *coord     ///< input FPA coordinate
    226227               );
    227228
    228229/** Convert tangent plane coords to (RA,Dec) */
    229 psCoord *
    230 psCoordTPtoSky(psCoord *out,            ///< Coordinates to return, or NULL
    231                const psExposure *exp,   ///< Exposure description
    232                const psCoord *coord     ///< input TP coordinate
     230psSphereCoord *
     231psCoordTPtoSky(psSphereCoord *out,      ///< Coordinates to return, or NULL
     232               const psPlaneCoord *coord ///< input TP coordinate
     233               const psGrommit *grommit, ///< Grommit for fast conversion
    233234               );
    234235
    235236/** Convert Cell coords to FPA coordinates */
    236 psCoord *
    237 psCoordCellToFPA(psCoord *out,          ///< Coordinates to return, or NULL
     237psPlaneCoord *
     238psCoordCellToFPA(psPlaneCoord *out,     ///< Coordinates to return, or NULL
     239                 const psPlaneCoord *coord ///< Input cell coordinates
    238240                 const psCell *cell,    ///< Cell description
    239                  const psCoord *coord   ///< Input cell coordinates
    240241                 );
    241242
    242243/** Get the airmass for a given position and sidereal time */
    243244float
    244 psGetAirmass(const psCoord *coord,      ///< Position on the sky
     245psGetAirmass(const psSphereCoord *coord, ///< Position on the sky
    245246             double siderealTime,       ///< Sidereal time
    246247             float height               ///< Height above sea level
     
    249250/** Get the parallactic angle for a given position and sidereal time */
    250251float
    251 psGetParallactic(const psCoord *coord,  ///< Position on the sky
     252psGetParallactic(const psSphereCoord *coord, ///< Position on the sky
    252253                 double siderealTime    ///< Sidereal time
    253254                 );
     
    262263
    263264/** Calculate the parallax factor */
    264 psCoord *
     265psSphereCoord *
    265266psGetParallaxFactor(const psExposure *exp ///< Exposure details
    266267    );
  • 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.