Changeset 33651 for trunk/Ohana/src/relphot/include/relphot.h
- Timestamp:
- Apr 1, 2012, 2:48:41 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/relphot/include/relphot.h (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/relphot/include/relphot.h
r31668 r33651 7 7 # define GRID_V2 8 8 # define NO_IMAGE -100 9 10 // choose off_t or int depending on full-scale relphot analysis resources 11 // # define IDX_T off_t 12 # define IDX_T int 13 14 typedef enum { 15 MODE_NONE = 0, 16 MODE_LOAD = 1, 17 MODE_UPDATE = 2, 18 MODE_UPDATE_OBJECTS = 3, 19 } ModeType; 9 20 10 21 typedef struct { … … 18 29 short Xm; 19 30 float secz; 20 char flags; 31 float ubercalDist; 32 unsigned int flags; 21 33 Coords coords; 22 34 } Mosaic; … … 30 42 double min; 31 43 double max; 44 double Upper80; 45 double Lower20; 32 46 double total; 33 47 int Nmeas; 34 48 } StatType; 35 49 50 typedef struct { 51 AverageTiny *average; // array of (minimal) average data 52 MeasureTiny *measure; // array of (minimal) measure data 53 SecFilt *secfilt; // array of secfilt data (matched to average by Nsecfilt) 54 off_t Naverage; 55 off_t Nmeasure; 56 } BrightCatalog; 57 58 typedef struct { 59 float Mcal; 60 float dMcal; 61 unsigned int imageID; 62 unsigned int photom_map_id; 63 unsigned int flags; 64 unsigned int tzero; 65 unsigned char trate; 66 } ImageSubset; 67 68 typedef struct { 69 Catalog *catalog; // array of catalogs generated 70 int NCATALOG; // number of catalogs allocated 71 int Ncatalog; // number of catalogs generated 72 int Nsecfilt; // number of catalogs generated 73 off_t *NAVERAGE; // allocated Averages per catalog 74 off_t *NMEASURE; // allocated Measures per catalog 75 int *index; // lookup table catID -> catalog[i] 76 int *catIDs; // lookup table catID <- catalog[i] 77 int maxID; // max catID value to date 78 } CatalogSplitter; 79 36 80 /* global variables set in parameter file */ 37 char ImageCat[256]; 38 char ImageTemplate[256]; 39 char CatTemplate[256]; 40 char GSCFILE[256]; 41 char CATDIR[256]; 81 # define MAX_PATH_LENGTH 1024 82 char ImageCat[MAX_PATH_LENGTH]; 83 char ImageTemplate[MAX_PATH_LENGTH]; 84 char CatTemplate[MAX_PATH_LENGTH]; 85 char GSCFILE[MAX_PATH_LENGTH]; 86 char *CATDIR; 42 87 char CATMODE[16]; /* raw, mef, split, mysql */ 43 88 char CATFORMAT[16]; /* internal, elixir, loneos, panstarrs */ 44 char CameraConfig[256]; 45 char SKY_TABLE[256]; 89 char CameraConfig[MAX_PATH_LENGTH]; 90 char CAMERA[64]; /* eg, gpc1 */ 91 char SKY_TABLE[MAX_PATH_LENGTH]; 46 92 int SKY_DEPTH; /** XXX EAM : depth of catalog tables, fix usage */ 93 94 int HOST_ID; 95 char *HOSTDIR; 96 char *IMAGES; 97 char *BCATALOG; 98 ModeType MODE; 47 99 48 100 double MAG_LIM; … … 54 106 double MIN_ERROR; 55 107 double IMFIT_SYS_SIGMA_LIM; 108 double CLOUD_TOLERANCE; 109 110 int PARALLEL; 111 int PARALLEL_MANUAL; 112 int PARALLEL_SERIAL; 56 113 57 114 int VERBOSE; … … 79 136 int FREEZE_MOSAICS; 80 137 int USE_GRID; 138 int KEEP_UBERCAL; 81 139 char *OUTROOT; 140 char *UPDATE_CATFORMAT; 82 141 int PLOTDELAY; 83 142 int UpdateAverages; 143 144 char *PhotcodeList; 84 145 85 146 int RELPHOT_GRID_X; … … 101 162 double AreaXmin, AreaXmax, AreaYmin, AreaYmax; 102 163 103 int ImagSelect, ImagMin, ImagMax; 164 int ImagSelect; 165 double ImagMin, ImagMax; 104 166 105 167 int DophotSelect, DophotValue; … … 112 174 113 175 SkyRegion UserPatch; 114 int UserPatchSelect;176 char *UserCatalog; 115 177 116 178 int USE_BASIC_CHECK; … … 131 193 off_t *SelectRefMosaic PROTO((Mosaic **refmosaic, off_t *Nimage)); 132 194 int args PROTO((int argc, char **argv)); 195 int args_client PROTO((int argc, char **argv)); 133 196 int bcatalog PROTO((Catalog *subcatalog, Catalog *catalog)); 134 197 void clean_images PROTO((void)); 135 void clean_measures PROTO((Catalog *catalog, int Ncatalog, int final ));198 void clean_measures PROTO((Catalog *catalog, int Ncatalog, int final, FlatCorrectionTable *flatcorr)); 136 199 void clean_mosaics PROTO((void)); 137 200 void clean_stars PROTO((Catalog *catalog, int Ncatalog)); … … 156 219 Coords *getCoords PROTO((off_t meas, int cat)); 157 220 off_t getImageEntry PROTO((off_t meas, int cat)); 158 float getMcal PROTO((off_t meas, int cat)); 221 float getMcal PROTO((off_t meas, int cat, FlatCorrectionTable *flatcorr, Catalog *catalog)); 222 float getMflat PROTO((off_t meas, int cat, FlatCorrectionTable *flatcorr, Catalog *catalog)); 159 223 float getMgrid PROTO((off_t meas, int cat)); 160 224 float getMmos PROTO((off_t meas, int cat)); 161 225 float getMrel PROTO((Catalog *catalog, off_t meas, int cat)); 226 short getUbercalDist PROTO((off_t meas, int cat)); 162 227 Image *getimage PROTO((off_t N)); 163 228 Image *getimages PROTO((off_t *N, off_t **LineNumber)); 164 void global_stats PROTO((Catalog *catalog, int Ncatalog)); 229 ImageSubset *getimages_subset PROTO((off_t *N)); 230 void global_stats PROTO((Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr)); 165 231 void initGrid PROTO((int dX, int dY)); 166 232 void initGridBins PROTO((Catalog *catalog, int Ncatalog)); 167 233 void initImageBins PROTO((Catalog *catalog, int Ncatalog, int doImageList)); 234 void initImagesSubset PROTO((ImageSubset *input, off_t *line_number, off_t N)); 168 235 void initImages PROTO((Image *input, off_t *LineNumber, off_t N)); 169 236 void initMosaicBins PROTO((Catalog *catalog, int Ncatalog, int doMosaicList)); … … 172 239 void initMrel PROTO((Catalog *catalog, int Ncatalog)); 173 240 void initialize PROTO((int argc, char **argv)); 241 void initialize_client PROTO((int argc, char **argv)); 174 242 void initstats PROTO((char *mode)); 175 243 int liststats PROTO((double *value, double *dvalue, int N, StatType *stats)); 176 Catalog *load_catalogs PROTO((SkyList *skylist, int *Ncatalog)); 177 SkyList *load_images PROTO((FITS_DB *db, char *regionName, SkyRegion *region, int RegionSelect)); 178 Image *select_images PROTO((SkyList *skylist, Image *timage, off_t Ntimage, off_t **LineNumber, off_t *Nimage)); 244 Catalog *load_catalogs PROTO((SkyList *skylist, int *Ncatalog, int hostID, char *hostpath)); 245 Catalog *load_catalogs_parallel PROTO((SkyList *sky, int *Ncatalog)); 246 247 SkyList *load_images PROTO((FITS_DB *db, char *regionName, SkyRegion *region)); 248 Image *select_images PROTO((SkyList *skylist, Image *timage, off_t Ntimage, off_t **LineNumber, off_t *Nimage)); 179 249 180 250 int main PROTO((int argc, char **argv)); … … 185 255 void plot_chisq PROTO((Catalog *catalog, int Ncatalog)); 186 256 void plot_defaults PROTO((Graphdata *graphdata)); 187 void plot_grid PROTO((Catalog *catalog ));257 void plot_grid PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr)); 188 258 void plot_images PROTO((void)); 189 259 void plot_list PROTO((Graphdata *graphdata, double *xlist, double *ylist, int N, char *label, char *format, ...) OHANA_FORMAT(printf, 6, 7) ); 190 260 void plot_mosaic_fields PROTO((Catalog *catalog)); 191 261 void plot_mosaics PROTO((void)); 192 void plot_scatter PROTO((Catalog *catalog, int Ncatalog ));262 void plot_scatter PROTO((Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr)); 193 263 void plot_star_coords PROTO((Catalog *catalog, int Ncatalog)); 194 264 void plot_stars PROTO((Catalog *catalog, int Ncatalog)); 195 void reload_catalogs PROTO((SkyList *skylist)); 265 void reload_catalogs PROTO((SkyList *skylist, FlatCorrectionTable *flatcorr, int hostID, char *hostpath)); 266 int reload_catalogs_parallel PROTO((SkyList *sky)); 196 267 int reload_images PROTO((FITS_DB *db)); 197 int setExclusions PROTO((Catalog *catalog, int Ncatalog ));198 void setMcal PROTO((Catalog *catalog, int Poor ));268 int setExclusions PROTO((Catalog *catalog, int Ncatalog, int verbose)); 269 void setMcal PROTO((Catalog *catalog, int Poor, FlatCorrectionTable *flatcorr)); 199 270 void setMcalFinal PROTO((void)); 200 int setMcalOutput PROTO((Catalog *catalog, int Ncatalog ));201 void setMgrid PROTO((Catalog *catalog ));202 int setMmos PROTO((Catalog *catalog, int Poor ));203 int setMrel PROTO((Catalog *catalog, int Ncatalog ));204 void setMrelFinal PROTO((Catalog *catalog ));205 int setMrelOutput PROTO((Catalog *catalog, int Ncatalog, int mark));271 int setMcalOutput PROTO((Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr)); 272 void setMgrid PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr)); 273 int setMmos PROTO((Catalog *catalog, int Poor, FlatCorrectionTable *flatcorr)); 274 int setMrel PROTO((Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr)); 275 void setMrelFinal PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr)); 276 int setMrelOutput PROTO((Catalog *catalog, int Ncatalog, int pass, FlatCorrectionTable *flatcorr)); 206 277 int setMave PROTO((Catalog *catalog, int Ncatalog)); 207 278 void set_ZP PROTO((double ZERO)); 208 279 int setrefcode PROTO((Image *image, off_t Nimage)); 209 void skip_measurements PROTO((Catalog *catalog, int pass ));280 void skip_measurements PROTO((Catalog *catalog, int pass, FlatCorrectionTable *flatcorr)); 210 281 void sortA PROTO((double *X, int N)); 211 282 void sortB PROTO((double *X, double *Y, int N)); … … 213 284 void sortD PROTO((double *X, double *Y, double *Z, int N)); 214 285 StatType statsImageM PROTO((Catalog *catalog)); 215 StatType statsImageN PROTO((Catalog *catalog ));286 StatType statsImageN PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr)); 216 287 StatType statsImageX PROTO((Catalog *catalog)); 217 288 StatType statsImagedM PROTO((Catalog *catalog)); 218 289 StatType statsMosaicM PROTO((Catalog *catalog)); 219 StatType statsMosaicN PROTO((Catalog *catalog ));290 StatType statsMosaicN PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr)); 220 291 StatType statsMosaicX PROTO((Catalog *catalog)); 221 292 StatType statsMosaicdM PROTO((Catalog *catalog)); 222 StatType statsStarN PROTO((Catalog *catalog, int Ncatalog, int Nsec, int seccode ));293 StatType statsStarN PROTO((Catalog *catalog, int Ncatalog, int Nsec, int seccode, FlatCorrectionTable *flatcorr)); 223 294 StatType statsStarS PROTO((Catalog *catalog, int Ncatalog, int Nsec)); 224 295 StatType statsStarX PROTO((Catalog *catalog, int Ncatalog, int Nsec)); … … 226 297 void wimages PROTO((void)); 227 298 void write_coords PROTO((Header *header, Coords *coords)); 228 int relphot_objects ( void);299 int relphot_objects (int hostID, char *hostpath); 229 300 230 301 void relphot_usage (void); 231 302 void relphot_help (int argc, char **argv); 232 303 304 void relphot_client_usage (void); 305 void relphot_client_help (int argc, char **argv); 306 233 307 off_t getImageByID (off_t ID); 234 308 … … 236 310 int LimitDensityCatalog (Catalog *subcatalog, Catalog *catalog); 237 311 238 int populate_tiny_values (Catalog *catalog); 239 int free_tiny_values (Catalog *catalog); 312 BrightCatalog *BrightCatalogLoad(char *filename); 313 int BrightCatalogSave(char *filename, BrightCatalog *catalog); 314 BrightCatalog *BrightCatalogMerge (Catalog *catalog, int Ncatalog); 315 CatalogSplitter *BrightCatalogSplitInit (int Nsecfilt); 316 int BrightCatalogSplitFree (CatalogSplitter *catalogs); 317 int BrightCatalogSplit (CatalogSplitter *catalogs, BrightCatalog *bcatalog); 318 319 int ImageSubsetSave(char *filename, ImageSubset *image, off_t Nimage); 320 ImageSubset *ImageSubsetLoad(char *filename, off_t *nimage);
Note:
See TracChangeset
for help on using the changeset viewer.
