- Timestamp:
- Sep 11, 2014, 3:39:54 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140904/Ohana/src/libdvo/include/libdvo_astro.h
r31635 r37386 1 #ifdef notdef 2 # include "external.h" 3 # include "shell.h" 4 # include "dvomath.h" 5 # include "convert.h" 6 # include "display.h" 7 # include "data.h" 8 #endif 1 # ifndef LIBDVO_ASTRO_H 2 # define LIBDVO_ASTRO_H 9 3 10 # ifndef ASTRO_H 11 # define ASTRO_H 4 typedef enum { 5 COORD_NONE, 6 COORD_CELESTIAL, 7 COORD_GALACTIC, 8 COORD_ECLIPTIC 9 } CoordTransformSystem; 12 10 13 void InitAstro (void); 14 void FreeAstro (void); 11 typedef enum { 12 PROJ_NONE, // undefined 13 PROJ_ZEA, // zenithal 14 PROJ_ZPL, // zenithal 15 PROJ_ARC, // zenithal 16 PROJ_STG, // zenithal 17 PROJ_SIN, // zenithal 18 PROJ_TAN, // zenithal 19 PROJ_TNX, // zenithal 20 PROJ_DIS, // zenithal (TAN + polyterms) 21 PROJ_LIN, // cartesian 22 PROJ_PLY, // cartesian (allow polyterms) 23 PROJ_WRP, // cartesian (allow polyterms, require mosaic) 24 PROJ_AIT, // pseudocyl 25 PROJ_GLS, // pseudocyl 26 PROJ_PAR, // pseudocyl 27 } OhanaProjection; 28 29 typedef enum { 30 PROJ_MODE_NONE, 31 PROJ_MODE_CARTESIAN, 32 PROJ_MODE_ZENITHAL, 33 PROJ_MODE_PSEUDOCYL, 34 } OhanaProjectionMode; 15 35 16 36 typedef struct { … … 29 49 } CoordTransform; 30 50 31 typedef enum {COORD_NONE, COORD_CELESTIAL, COORD_GALACTIC, COORD_ECLIPTIC} CoordTransformSystem; 51 typedef struct { 52 int Nx; 53 int Ny; 54 float dX; 55 float dY; 56 float **dXv; 57 float **dYv; 58 unsigned int ID; 59 unsigned int imageID; 60 } AstromOffsetMap; 61 62 typedef struct { 63 int Nmap; 64 AstromOffsetMap *map; 65 int *IDtoSeq; 66 int MaxID; 67 } AstromOffsetTable; 68 69 /* Internal version of Coords (see CoordsDisk in libautocode/def/coords-disk.d) */ 70 typedef struct Coords { 71 double crval1; // coordinate at reference pixel 72 double crval2; // coordinate at reference pixel 73 float crpix1; // coordinate of reference pixel 74 float crpix2; // coordinate of reference pixel 75 float cdelt1; // degrees per pixel 76 float cdelt2; // degrees per pixel 77 float pc1_1; // rotation matrix 78 float pc1_2; // rotation matrix 79 float pc2_1; // rotation matrix 80 float pc2_2; // rotation matrix 81 float polyterms[7][2]; // higher order warping terms 82 char ctype[15]; // coordinate type 83 char Npolyterms; // order of polynomial 84 struct Coords *mosaic; // pointer to parent mosaic 85 AstromOffsetMap *offsetMap; // pointer to offset map transformation 86 } Coords; 87 88 typedef struct Image { 89 Coords coords; // astrometric data 90 e_time tzero; // readout time (row 0) 91 unsigned int nstar; // number of stars on image 92 float secz; // airmass (mag) 93 unsigned short NX; // image width 94 unsigned short NY; // image height 95 float apmifit; // aperture correction (mag) 96 float dapmifit; // apmifit error (mag) 97 float Mcal; // calibration mag (mag) 98 float dMcal; // error on Mcal (mag) 99 short Xm; // image chisq (10*log(value)) 100 short photcode; // identifier for CCD, 101 float exptime; // exposure time (seconds) 102 float sidtime; // sidereal time of exposure 103 float latitude; // observatory latitude (degrees) 104 float RAo; // image center (degrees) 105 float DECo; // image center (degrees) 106 float Radius; // image radius (degrees) 107 float refColorBlue; // median astrometry ref color 108 float refColorRed; // median astrometry ref color 109 char name[117]; // name of original image 110 unsigned char detection_limit; // detection limit (10*mag) 111 unsigned char saturation_limit; // saturation limit (10*mag) 112 unsigned char cerror; // astrometric error (50*arcsec) 113 unsigned char fwhm_x; // PSF x width (25*arcsec) 114 unsigned char fwhm_y; // PSF y width (25*arcsec) 115 unsigned char trate; // scan rate (100 usec/pixel) 116 unsigned char ccdnum; // CCD ID number 117 unsigned int flags; // image quality flags 118 unsigned int imageID; // internal image ID 119 unsigned int parentID; // associated ref image 120 unsigned int externID; // external image ID 121 unsigned short sourceID; // analysis source ID 122 short nLinkAstrom; // mean number of matched measurements for astrometry 123 short nLinkPhotom; // mean number of matched measurements for astrometry 124 short ubercalDist; // distance to nearest ubercal image 125 float dXpixSys; // systematic astrometry error in X 126 float dYpixSys; // systematic astrometry error in Y 127 float dMagSys; // systematic photometry error 128 unsigned short nFitAstrom; // number of stars used for astrometry cal 129 unsigned short nFitPhotom; // number of stars used for photometry cal 130 unsigned int photom_map_id; // reference to 2D zero point map 131 unsigned int astrom_map_id; // reference to 2D astrometry map 132 struct Image *parent; // pointer to parent mosaic (not save to disk) 133 } Image; 32 134 33 135 CoordTransform *InitTransform (CoordTransformSystem input, CoordTransformSystem output); 34 136 int ApplyTransform (double *x, double *y, double X, double Y, CoordTransform *transform); 35 137 138 /* in coords.c */ 139 void InitCoords (Coords *coords, char *projection); 140 int XY_to_LM (double *L, double *M, double x, double y, Coords *coords); 141 int LM_to_XY (double *x, double *y, double L, double M, Coords *coords); 142 int RD_to_LM (double *L, double *M, double ra, double dec, Coords *coords); 143 int LM_to_RD (double *ra, double *dec, double L, double M, Coords *coords); 144 int XY_to_RD (double *ra, double *dec, double x, double y, Coords *coords); 145 int RD_to_XY (double *x, double *y, double ra, double dec, Coords *coords); 146 int fXY_to_RD (float *ra, float *dec, double x, double y, Coords *coords); 147 int fRD_to_XY (float *x, float *y, double ra, double dec, Coords *coords); 148 int GetCoords (Coords *coords, Header *header); 149 int PutCoords (Coords *coords, Header *header); 150 void coords_precess (double *ra, double *dec, double in_epoch, double out_epoch); 151 OhanaProjection GetProjection (char *ctype); 152 int SetProjection (char *ctype, OhanaProjection proj); 153 OhanaProjectionMode GetProjectionMode (OhanaProjection proj); 154 155 /* in AstromOffsetMapIO.c */ 156 AstromOffsetTable *AstromOffsetMapLoad (char *filename, int VERBOSE); 157 int AstromOffsetMapSave (AstromOffsetTable *table, char *filename); 158 AstromOffsetTable *AstromOffsetMapToTable(AstromOffsetMap_Disk_6x6 *map_disk, off_t Nmap); 159 AstromOffsetMap_Disk_6x6 *AstromOffsetTableToMap(AstromOffsetTable *table, off_t *Nmap); 160 161 /* in AstromOffsetMapOps.c */ 162 float AstromOffsetMapValue (AstromOffsetMap *map, float x, float y, int xdir); 163 int AstromOffsetMapFit (AstromOffsetMap *map, float *x, float *y, float *f, int Npts, int xdir); 164 36 165 # endif
Note:
See TracChangeset
for help on using the changeset viewer.
