pmAstrometryWCS.h

Go to the documentation of this file.
00001 /* @file  pmAstrometryDistortion.h
00002  * @brief functions to convert FITS WCS keywords to / from pmFPA structures
00003  *
00004  * @author EAM, IfA
00005  *
00006  * @version $Revision: 1.9 $ $Name:  $
00007  * @date $Date: 2007/01/24 02:54:14 $
00008  * Copyright 2006 Institute for Astronomy, University of Hawaii
00009  */
00010 
00011 #ifndef PM_ASTROMETRY_WCS_H
00012 #define PM_ASTROMETRY_WCS_H
00013 
00014 /// @addtogroup Astrometry
00015 /// @{
00016 
00017 #define PM_ASTROM_WCS_TYPE_SIZE 80
00018 typedef struct
00019 {
00020     char ctype1[PM_ASTROM_WCS_TYPE_SIZE];
00021     char ctype2[PM_ASTROM_WCS_TYPE_SIZE];
00022     double crval1, crval2;
00023     double crpix1, crpix2;
00024     double cdelt1, cdelt2;
00025     psProjection *toSky;
00026     psPlaneTransform *trans;
00027 }
00028 pmAstromWCS;
00029 
00030 // support function for the pmAstromWCS representation
00031 pmAstromWCS *pmAstromWCSAlloc (int nXorder, int nYorder);
00032 bool pmAstromWCStoSky (psSphere *sky, pmAstromWCS *wcs, psPlane *chip);
00033 bool pmAstromWCStoChip (psPlane *chip, pmAstromWCS *wcs, psSphere *sky);
00034 
00035 // read and write the pmAstromWCS representation to the header
00036 bool pmAstromWCStoHeader (psMetadata *header, const pmAstromWCS *wcs);
00037 pmAstromWCS *pmAstromWCSfromHeader (const psMetadata *header);
00038 
00039 // convert from wcs terms to chip->toFPA, fpa->toSky,toTPA terms
00040 bool pmAstromWCSBileveltoChip (pmChip *chip, const pmAstromWCS *wcs);
00041 bool pmAstromWCSBileveltoFPA (pmFPA *fpa, const pmAstromWCS *wcs);
00042 
00043 // convert from chip->toFPA, fpa->toSky,toTPA terms to wcs terms
00044 pmAstromWCS *pmAstromWCSBilevelChipFromFPA (const pmChip *chip, double tol);
00045 pmAstromWCS *pmAstromWCSBilevelMosaicFromFPA (const pmFPA *fpa, double tol);
00046 
00047 // convert the pmAstromWCS representation to the FPA representation
00048 bool pmAstromWCStoFPA (pmFPA *fpa, pmChip *chip, const pmAstromWCS *wcs, double plateScale);
00049 pmAstromWCS *pmAstromWCSfromFPA (const pmFPA *fpa, const pmChip *chip, double tol);
00050 
00051 // read wcs terms from the supplied header into the fpa hierarchy components
00052 bool pmAstromReadWCS (pmFPA *fpa, pmChip *chip, const psMetadata *header, double plateScale);
00053 
00054 // write the wcs terms from the fpa hierarchy components into the supplied header
00055 // tol is the convergence tolerance for the non-linear solution to the reference pixel
00056 bool pmAstromWriteWCS (psMetadata *header, const pmFPA *fpa, const pmChip *chip, double tol);
00057 
00058 bool pmAstromReadBilevelChip (pmChip *chip, const psMetadata *header);
00059 bool pmAstromReadBilevelMosaic (pmFPA *fpa, const psMetadata *header);
00060 
00061 bool pmAstromWriteBilevelChip (psMetadata *header, const pmChip *chip, double tol);
00062 bool pmAstromWriteBilevelMosaic (psMetadata *header, const pmFPA *fpa, double tol);
00063 
00064 // move to pslib
00065 psPlaneDistort *psPlaneDistortIdentity (int order);
00066 bool psPlaneDistortIsDiagonal (psPlaneDistort *distort);
00067 
00068 # define PM_DEG_RAD 57.295779513082322
00069 # define PM_RAD_DEG  0.017453292519943
00070 
00071 /// @}
00072 #endif // PM_ASTROMETRY_WCS_H
00073 
00074 /*
00075  * the wcs->trans component defines a polynomial which converts (x-crpix1),(y-crpix2) to
00076  * L,M in degrees
00077  */

Generated on Fri Feb 2 22:35:28 2007 for Pan-STARRS Module Library by  doxygen 1.5.1