Changeset 4500 for trunk/Ohana/src/libohana/include/dvo.h
- Timestamp:
- Jul 7, 2005, 6:55:53 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/libohana/include/dvo.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/libohana/include/dvo.h
r4026 r4500 4 4 # define DVO_H 5 5 6 /*** FITS DB structure ***/ 7 typedef struct { 8 FILE *f; 9 char *filename; 10 int dbstate; 11 int lockstate; 12 double timeout; 13 Header header; 14 Matrix matrix; 15 Header theader; 16 FTable ftable; 17 } FITS_DB; 18 19 # if (0) 20 /* the standard astrometric coordinates structure */ 21 typedef struct { 22 double crval1, crval2; 23 float crpix1, crpix2; 24 float cdelt1, cdelt2; 25 float pc1_1, pc1_2; 26 float pc2_1, pc2_2; 27 float polyterms[7][2]; 28 char ctype[15]; 29 char Npolyterms; 30 } Coords; /* 120 bytes / Coords */ 31 # endif 32 33 /* in fits_db.c */ 34 int fits_db_init PROTO((FITS_DB *db)); 35 int fits_db_create PROTO((FITS_DB *db)); 36 int fits_db_lock PROTO((FITS_DB *db, char *filename)); 37 int fits_db_load PROTO((FITS_DB *db)); 38 int fits_db_close PROTO((FITS_DB *db)); 39 int fits_db_free PROTO((FITS_DB *db)); 40 int fits_db_save PROTO((FITS_DB *db)); 41 int fits_db_update PROTO((FITS_DB *db, VTable *vtable)); 42 43 /* in coords.c, using libautocode/def/coords.d */ 44 int XY_to_RD (double *ra, double *dec, double x, double y, Coords *coords); 45 int RD_to_XY (double *x, double *y, double ra, double dec, Coords *coords); 46 int fXY_to_RD (float *ra, float *dec, double x, double y, Coords *coords); 47 int fRD_to_XY (float *x, float *y, double ra, double dec, Coords *coords); 48 int GetCoords (Coords *coords, Header *header); 49 int PutCoords (Coords *coords, Header *header); 50 void RegisterMosaic (Coords *coords); 51 void coords_precess (double *ra, double *dec, double in_epoch, double out_epoch); 6 /*** named data values (convert all to enums?) ***/ 52 7 53 8 /* image data modes in RegImage */ … … 55 10 enum {M_UNDEF = -1, M_NONE, M_MEF, M_SPLIT, M_SINGLE, M_CUBE, M_SLICE, M_MODES, N_MODE}; 56 11 57 /* convert these to enums? */58 12 /* RegImage.flag values */ 59 13 # define IMREG_DIST 0x01 /* image distributed, only imregister-3.0 */ … … 93 47 # define ID_MEAS_TRAIL 0x2000 94 48 # define ID_MEAS_GHOST 0x4000 49 50 /* some subtle distinctions between the blend flags: 51 BLEND_IMAGE: the star on an image is matched with more 52 than one star in the catalog (image has worse seeing than catalog) 53 BLEND_CATALOG: the star in the catalog is matched with more 54 than one star on the image (image has better seeing than catalog) 55 CALIBRATED: relative photometry has been performed on this measurement 56 BLEND_IMAGE_NEIGHBOR: the star on an image is matched with more 57 than one star in the catalog, but not in the same catalog file. 58 */ 95 59 96 60 /* Average.code values */ … … 109 73 # define ID_COSMIC 0xc004 /* 0x8000 + 0x4000 + 0x0004 */ 110 74 111 /* 112 BLEND_IMAGE: the star on an image is matched with more 113 than one star in the catalog (image has worse seeing than catalog) 114 BLEND_CATALOG: the star in the catalog is matched with more 115 than one star on the image (image has better seeing than catalog) 116 CALIBRATED: relative photometry has been performed on this measurement 117 BLEND_IMAGE_NEIGHBOR: the star on an image is matched with more 118 than one star in the catalog, but not in the same catalog file. 119 */ 120 121 /** we are going to replace these with autocode and appropriate conversions 122 for now, choose the appropriate table version **/ 123 124 # define ELIXIR 1 125 # define LONEOS 0 126 # define PANSTARRS 0 127 128 # if (LONEOS) 129 # include <loneos.h> 130 # endif 131 132 # if (ELIXIR) 133 # include <elixir.h> 134 # endif 135 136 # if (PANSTARRS) 137 # include <panstarrs.h> 138 # endif 139 140 /* these functions refer to the DVO structures defined in the includes above 141 * they are being replaced with autocode entries 75 /*** general dvo structures (internal use only / not IO) ***/ 76 77 /* FITS DB structure */ 78 typedef struct { 79 FILE *f; 80 char *filename; 81 int dbstate; 82 int lockstate; 83 double timeout; 84 Header header; 85 Matrix matrix; 86 Header theader; 87 FTable ftable; 88 } FITS_DB; 89 90 /* structure for data on a catalog region */ 91 typedef struct { 92 char filename[256]; 93 double DEC[2], RA[2]; 94 } GSCRegion; 95 96 typedef struct { 97 int Ncode; 98 int Nsecfilt; 99 int hashcode[0x10000]; 100 int hashNsec[0x10000]; 101 PhotCode *code; 102 } PhotCodeData; 103 104 /* a catalog contains this data */ 105 typedef struct { 106 /* data in the file: */ 107 Average *average; 108 Measure *measure; 109 Missing *missing; 110 SecFilt *secfilt; 111 Header header; 112 int Naverage, Nmeasure, Nmissing, Nsecfilt; 113 /* description of the catalog file: */ 114 char *filename; 115 int lockmode; 116 FILE *f; 117 /* pointers for data manipulation */ 118 int *found; 119 int *image; 120 int *mosaic; 121 float *X; 122 float *Y; 123 } Catalog; 124 125 /*** prototypes ***/ 126 127 /* in fits_db.c */ 128 int fits_db_init PROTO((FITS_DB *db)); 129 int fits_db_create PROTO((FITS_DB *db)); 130 int fits_db_lock PROTO((FITS_DB *db, char *filename)); 131 int fits_db_load PROTO((FITS_DB *db)); 132 int fits_db_close PROTO((FITS_DB *db)); 133 int fits_db_free PROTO((FITS_DB *db)); 134 int fits_db_save PROTO((FITS_DB *db)); 135 int fits_db_update PROTO((FITS_DB *db, VTable *vtable)); 136 137 /* in coords.c, using libautocode/def/coords.d */ 138 int XY_to_RD (double *ra, double *dec, double x, double y, Coords *coords); 139 int RD_to_XY (double *x, double *y, double ra, double dec, Coords *coords); 140 int fXY_to_RD (float *ra, float *dec, double x, double y, Coords *coords); 141 int fRD_to_XY (float *x, float *y, double ra, double dec, Coords *coords); 142 int GetCoords (Coords *coords, Header *header); 143 int PutCoords (Coords *coords, Header *header); 144 void RegisterMosaic (Coords *coords); 145 void coords_precess (double *ra, double *dec, double in_epoch, double out_epoch); 146 147 int lock_catalog (Catalog *catalog, int lockmode); 148 int unlock_catalog (Catalog *catalog); 149 int load_catalog (Catalog *catalog, char mode, int VERBOSE); 150 int save_catalog (Catalog *catalog, char VERBOSE); 151 152 int FindMosaicForImage (Image *images, int Nimages, int entry); 153 int FindMosaicForImage_TableSearch (Image *images, int Nimages, int entry); 154 int FindMosaicForImage_MatchSearch (Image *images, int Nimages, int entry); 155 int BuildChipMatch (Image *images, int Nimages); 156 157 short int putMi (double value); 158 double getMi (short int value); 159 void returnMcal (Image *image, double *c); 160 void assignMcal (Image *image, double *c, int order); 161 double applyMcal (Image *image, double x, double y); 162 double findscatter (double *X, double *Y, double *M, double *dM, int N, double *c, int order); 163 164 PhotCode *GetPhotcodebyName (char *name); 165 PhotCode *GetPhotcodeEquivbyName (char *name); 166 PhotCode *GetPhotcodebyCode (int code); 167 PhotCode *GetPhotcodeEquivbyCode (int code); 168 char *GetPhotcodeNamebyCode (int code); 169 170 double PhotInst (Measure *measure); 171 double PhotAbs (Measure *measure); 172 double PhotCat (Measure *measure); 173 double PhotSys (Measure *measure, Average *average, SecFilt *secfilt); 174 double PhotRel (Measure *measure, Average *average, SecFilt *secfilt); 175 double PhotCal (Measure *thisone, Average *average, SecFilt *secfilt, Measure *measure, PhotCode *code); 176 double PhotAve (PhotCode *code, Average *average, SecFilt *secfilt); 177 double PhotRef (PhotCode *code, Average *average, SecFilt *secfilt, Measure *measure); 178 double PhotXm (PhotCode *code, Average *average, SecFilt *secfilt); 179 double PhotdM (PhotCode *code, Average *average, SecFilt *secfilt); 180 181 short iPhotInst (Measure *measure); 182 short iPhotAbs (Measure *measure); 183 short iPhotCat (Measure *measure); 184 short iPhotSys (Measure *measure, Average *average, SecFilt *secfilt); 185 short iPhotRel (Measure *measure, Average *average, SecFilt *secfilt); 186 short iPhotCal (Measure *thisone, Average *average, SecFilt *secfilt, Measure *measure, PhotCode *code); 187 short iPhotAve (PhotCode *code, Average *average, SecFilt *secfilt); 188 short iPhotRef (PhotCode *code, Average *average, SecFilt *secfilt, Measure *measure); 189 short iPhotXm (PhotCode *code, Average *average, SecFilt *secfilt); 190 short iPhotdM (PhotCode *code, Average *average, SecFilt *secfilt); 191 192 short iPhotColor (Average *average, SecFilt *secfilt, Measure *measure, PhotCode *code); 193 int PhotColor (Average *average, SecFilt *secfilt, Measure *measure, int c1, int c2, double *color); 194 195 int LoadPhotcodes (char *filename); 196 int GetPhotcodeCodebyName (char *name); 197 int GetPhotcodeEquivCodebyName (char *name); 198 int GetPhotcodeEquivCodebyCode (int code); 199 int GetPhotcodeNsec (int code); 200 int GetPhotcodeNsecfilt (); 201 void SetZeroPoint (double ZP); 202 int *GetPhotcodeEquivList (int code, int *nlist); 203 void ParseColorTerms (char *terms, float *X, int *N); 204 205 int get_image_type (char *name); 206 char *get_type_name (int type); 207 int get_image_mode (char *name); 208 char *get_mode_name (int mode); 209 210 /* these functions refer to the DVO structures defined in the includes above 211 * they are being replaced with autocode entries (drop when totally autocoded) 142 212 */ 143 213
Note:
See TracChangeset
for help on using the changeset viewer.
