- Timestamp:
- Jun 19, 2012, 5:24:19 PM (14 years ago)
- Location:
- branches/meh_branches/ppstack_test
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
Ohana/src/relphot/include/relphot.h (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/meh_branches/ppstack_test
- Property svn:mergeinfo changed
-
branches/meh_branches/ppstack_test/Ohana/src/relphot/include/relphot.h
r31668 r34041 3 3 # include <kapa.h> 4 4 # include <signal.h> 5 # include <pthread.h> 5 6 6 7 /* # define GRID_V1 */ 7 8 # define GRID_V2 8 9 # define NO_IMAGE -100 10 11 // choose off_t or int depending on full-scale relphot analysis resources 12 // # define IDX_T off_t 13 # define IDX_T int 14 15 typedef enum { 16 MODE_NONE = 0, 17 MODE_LOAD = 1, 18 MODE_UPDATE = 2, 19 MODE_UPDATE_OBJECTS = 3, 20 } ModeType; 9 21 10 22 typedef struct { … … 15 27 float dMcal; 16 28 float dMsys; 17 short nFitPhotom;29 unsigned short nFitPhotom; 18 30 short Xm; 19 31 float secz; 20 char flags; 32 float ubercalDist; 33 unsigned int flags; 34 char skipCal; // if TRUE, this mosaic is incomplete and should not be calibrated 21 35 Coords coords; 22 36 } Mosaic; 37 38 typedef enum { 39 STATS_NONE, 40 STATS_MEAN, 41 STATS_MEDIAN, 42 STATS_WT_MEAN, 43 STATS_INNER_MEAN, 44 STATS_INNER_WTMEAN, 45 STATS_CHI_INNER_MEAN, 46 STATS_CHI_INNER_WTMEAN 47 } ListStatsMode; 23 48 24 49 typedef struct { … … 30 55 double min; 31 56 double max; 57 double Upper80; 58 double Lower20; 32 59 double total; 33 60 int Nmeas; 61 ListStatsMode statmode; 34 62 } StatType; 35 63 64 typedef struct { 65 AverageTiny *average; // array of (minimal) average data 66 MeasureTiny *measure; // array of (minimal) measure data 67 SecFilt *secfilt; // array of secfilt data (matched to average by Nsecfilt) 68 off_t Naverage; 69 off_t Nmeasure; 70 } BrightCatalog; 71 72 typedef struct { 73 float Mcal; 74 float dMcal; 75 unsigned int imageID; 76 unsigned int photom_map_id; 77 unsigned int flags; 78 unsigned int tzero; 79 unsigned char trate; 80 } ImageSubset; 81 82 typedef struct { 83 Catalog *catalog; // array of catalogs generated 84 int NCATALOG; // number of catalogs allocated 85 int Ncatalog; // number of catalogs generated 86 int Nsecfilt; // number of catalogs generated 87 off_t *NAVERAGE; // allocated Averages per catalog 88 off_t *NMEASURE; // allocated Measures per catalog 89 int *index; // lookup table catID -> catalog[i] 90 int *catIDs; // lookup table catID <- catalog[i] 91 int maxID; // max catID value to date 92 } CatalogSplitter; 93 36 94 /* 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]; 95 # define DVO_MAX_PATH 1024 96 char ImageCat[DVO_MAX_PATH]; 97 char ImageTemplate[DVO_MAX_PATH]; 98 char CatTemplate[DVO_MAX_PATH]; 99 char GSCFILE[DVO_MAX_PATH]; 100 char *CATDIR; 42 101 char CATMODE[16]; /* raw, mef, split, mysql */ 43 102 char CATFORMAT[16]; /* internal, elixir, loneos, panstarrs */ 44 char CameraConfig[256]; 45 char SKY_TABLE[256]; 103 char CameraConfig[DVO_MAX_PATH]; 104 char CAMERA[64]; /* eg, gpc1 */ 105 char SKY_TABLE[DVO_MAX_PATH]; 46 106 int SKY_DEPTH; /** XXX EAM : depth of catalog tables, fix usage */ 107 108 int HOST_ID; 109 char *HOSTDIR; 110 char *IMAGES; 111 char *BCATALOG; 112 ModeType MODE; 47 113 48 114 double MAG_LIM; … … 54 120 double MIN_ERROR; 55 121 double IMFIT_SYS_SIGMA_LIM; 122 double CLOUD_TOLERANCE; 123 124 int PARALLEL; 125 int PARALLEL_MANUAL; 126 int PARALLEL_SERIAL; 127 128 int NTHREADS; 56 129 57 130 int VERBOSE; … … 79 152 int FREEZE_MOSAICS; 80 153 int USE_GRID; 154 int KEEP_UBERCAL; 81 155 char *OUTROOT; 156 char *UPDATE_CATFORMAT; 82 157 int PLOTDELAY; 83 158 int UpdateAverages; 159 int ApplyOffsets; 160 161 char *PhotcodeList; 84 162 85 163 int RELPHOT_GRID_X; … … 101 179 double AreaXmin, AreaXmax, AreaYmin, AreaYmax; 102 180 103 int ImagSelect, ImagMin, ImagMax; 181 int ImagSelect; 182 double ImagMin, ImagMax; 104 183 105 184 int DophotSelect, DophotValue; … … 112 191 113 192 SkyRegion UserPatch; 114 int UserPatchSelect;193 char *UserCatalog; 115 194 116 195 int USE_BASIC_CHECK; … … 131 210 off_t *SelectRefMosaic PROTO((Mosaic **refmosaic, off_t *Nimage)); 132 211 int args PROTO((int argc, char **argv)); 133 int bcatalog PROTO((Catalog *subcatalog, Catalog *catalog)); 212 int args_client PROTO((int argc, char **argv)); 213 int bcatalog PROTO((Catalog *subcatalog, Catalog *catalog, int Ncat)); 134 214 void clean_images PROTO((void)); 135 void clean_measures PROTO((Catalog *catalog, int Ncatalog, int final ));215 void clean_measures PROTO((Catalog *catalog, int Ncatalog, int final, FlatCorrectionTable *flatcorr)); 136 216 void clean_mosaics PROTO((void)); 137 217 void clean_stars PROTO((Catalog *catalog, int Ncatalog)); … … 156 236 Coords *getCoords PROTO((off_t meas, int cat)); 157 237 off_t getImageEntry PROTO((off_t meas, int cat)); 158 float getMcal PROTO((off_t meas, int cat)); 238 float getMcal PROTO((off_t meas, int cat, FlatCorrectionTable *flatcorr, Catalog *catalog)); 239 float getMflat PROTO((off_t meas, int cat, FlatCorrectionTable *flatcorr, Catalog *catalog)); 159 240 float getMgrid PROTO((off_t meas, int cat)); 160 241 float getMmos PROTO((off_t meas, int cat)); 161 242 float getMrel PROTO((Catalog *catalog, off_t meas, int cat)); 243 short getUbercalDist PROTO((off_t meas, int cat)); 162 244 Image *getimage PROTO((off_t N)); 163 245 Image *getimages PROTO((off_t *N, off_t **LineNumber)); 164 void global_stats PROTO((Catalog *catalog, int Ncatalog)); 246 ImageSubset *getimages_subset PROTO((off_t *N)); 247 void global_stats PROTO((Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr)); 165 248 void initGrid PROTO((int dX, int dY)); 166 249 void initGridBins PROTO((Catalog *catalog, int Ncatalog)); 167 250 void initImageBins PROTO((Catalog *catalog, int Ncatalog, int doImageList)); 251 void initImagesSubset PROTO((ImageSubset *input, off_t *line_number, off_t N)); 168 252 void initImages PROTO((Image *input, off_t *LineNumber, off_t N)); 169 253 void initMosaicBins PROTO((Catalog *catalog, int Ncatalog, int doMosaicList)); 170 254 void initMosaicGrid PROTO((Image *image, off_t Nimage)); 171 void initMosaics PROTO((Image * image, off_t Nimage));255 void initMosaics PROTO((Image *subset, off_t Nsubset, Image *image, char *inSubset, off_t Nimage)); 172 256 void initMrel PROTO((Catalog *catalog, int Ncatalog)); 173 257 void initialize PROTO((int argc, char **argv)); 174 void initstats PROTO((char *mode)); 175 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)); 258 void initialize_client PROTO((int argc, char **argv)); 259 void liststats_setmode PROTO((StatType *stats, char *strmode)); 260 int liststats PROTO((double *value, double *dvalue, double *wvalue, int N, StatType *stats)); 261 Catalog *load_catalogs PROTO((SkyList *skylist, int *Ncatalog, int hostID, char *hostpath)); 262 Catalog *load_catalogs_parallel PROTO((SkyList *sky, int *Ncatalog)); 263 264 SkyList *load_images PROTO((FITS_DB *db, char *regionName, SkyRegion *region)); 265 Image *select_images PROTO((SkyList *skylist, Image *timage, off_t Ntimage, char *inSubset, off_t **LineNumber, off_t *Nimage, SkyRegion *region)); 179 266 180 267 int main PROTO((int argc, char **argv)); … … 185 272 void plot_chisq PROTO((Catalog *catalog, int Ncatalog)); 186 273 void plot_defaults PROTO((Graphdata *graphdata)); 187 void plot_grid PROTO((Catalog *catalog ));274 void plot_grid PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr)); 188 275 void plot_images PROTO((void)); 189 276 void plot_list PROTO((Graphdata *graphdata, double *xlist, double *ylist, int N, char *label, char *format, ...) OHANA_FORMAT(printf, 6, 7) ); 190 277 void plot_mosaic_fields PROTO((Catalog *catalog)); 191 278 void plot_mosaics PROTO((void)); 192 void plot_scatter PROTO((Catalog *catalog, int Ncatalog ));279 void plot_scatter PROTO((Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr)); 193 280 void plot_star_coords PROTO((Catalog *catalog, int Ncatalog)); 194 281 void plot_stars PROTO((Catalog *catalog, int Ncatalog)); 195 void reload_catalogs PROTO((SkyList *skylist)); 282 void reload_catalogs PROTO((SkyList *skylist, FlatCorrectionTable *flatcorr, int hostID, char *hostpath)); 283 int reload_catalogs_parallel PROTO((SkyList *sky)); 196 284 int reload_images PROTO((FITS_DB *db)); 197 int setExclusions PROTO((Catalog *catalog, int Ncatalog ));198 void setMcal PROTO((Catalog *catalog, int Poor ));285 int setExclusions PROTO((Catalog *catalog, int Ncatalog, int verbose)); 286 void setMcal PROTO((Catalog *catalog, int Poor, FlatCorrectionTable *flatcorr)); 199 287 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));288 int setMcalOutput PROTO((Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr)); 289 void setMgrid PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr)); 290 int setMmos PROTO((Catalog *catalog, int Poor, FlatCorrectionTable *flatcorr)); 291 int setMrel PROTO((Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr)); 292 void setMrelFinal PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr, int simpleAverage)); 293 int setMrelOutput PROTO((Catalog *catalog, int Ncatalog, int pass, FlatCorrectionTable *flatcorr)); 206 294 int setMave PROTO((Catalog *catalog, int Ncatalog)); 207 295 void set_ZP PROTO((double ZERO)); 208 296 int setrefcode PROTO((Image *image, off_t Nimage)); 209 void skip_measurements PROTO((Catalog *catalog, int pass ));297 void skip_measurements PROTO((Catalog *catalog, int pass, FlatCorrectionTable *flatcorr)); 210 298 void sortA PROTO((double *X, int N)); 211 299 void sortB PROTO((double *X, double *Y, int N)); … … 213 301 void sortD PROTO((double *X, double *Y, double *Z, int N)); 214 302 StatType statsImageM PROTO((Catalog *catalog)); 215 StatType statsImageN PROTO((Catalog *catalog ));303 StatType statsImageN PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr)); 216 304 StatType statsImageX PROTO((Catalog *catalog)); 217 305 StatType statsImagedM PROTO((Catalog *catalog)); 218 306 StatType statsMosaicM PROTO((Catalog *catalog)); 219 StatType statsMosaicN PROTO((Catalog *catalog ));307 StatType statsMosaicN PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr)); 220 308 StatType statsMosaicX PROTO((Catalog *catalog)); 221 309 StatType statsMosaicdM PROTO((Catalog *catalog)); 222 StatType statsStarN PROTO((Catalog *catalog, int Ncatalog, int Nsec, int seccode ));310 StatType statsStarN PROTO((Catalog *catalog, int Ncatalog, int Nsec, int seccode, FlatCorrectionTable *flatcorr)); 223 311 StatType statsStarS PROTO((Catalog *catalog, int Ncatalog, int Nsec)); 224 312 StatType statsStarX PROTO((Catalog *catalog, int Ncatalog, int Nsec)); … … 226 314 void wimages PROTO((void)); 227 315 void write_coords PROTO((Header *header, Coords *coords)); 228 int relphot_objects ( void);316 int relphot_objects (int hostID, char *hostpath); 229 317 230 318 void relphot_usage (void); 231 319 void relphot_help (int argc, char **argv); 232 320 321 void relphot_client_usage (void); 322 void relphot_client_help (int argc, char **argv); 323 233 324 off_t getImageByID (off_t ID); 234 325 … … 236 327 int LimitDensityCatalog (Catalog *subcatalog, Catalog *catalog); 237 328 238 int populate_tiny_values (Catalog *catalog); 239 int free_tiny_values (Catalog *catalog); 329 BrightCatalog *BrightCatalogLoad(char *filename); 330 int BrightCatalogSave(char *filename, BrightCatalog *catalog); 331 BrightCatalog *BrightCatalogMerge (Catalog *catalog, int Ncatalog); 332 CatalogSplitter *BrightCatalogSplitInit (int Nsecfilt); 333 int BrightCatalogSplitFree (CatalogSplitter *catalogs); 334 int BrightCatalogSplit (CatalogSplitter *catalogs, BrightCatalog *bcatalog); 335 336 int ImageSubsetSave(char *filename, ImageSubset *image, off_t Nimage); 337 ImageSubset *ImageSubsetLoad(char *filename, off_t *nimage); 338 339 int client_logger_init (); 340 int client_logger_message (char *format,...); 341
Note:
See TracChangeset
for help on using the changeset viewer.
