| 1 |
|
|---|
| 2 | /** @file psCCD.h
|
|---|
| 3 | *
|
|---|
| 4 | * @brief Contains basic CCD image definitions and operations
|
|---|
| 5 | *
|
|---|
| 6 | * This file defines the basic types for astronomical imagery, including
|
|---|
| 7 | * the concepts of: Readout, Cell, Chip, Focal Plane, and Exposure Information.
|
|---|
| 8 | *
|
|---|
| 9 | * @ingroup AstroImage
|
|---|
| 10 | *
|
|---|
| 11 | * @author Robert DeSonia, MHPCC
|
|---|
| 12 | *
|
|---|
| 13 | * @version $Revision: 1.1 $ $Name: $
|
|---|
| 14 | * @date $Date: 2004/07/16 02:15:51 $
|
|---|
| 15 | *
|
|---|
| 16 | * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
|
|---|
| 17 | */
|
|---|
| 18 |
|
|---|
| 19 | # ifndef PS_CCD_H
|
|---|
| 20 | # define PS_CCD_H
|
|---|
| 21 |
|
|---|
| 22 | #include "psType.h"
|
|---|
| 23 | #include "psImage.h"
|
|---|
| 24 | #include "psList.h"
|
|---|
| 25 |
|
|---|
| 26 | typedef void psMetadata; // not yet defined/implemented.
|
|---|
| 27 | typedef void psPlaneTransform; // not yet defined/implemented.
|
|---|
| 28 | typedef void psPlaneDistort; // not yet defined/implemented.
|
|---|
| 29 | typedef void psFixedPattern; // not yet defined/implemented.
|
|---|
| 30 | typedef void psPhotSystem; // not yet defined/implemented.
|
|---|
| 31 |
|
|---|
| 32 | struct psCell;
|
|---|
| 33 | struct psChip;
|
|---|
| 34 | struct psFPA;
|
|---|
| 35 | struct psExposure;
|
|---|
| 36 |
|
|---|
| 37 | /// @addtogroup Image
|
|---|
| 38 | /// @{
|
|---|
| 39 |
|
|---|
| 40 | /** Readout data structure.
|
|---|
| 41 | *
|
|---|
| 42 | * A readout is the result of a single read of a cell (or a portion thereof).
|
|---|
| 43 | * It contains a pointer to the pixel data, and additional pointers to the
|
|---|
| 44 | * objects found in the readout, and the readout metadata. It also contains
|
|---|
| 45 | * the offset from the lower-left corner of the chip, in the case that the
|
|---|
| 46 | * CCD was windowed.
|
|---|
| 47 | *
|
|---|
| 48 | */
|
|---|
| 49 | typedef struct
|
|---|
| 50 | {
|
|---|
| 51 | const unsigned int colBins; ///< Amount of binning in x-dimension
|
|---|
| 52 | const unsigned int rowBins; ///< Amount of binning in y-dimension
|
|---|
| 53 | const int col0; ///< Offset from the left of chip.
|
|---|
| 54 | const int row0; ///< Offset from the bottom of chip.
|
|---|
| 55 |
|
|---|
| 56 | psImage* image; ///< imaging area of Readout
|
|---|
| 57 | psList* objects; ///< objects derived from Readout
|
|---|
| 58 | psMetadata* metadata; ///< readout-level metadata
|
|---|
| 59 | }
|
|---|
| 60 | psReadout;
|
|---|
| 61 |
|
|---|
| 62 | /** Cell data structure
|
|---|
| 63 | *
|
|---|
| 64 | * A cell consists of one or more readouts. It also contains a pointer to the
|
|---|
| 65 | * cell's metadata, and its parent chip. On the astrometry side, it also
|
|---|
| 66 | * contains coordinate transforms from the cell to chip, from the cell to
|
|---|
| 67 | * focal-plane, as well as a "quick and dirty" tranform from the cell to
|
|---|
| 68 | * sky coordinates.
|
|---|
| 69 | *
|
|---|
| 70 | */
|
|---|
| 71 | typedef struct psCell
|
|---|
| 72 | {
|
|---|
| 73 | psArray* readouts; ///< readouts from the cell
|
|---|
| 74 | psMetadata* metadata; ///< cell-level metadata
|
|---|
| 75 |
|
|---|
| 76 | psPlaneTransform* toChip; ///< transformations from cell to chip coordinates
|
|---|
| 77 | psPlaneTransform* toFPA; ///< transformations from cell to FPA coordinates
|
|---|
| 78 | psPlaneTransform* toSky; ///< transformations from cell to sky coordinates
|
|---|
| 79 |
|
|---|
| 80 | struct psChip* parent; ///< chip in which contains this cell
|
|---|
| 81 | }
|
|---|
| 82 | psCell;
|
|---|
| 83 |
|
|---|
| 84 | /** Chip data structure
|
|---|
| 85 | *
|
|---|
| 86 | * A chip consists of one or more cells (according to the number of amplifiers
|
|---|
| 87 | * on the CCD). It contains a pointer to the chip's metadata, and a pointer
|
|---|
| 88 | * to the parent focal plane. For astrometry, ot contains a coordinate
|
|---|
| 89 | * transform from the chip to the focal plane, and vis-versa.
|
|---|
| 90 | *
|
|---|
| 91 | */
|
|---|
| 92 | typedef struct psChip
|
|---|
| 93 | {
|
|---|
| 94 | psArray* cells; ///< cells in the chip
|
|---|
| 95 | psMetadata* metadata; ///< chip-level metadata
|
|---|
| 96 |
|
|---|
| 97 | psPlaneTransform* toFPA; ///< transformation from chip to FPA coordinates
|
|---|
| 98 | psPlaneTransform* fromFPA; ///< transformation from FPA to chip coordinates
|
|---|
| 99 |
|
|---|
| 100 | struct psFPA* parent; ///< FPA which contains this chip
|
|---|
| 101 | }
|
|---|
| 102 | psChip;
|
|---|
| 103 |
|
|---|
| 104 | /** A Focal-Plane
|
|---|
| 105 | *
|
|---|
| 106 | * A focal plane consists of one or more chips (according to the number of
|
|---|
| 107 | * contiguous silicon). It contains pointers to the focal-plane's metadata
|
|---|
| 108 | * and the exposure information. For astrometry, it contains a transformation
|
|---|
| 109 | * from the focal plane to the tangent plane and the fixed pattern residuals.
|
|---|
| 110 | * Since colors are involved in the transformation, it is necessary to specify
|
|---|
| 111 | * the color the transformation is defined. We also include some values to
|
|---|
| 112 | * characterize the quality of the transformation: the root square deviation
|
|---|
| 113 | * for the x and y transformation fits, and the chi-squared for the
|
|---|
| 114 | * transformation fit.
|
|---|
| 115 | *
|
|---|
| 116 | */
|
|---|
| 117 | typedef struct psFPA
|
|---|
| 118 | {
|
|---|
| 119 | psArray* chips; ///< chips in the focal plane array
|
|---|
| 120 | psMetadata* metadata; ///< focal-plane's metadata
|
|---|
| 121 |
|
|---|
| 122 | psPlaneDistort* fromTangentPlane; ///< transformation from tangent plane to focal plane
|
|---|
| 123 | psPlaneDistort* toTangentPlane; ///< transformation from focal plane to tangent plane
|
|---|
| 124 | psFixedPattern* pattern; ///< fixed pattern residual offsets
|
|---|
| 125 |
|
|---|
| 126 | const struct psExposure* exposure; ///< information about this exposure
|
|---|
| 127 |
|
|---|
| 128 | psPhotSystem* colorPlus; ///< Color reference
|
|---|
| 129 | psPhotSystem* colorMinus; ///< Color reference
|
|---|
| 130 |
|
|---|
| 131 | float rmsX; ///< RMS for x transformation fits
|
|---|
| 132 | float rmsY; ///< RMS for y transformation fits
|
|---|
| 133 | float chi2; ///< chi^2 of astrometric solution
|
|---|
| 134 | }
|
|---|
| 135 | psFPA;
|
|---|
| 136 |
|
|---|
| 137 | /** Exposure Information
|
|---|
| 138 | *
|
|---|
| 139 | * Several quantities from the telescope in order to make a first guess at
|
|---|
| 140 | * the astrometric solution. From these quantities, further quantities can
|
|---|
| 141 | * be derivedand stored for later use.
|
|---|
| 142 | *
|
|---|
| 143 | */
|
|---|
| 144 |
|
|---|
| 145 | typedef struct psExposure
|
|---|
| 146 | {
|
|---|
| 147 | const double ra; ///< Telescope boresight, right ascention
|
|---|
| 148 | const double dec; ///< Telescope boresight, declination
|
|---|
| 149 | const double hourAngle; ///< Hour angle
|
|---|
| 150 | const double zenith; ///< Zenith distance
|
|---|
| 151 | const double azimuth; ///< Azimuth
|
|---|
| 152 | const double localTime; ///< Local Sidereal Time
|
|---|
| 153 | const float date; ///< Modified Jullian Date of observation
|
|---|
| 154 | const float rotAngle; ///< Rotator position angle
|
|---|
| 155 | const float temperature; ///< Air temperature, for estimating refraction
|
|---|
| 156 | const float pressure; ///< Air pressure, for calculating refraction
|
|---|
| 157 | const float humidity; ///< Relative humidity, for refraction
|
|---|
| 158 | const float exposureTime; ///< Exposure time
|
|---|
| 159 |
|
|---|
| 160 | /* Derived quantities */
|
|---|
| 161 | const float positionAngle; ///< Position angle
|
|---|
| 162 | const float parallacticAngle; ///< Parallactic angle
|
|---|
| 163 | const float airmass; ///< Airmass, calculated from zenith distance
|
|---|
| 164 | const float parallacticFactor; ///< Parallactic factor
|
|---|
| 165 | const char *cameraName; ///< name of camera which provided exposure
|
|---|
| 166 | const char *telescopeName; ///< name of telescope which provided exposure
|
|---|
| 167 | }
|
|---|
| 168 | psExposure;
|
|---|
| 169 |
|
|---|
| 170 | psExposure* psExposureAlloc(
|
|---|
| 171 | double ra, ///< Telescope boresight, right ascention
|
|---|
| 172 | double dec, ///< Telescope boresight, declination
|
|---|
| 173 | double hourAngle, ///< Hour angle
|
|---|
| 174 | double zenith, ///< Zenith distance
|
|---|
| 175 | double azimuth, ///< Azimuth
|
|---|
| 176 | double localTime, ///< Local Sidereal Time
|
|---|
| 177 | float date, ///< MJD
|
|---|
| 178 | float rotAngle, ///< Rotator position angle
|
|---|
| 179 | float temperature, ///< Temperature
|
|---|
| 180 | float pressure, ///< Pressure
|
|---|
| 181 | float humidity, ///< Relative humidity
|
|---|
| 182 | float exposureTime ///< Exposure time
|
|---|
| 183 | );
|
|---|
| 184 |
|
|---|
| 185 | #endif
|
|---|