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