IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 4, 2004, 12:11:09 PM (22 years ago)
Author:
desonia
Message:

merged psAstrometry and psCCD, which had recursive header dependencies; yuk!
Also added required includes in other files to allow psAstrometry.h to
work without having to know which other include files are needed before
including a particular header file.

File:
1 edited

Legend:

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

    r1333 r1382  
    1 /** @file  psCoord2.h
    2  *
    3  *  @brief Contains basic coordinate transformation definitions and operations
    4  *
    5  *  This file defines the basic types for astronomical coordinate
    6  *  transformation
    7  *
    8  *  @ingroup AstroImage
    9  *
    10  *  @author George Gusciora, MHPCC
    11  *
    12  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-07-29 04:22:26 $
    14  *
    15  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
    16  */
    17 
    18 # ifndef PS_COORD2_H
    19 # define PS_COORD2_H
     1/** @file  psAstrometry.h
     2*
     3*  @brief This file defines the basic types for astronomical coordinate
     4*  transformation
     5*
     6*  @ingroup AstroImage
     7*
     8*  @author George Gusciora, MHPCC
     9*
     10*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2004-08-04 22:11:09 $
     12*
     13*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     14*/
     15
     16# ifndef PS_ASTROMETRY_H
     17# define PS_ASTROMETRY_H
    2018
    2119#include "psType.h"
     
    2422#include "psList.h"
    2523#include "psFunctions.h"
     24#include "psMetadata.h"
     25#include "psCoord.h"
     26#include "psPhotometry.h"
     27
     28struct psCell;
     29struct psChip;
     30struct psFPA;
     31struct psExposure;
     32
     33/// @addtogroup AstroImage
     34/// @{
    2635
    2736typedef struct
    28 {
    29     const double latitude;             ///<
    30     const double sinLat, cosLat;       ///<
    31     const double abberationMag;        ///<
    32     const double height;               ///<
    33     const double temperature;          ///<
    34     const double pressure;             ///<
    35     const double humidity;             ///<
    36     const double wavelength;           ///<
    37     const double lapseRate;            ///<
    38     const double refractA, refractB;   ///<
    39     const double longitudeOffset;      ///<
    40     const double siderealTime;         ///<
    41 }
     37    {
     38        const double latitude;             ///<
     39        const double sinLat, cosLat;       ///<
     40        const double abberationMag;        ///<
     41        const double height;               ///<
     42        const double temperature;          ///<
     43        const double pressure;             ///<
     44        const double humidity;             ///<
     45        const double wavelength;           ///<
     46        const double lapseRate;            ///<
     47        const double refractA, refractB;   ///<
     48        const double longitudeOffset;      ///<
     49        const double siderealTime;         ///<
     50    }
    4251psGrommit;
    4352
    4453typedef struct
    45 {
    46     int nX, nY;               ///<
    47     double x0, y0;            ///<
    48     double xScale, yScale;    ///<
    49     double **x, **y;          ///<
    50 }
     54    {
     55        int nX, nY;               ///<
     56        double x0, y0;            ///<
     57        double xScale, yScale;    ///<
     58        double **x, **y;          ///<
     59    }
    5160psFixedPattern;
    5261
    53 psGrommit *psGrommitAlloc(const psExposure *exp);
    54 
    55 void p_psGrommitFree(psGrommit *grommit);
    56 
    57 psCell *psCellinFPA(psCell *out,
    58                     const psPlane *coord,
    59                     const psFPA *FPA);
    60 
    61 psChip *psChipinFPA(psChip *out,
    62                     const psPlane *coord,
    63                     const psFPA *FPA);
    64 
    65 psCell *psCellinChip(psCell *out,
     62/** Readout data structure.
     63 *
     64 *  A readout is the result of a single read of a cell (or a portion thereof).
     65 *  It contains a pointer to the pixel data, and additional pointers to the
     66 *  objects found in the readout, and the readout metadata.  It also contains
     67 *  the offset from the lower-left corner of the chip, in the case that the
     68 *  CCD was windowed.
     69 *
     70 */
     71typedef struct
     72    {
     73        const unsigned int colBins;        ///< Amount of binning in x-dimension
     74        const unsigned int rowBins;        ///< Amount of binning in y-dimension
     75        const int col0;                    ///< Offset from the left of chip.
     76        const int row0;                    ///< Offset from the bottom of chip.
     77       
     78        psImage* image;                    ///< imaging area of Readout
     79        psList* objects;                  ///< objects derived from Readout
     80        psMetadata* metadata;              ///< readout-level metadata
     81    }
     82psReadout;
     83
     84/** Cell data structure
     85 *
     86 *  A cell consists of one or more readouts.  It also contains a pointer to the
     87 *  cell's metadata, and its parent chip.  On the astrometry side, it also
     88 *  contains coordinate transforms from the cell to chip, from the cell to
     89 *  focal-plane, as well as a "quick and dirty" tranform from the cell to
     90 *  sky coordinates.
     91 *
     92 */
     93typedef struct psCell
     94    {
     95        psArray* readouts;                 ///< readouts from the cell
     96        psMetadata* metadata;              ///< cell-level metadata
     97       
     98        psPlaneTransform* toChip;          ///< transformations from cell to chip coordinates
     99        psPlaneTransform* fromChip;        ///< transformations from chip to cell coordinates
     100        psPlaneTransform* toFPA;           ///< transformations from cell to FPA coordinates
     101        psPlaneTransform* toSky;           ///< transformations from cell to sky coordinates
     102       
     103        struct psChip* parent;             ///< chip in which contains this cell
     104    }
     105psCell;
     106
     107/** Chip data structure
     108 *
     109 *  A chip consists of one or more cells (according to the number of amplifiers
     110 *  on the CCD). It contains a pointer to the chip's metadata, and a pointer   
     111 *  to the parent focal plane.  For astrometry, ot contains a coordinate
     112 *  transform from the chip to the focal plane, and vis-versa.
     113 *
     114 */
     115typedef struct psChip
     116    {
     117        psArray* cells;                    ///< cells in the chip
     118        psMetadata* metadata;              ///< chip-level metadata
     119       
     120        psPlaneTransform* toFPA;           ///< transformation from chip to FPA coordinates
     121        psPlaneTransform* fromFPA;         ///< transformation from FPA to chip coordinates
     122       
     123        struct psFPA* parent;              ///< FPA which contains this chip
     124    }
     125psChip;
     126
     127/** A Focal-Plane
     128 *
     129 *  A focal plane consists of one or more chips (according to the number of
     130 *  contiguous silicon).  It contains pointers to the focal-plane's metadata
     131 *  and the exposure information.  For astrometry, it contains a transformation
     132 *  from the focal plane to the tangent plane and the fixed pattern residuals.
     133 *  Since colors are involved in the transformation, it is necessary to specify
     134 *  the color the transformation is defined.  We also include some values to
     135 *  characterize the quality of the transformation: the root square deviation
     136 *  for the x and y transformation fits, and the chi-squared for the
     137 *  transformation fit.
     138 *
     139 */
     140typedef struct psFPA
     141    {
     142        psArray* chips;                    ///< chips in the focal plane array
     143        psMetadata* metadata;              ///< focal-plane's metadata
     144       
     145        psPlaneDistort* fromTangentPlane;  ///< transformation from tangent plane to focal plane
     146        psPlaneDistort* toTangentPlane;    ///< transformation from focal plane to tangent plane
     147        psFixedPattern* pattern;           ///< fixed pattern residual offsets
     148       
     149        const struct psExposure* exposure; ///< information about this exposure
     150       
     151        psPhotSystem* colorPlus;           ///< Color reference
     152        psPhotSystem* colorMinus;          ///< Color reference
     153       
     154        float rmsX;                        ///< RMS for x transformation fits
     155        float rmsY;                        ///< RMS for y transformation fits
     156        float chi2;                        ///< chi^2 of astrometric solution
     157    }
     158psFPA;
     159
     160/** Exposure Information
     161 *
     162 *  Several quantities from the telescope in order to make a first guess at
     163 *  the astrometric solution.  From these quantities, further quantities can
     164 *  be derivedand stored for later use.
     165 *
     166 */
     167typedef struct psExposure
     168    {
     169        const double ra;                  ///< Telescope boresight, right ascention
     170        const double dec;                 ///< Telescope boresight, declination
     171        const double hourAngle;           ///< Hour angle
     172        const double zenith;              ///< Zenith distance
     173        const double azimuth;             ///< Azimuth
     174        const double localTime;           ///< Local Sidereal Time
     175        const float date;                 ///< Modified Jullian Date of observation
     176        const float rotAngle;             ///< Rotator position angle
     177        const float temperature;          ///< Air temperature, for estimating refraction
     178        const float pressure;             ///< Air pressure, for calculating refraction
     179        const float humidity;             ///< Relative humidity, for refraction
     180        const float exposureTime;         ///< Exposure time
     181       
     182        /* Derived quantities */
     183        const float positionAngle;        ///< Position angle
     184        const float parallacticAngle;     ///< Parallactic angle
     185        const float airmass;              ///< Airmass, calculated from zenith distance
     186        const float parallacticFactor;    ///< Parallactic factor
     187        const char *cameraName;           ///< name of camera which provided exposure
     188        const char *telescopeName;        ///< name of telescope which provided exposure
     189    }
     190psExposure;
     191
     192psExposure* psExposureAlloc(
     193    double ra,                          ///< Telescope boresight, right ascention
     194    double dec,                         ///< Telescope boresight, declination
     195    double hourAngle,                   ///< Hour angle
     196    double zenith,                      ///< Zenith distance
     197    double azimuth,                     ///< Azimuth
     198    double localTime,                   ///< Local Sidereal Time
     199    float date,                         ///< MJD
     200    float rotAngle,                     ///< Rotator position angle
     201    float temperature,                  ///< Temperature
     202    float pressure,                     ///< Pressure
     203    float humidity,                     ///< Relative humidity
     204    float exposureTime                 ///< Exposure time
     205);
     206
     207psGrommit* psGrommitAlloc( const psExposure* exp );
     208
     209psCell *psCellinFPA( psCell *out,
    66210                     const psPlane *coord,
    67                      const psChip *chip);
    68 
    69 
    70 
    71 
    72 psPlane *psCoordCelltoChip(psPlane *out,
     211                     const psFPA *FPA );
     212                     
     213psChip *psChipinFPA( psChip *out,
     214                     const psPlane *coord,
     215                     const psFPA *FPA );
     216                     
     217psCell *psCellinChip( psCell *out,
     218                      const psPlane *coord,
     219                      const psChip *chip );
     220                     
     221                     
     222                     
     223                     
     224psPlane *psCoordCelltoChip( psPlane *out,
     225                            const psPlane *in,
     226                            const psCell *cell );
     227                           
     228psPlane *psCoordChipToFPA( psPlane *out,
    73229                           const psPlane *in,
    74                            const psCell *cell);
    75 
    76 psPlane *psCoordChipToFPA(psPlane *out,
     230                           const psChip *chip );
     231                           
     232psPlane *psCoordFPAtoTP( psPlane *out,
     233                         const psPlane *in,
     234                         const psFPA *fpa );
     235                         
     236psSphere *psCoordTPtoSky( psSphere *out,
    77237                          const psPlane *in,
    78                           const psChip *chip);
    79 
    80 psPlane *psCoordFPAtoTP(psPlane *out,
    81                         const psPlane *in,
    82                         const psFPA *fpa);
    83 
    84 psSphere *psCoordTPtoSky(psSphere *out,
     238                          const psGrommit *grommit );
     239                         
     240psPlane *psCoordCellToFPA( psPlane *out,
     241                           const psPlane *in,
     242                           const psCell *cell );
     243                           
     244psSphere *psCoordCelltoSky( psSphere *out,
     245                            const psPlane *in,
     246                            const psCell *cell );
     247                           
     248psSphere *psCoordCelltoSkyQuick( psSphere *out,
     249                                 const psPlane *in,
     250                                 const psCell *cell );
     251                                 
     252psPlane *psCoordSkytoTP( psPlane *out,
     253                         const psSphere *in,
     254                         const psGrommit *grommit );
     255                         
     256psPlane *psCoordTPtoFPA( psPlane *out,
    85257                         const psPlane *in,
    86                          const psGrommit *grommit);
    87 
    88 psPlane *psCoordCellToFPA(psPlane *out,
    89                           const psPlane *in,
    90                           const psCell *cell);
    91 
    92 psSphere *psCoordCelltoSky(psSphere *out,
     258                         const psFPA *fpa );
     259                         
     260psPlane *psCoordFPAtoChip( psPlane *out,
    93261                           const psPlane *in,
    94                            const psCell *cell);
    95 
    96 psSphere *psCoordCelltoSkyQuick(psSphere *out,
    97                                 const psPlane *in,
    98                                 const psCell *cell);
    99 
    100 psPlane *psCoordSkytoTP(psPlane *out,
    101                         const psSphere *in,
    102                         const psGrommit *grommit);
    103 
    104 psPlane *psCoordTPtoFPA(psPlane *out,
    105                         const psPlane *in,
    106                         const psFPA *fpa);
    107 
    108 psPlane *psCoordFPAtoChip(psPlane *out,
    109                           const psPlane *in,
    110                           const psChip *chip);
    111 
    112 psPlane *psCoordChiptoCell(psPlane *out,
    113                            const psPlane *in,
    114                            const psCell *cell);
    115 
    116 psPlane *psCoordSkytoCell(psPlane *out,
    117                           const psSphere *in,
    118                           const psCell *cell);
    119 
    120 psPlane *psCoordSkytoCellQuick(psPlane *out,
    121                                const psSphere *in,
    122                                const psCell *cell);
    123 
     262                           const psChip *chip );
     263                           
     264psPlane *psCoordChiptoCell( psPlane *out,
     265                            const psPlane *in,
     266                            const psCell *cell );
     267                           
     268psPlane *psCoordSkytoCell( psPlane *out,
     269                           const psSphere *in,
     270                           const psCell *cell );
     271                           
     272psPlane *psCoordSkytoCellQuick( psPlane *out,
     273                                const psSphere *in,
     274                                const psCell *cell );
     275                               
    124276#endif
Note: See TracChangeset for help on using the changeset viewer.