IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 17, 2004, 2:53:17 PM (22 years ago)
Author:
eugene
Message:

extensive re-organization of astrometry, image, object data structures

File:
1 edited

Legend:

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

    r247 r251  
    77 */
    88
    9 /***********************************************************************************************************/
     9/*************************************************/
     10typedef struct {
     11    union {
     12        double x;                               //!< x position
     13        double r;                               //!< x position
     14    }
     15    union {
     16        double xErr;                            //!< Error in x position
     17        double rErr;                            //!< Error in x position
     18    }
     19    union {
     20        double y;                               //!< y position
     21        double d;                               //!< y position
     22    }
     23    union {
     24        double yErr;                            //!< Error in y position
     25        double dErr;                            //!< Error in y position
     26    }
     27} psCoord;
    1028
    11 /** Planets */
    12 typedef enum {
    13     PS_MERCURY = 1,
    14     PS_VENUS = 2,
    15     PS_MARS = 4,
    16     PS_JUPITER = 5,
    17     PS_SATURN = 6,
    18     PS_URANUS = 7,
    19     PS_NEPTUNE = 8,
    20     PS_PLUTO = 9
    21 } psPlanetNum;
     29typedef struct {
     30    psDPolynomial4D *x;
     31    psDPolynomial4D *y;
     32} psDistortion;
    2233
    23 /** Catalogues */
    24 typedef enum {
    25     PS_PANSTARRS,                       //!< Pan-STARRS object catalogue
    26     PS_USNO,                            //!< USNO-B1 catalogue
    27     PS_2MASS,                           //!< 2MASS catalogue
    28     PS_TYCHO,                           //!< Tycho catalogue
    29     PS_UCAC2 = 4                        //!< UCAC2 catalogue
    30 } psCatalogue;
     34typedef struct {
     35    psDPolynomial2D *x;
     36    psDPolynomial2D *y;
     37} psCoordXform;
    3138
    32 /***********************************************************************************************************/
     39psCoord *psCoordXformApply (psCoordXform *frame, psCoord *coords);
    3340
    34 /** A position on an OTA */
    35 typedef struct {
    36     int chip;                           //!< Chip number
    37     float x;                            //!< x position
    38     float xErr;                         //!< Error in x position
    39     float y;                            //!< y position
    40     float yErr;                         //!< Error in y position
    41 } psOTAPos;
    42 
    43 /** Constructor */
    44 psOTAPos *
    45 psOTAPosAlloc(void);
    46 
    47 /** Destructor */
    48 void
    49 psOTAPosFree(psOTAPos *restrict myOTAPos        //!< Object to destroy
    50     );
    51 
    52 /***********************************************************************************************************/
    53 
    54 /** A position on a cell */
    55 typedef psOTAPos psCellPos;             //!< Same thing as for an OTA.
    56 #define psCellPosAlloc() psOTAPosAlloc() //!< Constructor
    57 #define psCellPosFree(C) psOTAPosFree(C) //!< Destructor
    58 
    59 /***********************************************************************************************************/
    60 
    61 /** An array of detector positions */
    62 typedef struct {
    63     psType type;                        //!< Type of data.  THIS STRUCT ELEMENT MUST BE FIRST IN THE STRUCT!
    64     int size;                           //!< Total number of elements available
    65     int n;                              //!< Number of elements in use
    66     psOTAPos *arr;                      //!< The array data
    67 } psOTAPosArray;
    68 
    69 /** Constructor */
    70 psOTAPosArray *psOTAPosArrayAlloc(int s, //!< Total number of elements to make available
    71                                   int n //!< Number of elements that will be used
    72     );
    73 /** Reallocator */
    74 psOTAPosArray *psOTAPosArrayRealloc(psOTAPosArray *myArray, //!< Array to reallocate
    75                                     int s       //!< Total number of elements to make available
    76     );
    77 /** Destructor */
    78 void psOTAPosArrayFree(psOTAPosArray *restrict myArray //!< Array to free
    79     );
    80 
    81 /***********************************************************************************************************/
    82 
    83 /*
    84  * \brief A simple RA/Dec position on the sky, default system is ICRS.  Double precision needed for
    85  * milli-arcsec.
    86  */
    87 typedef struct {
    88     double ra;                          //!< Right Ascension
    89     double raErr;                       //!< Error in RA
    90     double dec;                         //!< Declination
    91     double decErr;                      //!< Error in Dec
    92 } psSkyPos;
    93 
    94 /** Constructor */
    95 psSkyPos *
    96 psSkyPosAlloc(void);
    97 
    98 /** Destructor */
    99 void
    100 psSkyPosFree(psSkyPos *restrict mySkyPos        //!< Object to destroy
    101     );
    102 
    103 /***********************************************************************************************************/
    104 
    105 /** An array of sky positions */
    106 typedef struct {
    107     psType type;                        //!< Type of data.  THIS STRUCT ELEMENT MUST BE FIRST IN THE STRUCT!
    108     int size;                           //!< Total number of elements available
    109     int n;                              //!< Number of elements in use
    110     psSkyPos *arr;                      //!< The array data
    111 } psSkyPosArray;
    112 
    113 /** Constructor */
    114 psSkyPosArray *psSkyPosArrayAlloc(int s, //!< Total number of elements to make available
    115                                   int n //!< Number of elements that will be used
    116     );
    117 /** Reallocator */
    118 psSkyPosArray *psSkyPosArrayRealloc(psSkyPosArray *myArray, //!< Array to reallocate
    119                                     int s       //!< Total number of elements to make available
    120     );
    121 /** Destructor */
    122 void psSkyPosArrayFree(psSkyPosArray *restrict myArray //!< Array to free
    123     );
    124 
    125 /***********************************************************************************************************/
    126 
    127 /** Latitude and Longitude.  Double precision needed for milli-arcsec */
    128 typedef struct {
    129     double lat;                         //!< Latitude
    130     double latErr;                      //!< Error in Latitude
    131     double lng;                         //!< Longitude (can't use "long")
    132     double lngErr;                      //!< Error in Longitude
    133 } psLatLong;
    134 
    135 /** Constructor */
    136 psLatLong *
    137 psLatLongAlloc(void);
    138 
    139 /** Destructor */
    140 void
    141 psLatLongFree(psLatLong *restrict myLatLong //!< Object to destroy
    142     );
     41psCoord *psDistortionApply (psCoordXform *frame, psCoord *coords);
    14342
    14443/***********************************************************************************************************/
     
    14746
    14847/** Get offset (RA,Dec) on the sky between two positions position1 and position2 may not be identical */
    149 psSkyPos *
    150 psGetOffset(const psSkyPos *restrict position1, //!< Position 1
    151             const psSkyPos *restrict position2 //!< Position 2
     48psCoords *
     49psGetOffset(const psCoords *restrict position1, //!< Position 1
     50            const psCoords *restrict position2, //!< Position 2
     51            char *system
    15252            );
    15353
    15454/** Apply an offset to a position */
    155 psSkyPos *
    156 psApplyOffset(const psSkyPos *restrict position, //!< Position
    157               const psSkyPos *restrict offset //!< Offset
    158               );
     55psCoords *
     56psApplyOffset(const psCoords *restrict position, //!< Position
     57              const psCoords *restrict offset, //!< Offset
     58              char *system
     59    );
    15960
    16061/***********************************************************************************************************/
     
    16364
    16465/** Get Sun Position */
    165 psSkyPos *
     66psCoords *
    16667psGetSunPos(float mjd                   //!< MJD to get position for
    16768            );
    16869
    16970/** Get Moon position */
    170 psSkyPos *
     71psCoords *
    17172psGetMoonPos(float mjd,                 //!< MJD to get position for
    17273             double latitude,           //!< Latitude for apparent position
     
    18081
    18182/** Get Planet positions */
    182 psSkyPos *
    183 psGetPlanetPos(psPlanetNum myPlanetNum, //!< Number for planet
    184                float mjd                //!< MJD to get position for
    185                );
    186 
    187 /** Get star list from catalogue */
    188 struct psObjectArray *
    189 psReadStarCatalogue(double ra,          //!< RA of centre of search
    190                     double dec,         //!< Declination of centre of search
    191                     float radius,       //!< Radius of search for stars in catalogue
    192                     float mjd,          //!< The epoch (in MJD) for which to get positions
    193                     psCatalogue myCatalogue //!< The catalogue to use
     83psCoords *
     84psGetSolarSystemPos(char *solarSystemObject, //!< Named S.S. object
     85                    float mjd           //!< MJD to get position for
    19486    );
    19587
     
    19991
    20092/** Convert ICRS to Ecliptic */
    201 psLatLong *
    202 psCoordinatesItoE(const psSkyPos *restrict coordinates //!< ICRS coordinates to convert
     93psCoord *
     94psCoordinatesItoE(const psCoord *restrict coordinates //!< ICRS coordinates to convert
    20395                  );
    20496
    20597/** Convert Ecliptic to ICRS */
    206 psSkyPos *
    207 psCoordinatesEtoI(const psLatLong *restrict coordinates //!< Ecliptic coordinates to convert
     98psCoord *
     99psCoordinatesEtoI(const psCoord *restrict coordinates //!< Ecliptic coordinates to convert
    208100                  );
    209101
    210102/** Convert ICRS to Galactic */
    211 psLatLong *
    212 psCoordinatesItoG(const psSkyPos *restrict coordinates //!< ICRS coordinates to convert
     103psCoord *
     104psCoordinatesItoG(const psCoord *restrict coordinates //!< ICRS coordinates to convert
    213105                  );
    214106
    215107/** Convert Galactic to ICRS */
    216 psSkyPos *
    217 psCoordinatesGtoI(const psLatLong *restrict coordinates //!< Galactic coordinates to convert
     108psCoord *
     109psCoordinatesGtoI(const psCoord *restrict coordinates //!< Galactic coordinates to convert
    218110                  );
    219111
Note: See TracChangeset for help on using the changeset viewer.