IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 15, 2005, 3:10:36 PM (21 years ago)
Author:
gusciora
Message:

There are a lot of changes here required by the new SDRS. Most changes
involve the new definitions of the psAstrometry types. Not all tests work
correctly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/pmAstrometry.h

    r4754 r4770  
    88*  @author GLG, MHPCC
    99*
    10 *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2005-08-11 00:03:51 $
     10*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2005-08-16 01:10:34 $
    1212*
    1313*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    143143    // Information
    144144    psImage *image;                     ///< Imaging area of readout
     145    // XXX: The following mask was removed from the pmReadout struct in recent SDRS
     146    // versions.  However, I'm keeping it here since al ot of modules still require
     147    // it.
     148    psImage *mask;                      ///< Mask of input image
    145149    psMetadata *analysis;               ///< Readout-level analysis metadata
    146150    psMetadata *concepts;               ///< Cache for PS Concepts
    147151    pmCell *parent;                     ///< Parent cell
    148152}
    149 psReadout;
    150 
    151 /** Allocates a psReadout
     153pmReadout;
     154
     155
     156/** Allocates a pmReadout
    152157 *
    153158 *  The constructor shall make an empty pmReadout. If the parent cell is not
     
    156161 *  other pointers in the structure shall be initialized to NULL.
    157162 *
    158  *  @return psReadout*    newly allocated psReadout with all internal pointers set to NULL
    159  */
    160 psReadout *pmReadoutAlloc(
     163 *  @return pmReadout*    newly allocated pmReadout with all internal pointers set to NULL
     164 */
     165pmReadout *pmReadoutAlloc(
    161166    pmCell *cell                        ///< Parent cell
    162167);
    163168
    164 /** Allocates a psCell
     169/** Allocates a pmCell
    165170 *
    166171 *  The constructor shall make an empty pmCell. If the parent chip is not NULL,
    167  *  the parent link is made and the cell shall be placed in the parentThe
    168  *  constructor shall make an empty psCell.s array of cells. The readouts
    169  *  array shall be allocated with a zero size, and the metadata containers
    170  *  constructed. All other pointers in the structure shall be initialized to
    171  *  NULL.
    172  *
    173  *  @return psCell*    newly allocated psCell
     172 *  the parent link is made and the cell shall be placed in the parents array of
     173 *  cells. The readouts array shall be allocated with a zero size, and the
     174 *  metadata containers constructed. All other pointers in the structure shall be
     175 *  initialized to NULL.
     176 *
     177 *  @return pmCell*    newly allocated pmCell
    174178 */
    175179pmCell *pmCellAlloc(
     
    198202 */
    199203pmFPA *pmFPAAlloc(
    200     const psMetadata *camera           ///< Camera configuration
    201     //    psDB *db                            ///< Database handle
    202 );
    203 
     204    const psMetadata *camera,           ///< Camera configuration
     205    psDB *db                            ///< Database handle
     206);
     207
     208
     209/** Verify parent links.
     210 *
     211 *  This function checks the validity of the parent links in the FPA hierarchy.
     212 *  If a parent link is not set (or not set correctly), it is corrected, and the
     213 *  function shall return false. If all the parent pointers were correct, the
     214 *  function shall return true.
     215 *
     216 */
     217bool pmFPACheckParents(
     218    pmFPA *fpa
     219);
     220
     221
     222
     223/** FUNC DESC
     224 *
     225 *
     226 *
     227 *
     228 */
    204229
    205230
     
    211236
    212237
    213 
    214 
    215 
    216 
    217 
    218 /** Wallace's Grommit
    219  *
    220  *  SLALib requires several elements to perform the transformations between
    221  *  the tangent plane and the sky.  Pre-computing these quantities for each
    222  *  exposure means that subsequent transformations are faster.  For historical
    223  *  reasons, this structure is known colloquially as "Wallace's Grommit".
    224  *
    225  */
    226 
    227 /*
    228 typedef struct
    229 {
    230    const double latitude;           ///< geodetic latitude (radians)
    231    const double longitude;          ///< longitude + ... (radians)
    232    const double height;             ///< height (HM)
    233    const double abberationMag;      ///< magnitude of diurnal aberration vector
    234    const double temperature;        ///< ambient temperature (TDK)
    235    const double pressure;           ///< pressure (PMB)
    236    const double humidity;           ///< relative humidity (RH)
    237    const double wavelength;         ///< wavelength (WL)
    238    const double lapseRate;          ///< lapse rate (TLR)
    239    const double refractA, refractB; ///< refraction constants A and B (radians)
    240    const double siderealTime;       ///< local apparent sidereal time (radians)
    241 }
    242 psGrommit;
    243 */
    244 
    245 
    246 /** Fixed Pattern Corrections
    247  *
    248  *  The fixed pattern is a correction to the general astrometric solution
    249  *  formed by summing the residuals from many observations. The intent is to
    250  *  correct for higher-order distortions in the camera system on a coarse
    251  *  grid (larger than individual pixels, but smaller than a single cell).
    252  *  Hence, in addition to the offsets, we need to specify the size and scale
    253  *  of the grid in x and y as well as the origin of the grid.
    254  */
    255 /*
    256 typedef struct
    257 {
    258     psS32 nX;                            ///< Number of elements in x direction
    259     psS32 nY;                            ///< Number of elements in y direction
    260     double x0;                         ///< X Position of 0,0 corner on focal plane
    261     double y0;                         ///< Y Position of 0,0 corner on focal plane
    262     double xScale;                     ///< Scale of the grid in x direction
    263     double yScale;                     ///< Scale of the grid in x direction
    264     /// XXX: I added the following memvers to facilitate the psFreeing of the x,y data structures.
    265     psS32 p_ps_xRows;                    ///< Number of rows in the x member
    266     psS32 p_ps_xCols;                    ///< Number of cols in the x member
    267     psS32 p_ps_yRows;                    ///< Number of rows in the y member
    268     psS32 p_ps_yCols;                    ///< Number of cols in the y member
    269     double **x;                        ///< The grid of offsets in x
    270     double **y;                        ///< The grid of offsets in y
    271 }
    272 psFixedPattern;
    273 */
    274 
    275 
    276 /** Observatory Information
    277  *
    278  *  A container for the observatory data that doesn't change per exposure.
    279  *
    280  */
    281 /*typedef struct
    282 {
    283     const char* name;                  ///< Name of observatory
    284     const double latitude;             ///< Latitude of observatory, east positive (degrees?)
    285     const double longitude;            ///< Longitude of observatory (degrees?)
    286     const double height;               ///< Height of observatory in meters
    287     const double tlr;                  ///< Tropospheric Lapse Rate
    288 }
    289 psObservatory;
    290 */
    291 
    292 /** Exposure Information
    293  *
    294  *  Several quantities from the telescope in order to make a first guess at
    295  *  the astrometric solution.  From these quantities, further quantities can
    296  *  be derivedand stored for later use.
    297  *
    298  */
    299 /*typedef struct psExposure
    300 {
    301     const double ra;                   ///< Telescope boresight, right ascention
    302     const double dec;                  ///< Telescope boresight, declination
    303     const double hourAngle;            ///< Hour angle
    304     const double zenithDistance;       ///< Zenith distance
    305     const double azimuth;              ///< Azimuth
    306     const psTime* time;                ///< Time of observation
    307     const float rotAngle;              ///< Rotator position angle in degrees? XXX: see bug#209
    308     const float temperature;           ///< Air temperature in Kelvin
    309     const float pressure;              ///< Air pressure in mB
    310     const float humidity;              ///< Relative humidity, for refraction
    311     const float exposureTime;          ///< Exposure time
    312     const float wavelength;            ///< Wavelength in microns
    313     const psObservatory* observatory;  ///< Observatory data
    314  
    315     // Derived quantities
    316     const double lst;                  ///< Local Sidereal Time
    317     const float positionAngle;         ///< Position angle
    318     const float parallacticAngle;      ///< Parallactic angle
    319     const float airmass;               ///< Airmass, calculated from zenith distance
    320     const float parallacticFactor;     ///< Parallactic factor
    321     const char* cameraName;            ///< name of camera which provided exposure
    322     const char* telescopeName;         ///< name of telescope which provided exposure
    323 }
    324 psExposure;
    325 */
    326 
    327 /** Allocator for psFixedPattern struct
    328  *
    329  *  Allocates a new psFixedPattern struct with the attributes coorsponding
    330  *  to the parameters set to the said input values.
    331  *
    332  *  @return psFixedPattern*     New psFixedPattern struct.
    333  */
    334 /*psFixedPattern* psFixedPatternAlloc(
    335     double x0,           ///< X Position of 0,0 corner on focal plane
    336     double y0,           ///< Y Position of 0,0 corner on focal plane
    337     double xScale,       ///< Scale of the grid in x direction
    338     double yScale,       ///< Scale of the grid in x direction
    339     const psImage *x,    ///< The grid of offsets in x
    340     const psImage *y     ///< The grid of offsets in y
    341 );
    342 */
    343 
    344 /** Allocator for psExposure
    345  *
    346  *  We need several quantities from the telescope in order to make a first
    347  *  guess at the astrometric solution. From these quantities, further
    348  *  quantities can be derived and stored for later use.
    349  *
    350  *  @return     psExposure*    New psExposure struct
    351  */
    352 /*psExposure* psExposureAlloc(
    353     double ra,                         ///< Telescope boresight, right ascention
    354     double dec,                        ///< Telescope boresight, declination
    355     double hourAngle,                  ///< Hour angle
    356     double zenithDistance,             ///< Zenith distance
    357     double azimuth,                    ///< Azimuth
    358     const psTime* time,                ///< time of observation
    359     float rotAngle,                    ///< Rotator position angle
    360     float temperature,                 ///< Temperature
    361     float pressure,                    ///< Pressure
    362     float humidity,                    ///< Relative humidity
    363     float exposureTime,                ///< Exposure time
    364     float wavelength,                  ///< wavelength
    365     const psObservatory* observatory   ///< Observatory data
    366 );
    367 */
    368 
    369 /** Allocator for psObservatory
    370  *
    371  *  This function shall construct a new psObservatory with attributes
    372  *  cooresponding to the function parameters.
    373  *
    374  *  @return psObservatory*    new psObservatory struct
    375  */
    376 /*psObservatory* psObservatoryAlloc(
    377     const char* name,                  ///< Name of observatory
    378     double latitude,                   ///< Latitude of observatory, east positive
    379     double longitude,                  ///< Longitude of observatory
    380     double height,                     ///< Height of observatory
    381     double tlr                         ///< Tropospheric Lapse Rate
    382 );
    383 */
    384 
    385 /** Allocates a Wallace's Grommit structure.
    386  *
    387  *  The psGrommit is calculated from telescope information for the particular
    388  *  exposure.
    389  *
    390  *  @return psGrommit* New grommit structure.
    391  */
    392 /*psGrommit* psGrommitAlloc(
    393     const psExposure* exp              ///< the cooresponding exposure structure.
    394 );
    395 */
    396 
    397238/** Find cooresponding cell for given FPA coordinate
    398239 *
    399  *  @return psCell*    the cell cooresponding to the coord in FPA
    400  */
    401 /*psCell* psCellInFPA(
     240 *  @return pmCell*    the cell cooresponding to the coord in FPA
     241 */
     242pmCell* pmCellInFPA(
    402243    const psPlane* coord,              ///< the coordinate in FPA plane
    403     const psFPA* FPA                   ///< the FPA to search for the cell
    404 );
    405 */
     244    const pmFPA* FPA                   ///< the FPA to search for the cell
     245);
     246
    406247
    407248/** Find cooresponding chip for given FPA coordinate
    408249 *
    409  *  @return psChip*    the chip cooresponding to coord
    410  */
    411 /*psChip* psChipInFPA(
     250 *  @return pmChip*    the chip cooresponding to coord
     251 */
     252pmChip* pmChipInFPA(
    412253    const psPlane* coord,              ///< the coordinate in FPA plane
    413     const psFPA* FPA                   ///< the FPA to search for the cell
    414 );
    415 */
     254    const pmFPA* FPA                   ///< the FPA to search for the cell
     255);
     256
    416257
    417258/** Find cooresponding cell for given Chip coordinate
    418259 *
    419  *  @return psCell*    the cell cooresponding to coord
    420  */
    421 /*psCell* psCellInChip(
     260 *  @return pmCell*    the cell cooresponding to coord
     261 */
     262pmCell* pmCellInChip(
    422263    const psPlane* coord,              ///< the coordinate in Chip plane
    423     const psChip* chip                 ///< the chip to search for the cell
    424 );
    425 */
     264    const pmChip* chip                 ///< the chip to search for the cell
     265);
     266
    426267
    427268/** Translate a cell coordinate into a chip coordinate
     
    429270 *  @return psPlane*    the resulting chip coordinate
    430271 */
    431 /*psPlane* psCoordCellToChip(
     272psPlane* psCoordCellToChip(
    432273    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    433274    const psPlane* in,                 ///< the coordinate within Cell
    434     const psCell* cell                 ///< the Cell in interest
    435 );
    436 */
     275    const pmCell* cell                 ///< the Cell in interest
     276);
     277
    437278
    438279/** Translate a chip coordinate into a FPA coordinate
     
    440281 *  @return psPlane*    the resulting FPA coordinate
    441282 */
    442 /*psPlane* psCoordChipToFPA(
     283psPlane* psCoordChipToFPA(
    443284    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    444285    const psPlane* in,                 ///< the coordinate within Chip
    445     const psChip* chip                 ///< the chip in interest
    446 );
    447 */
     286    const pmChip* chip                 ///< the chip in interest
     287);
     288
    448289
    449290/** Translate a FPA coordinate into a Tangent Plane coordinate
     
    451292 *  @return psPlane*    the resulting Tangent Plane coordinate
    452293 */
    453 /*psPlane* psCoordFPAToTP(
     294psPlane* psCoordFPAToTP(
    454295    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    455296    const psPlane* in,                 ///< the coordinate within FPA
    456297    double color,                      ///< Color of source
    457298    double magnitude,                  ///< Magnitude of source
    458     const psFPA* fpa                   ///< the FPA in interest
    459 );
    460 */
     299    const pmFPA* fpa                   ///< the FPA in interest
     300);
     301
    461302
    462303/** Translate a Tangent Plane coordinate into a Sky coordinate
     
    464305 *  @return psSphere*    the resulting Sky coordinate
    465306 */
    466 /*psSphere* psCoordTPToSky(
     307psSphere* psCoordTPToSky(
    467308    psSphere* out,                     ///< a sphere struct to recycle. If NULL, a new struct is created
    468     const psPlane* in,                 ///< the coordinate within Tangent Plane
    469     const psGrommit* grommit           ///< the grommit of the tangent plane
    470 );
    471 */
     309    const psPlane* in,                ///< the coordinate within Tangent Plane
     310    const psProjection *projection
     311);
    472312
    473313/** Translate a cell coordinate into a FPA coordinate
     
    475315 *  @return psPlane*    the resulting FPA coordinate
    476316 */
    477 /*psPlane* psCoordCellToFPA(
     317psPlane* psCoordCellToFPA(
    478318    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    479319    const psPlane* in,                 ///< the coordinate within cell
    480     const psCell* cell                 ///< the cell in interest
    481 );
    482 */
     320    const pmCell* cell                 ///< the cell in interest
     321);
     322
    483323
    484324/** Translate a cell coordinate into a Sky coordinate
     
    486326 *  @return psSphere*    the resulting Sky coordinate
    487327 */
    488 /*psSphere* psCoordCellToSky(
     328psSphere* psCoordCellToSky(
    489329    psSphere* out,                     ///< a sphere struct to recycle. If NULL, a new struct is created
    490330    const psPlane* in,                 ///< the coordinate within cell
    491331    double color,                      ///< Color of source
    492332    double magnitude,                  ///< Magnitude of source
    493     const psCell* cell                 ///< the cell in interest
    494 );
    495 */
     333    const pmCell* cell                 ///< the cell in interest
     334);
     335
    496336
    497337/** Translate a cell coordinate into a Sky coordinate using a 'quick and
     
    500340 *  @return psSphere*    the resulting Sky coordinate
    501341 */
    502 /*psSphere* psCoordCellToSkyQuick(
     342psSphere* psCoordCellToSkyQuick(
    503343    psSphere* out,                     ///< a sphere struct to recycle. If NULL, a new struct is created
    504344    const psPlane* in,                 ///< the coordinate within cell
    505     const psCell* cell                 ///< the cell in interest
    506 );
    507 */
     345    const pmCell* cell                 ///< the cell in interest
     346);
     347
    508348
    509349/** Translate a Sky coordinate into a Tangent Plane coordinate
     
    511351 *  @return psPlane*    the resulting Tangent Plane coordinate
    512352 */
    513 /*psPlane* psCoordSkyToTP(
     353psPlane* psCoordSkyToTP(
    514354    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    515355    const psSphere* in,                ///< the sky coordinate
    516     const psGrommit* grommit           ///< the grommit
    517 );
    518 */
     356    const psProjection *projection
     357);
    519358
    520359/** Translate a Tangent Plane coordinate into a FPA coordinate
     
    522361 *  @return psPlane*    the resulting FPA coordinate
    523362 */
    524 /*psPlane* psCoordTPToFPA(
     363psPlane* psCoordTPToFPA(
    525364    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    526365    const psPlane* in,                 ///< the coordinate within tangent plane
    527366    double color,                      ///< Color of source
    528367    double magnitude,                  ///< Magnitude of source
    529     const psFPA* fpa                   ///< the FPA of interest
    530 );
    531 */
     368    const pmFPA* fpa                   ///< the FPA of interest
     369);
     370
    532371
    533372/** Translate a FPA coordinate into a chip coordinate
     
    535374 *  @return psPlane*    the resulting chip coordinate
    536375 */
    537 /*psPlane* psCoordFPAToChip(
     376psPlane* psCoordFPAToChip(
    538377    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    539378    const psPlane* in,                 ///< the FPA coordinate
    540     const psChip* chip                 ///< the chip of interest
    541 );
    542 */
     379    const pmChip* chip                 ///< the chip of interest
     380);
     381
    543382
    544383/** Translate a chip coordinate into a cell coordinate
     
    546385 *  @return psPlane*    the resulting cell coordinate
    547386 */
    548 /*psPlane* psCoordChipToCell(
     387psPlane* psCoordChipToCell(
    549388    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    550389    const psPlane* in,                 ///< the Chip coordinate
    551     const psCell* cell                 ///< the cell of interest
    552 );
    553 */
     390    const pmCell* cell                 ///< the cell of interest
     391);
     392
    554393
    555394/** Translate a sky coordinate into a cell coordinate
     
    557396 *  @return psPlane*    the resulting cell coordinate
    558397 */
    559 /*psPlane* psCoordSkyToCell(
     398psPlane* psCoordSkyToCell(
    560399    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    561400    const psSphere* in,                ///< the Sky coordinate
    562     double color,                      ///< Color of source
    563     double magnitude,                  ///< Magnitude of source
    564     const psCell* cell                 ///< the cell of interest
    565 );
    566 */
     401    float color,                       ///< Color of source
     402    float magnitude,                   ///< Magnitude of source
     403    const pmCell* cell                 ///< the cell of interest
     404);
     405
    567406
    568407/** Translate a sky coordinate into a cell coordinate using a 'quick and
     
    571410 *  @return psPlane*    the resulting cell coordinate
    572411 */
    573 /*psPlane* psCoordSkyToCellQuick(
     412psPlane* psCoordSkyToCellQuick(
    574413    psPlane* out,                      ///< a plane struct to recycle. If NULL, a new struct is created
    575414    const psSphere* in,                ///< the Sky coordinate
    576     const psCell* cell                 ///< the cell of interest
    577 );
    578 */
     415    const pmCell* cell                 ///< the cell of interest
     416);
     417
    579418
    580419#endif // #ifndef PS_ASTROMETRY_H
Note: See TracChangeset for help on using the changeset viewer.