Changeset 33117
- Timestamp:
- Jan 18, 2012, 1:47:30 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20111122/Ohana/src/relphot
- Files:
-
- 12 edited
-
doc/flatcorr.txt (modified) (1 diff)
-
include/relphot.h (modified) (5 diffs)
-
src/GridOps.c (modified) (6 diffs)
-
src/ImageOps.c (modified) (4 diffs)
-
src/MosaicOps.c (modified) (4 diffs)
-
src/StarOps.c (modified) (12 diffs)
-
src/global_stats.c (modified) (3 diffs)
-
src/plot_scatter.c (modified) (2 diffs)
-
src/reload_catalogs.c (modified) (2 diffs)
-
src/relphot.c (modified) (11 diffs)
-
src/relphot_objects.c (modified) (1 diff)
-
src/setMrelFinal.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/Ohana/src/relphot/doc/flatcorr.txt
r33100 r33117 1 2 2012.01.18 3 4 I have updated libdvo to define a flatcorr table, and have the APIs to 5 read and write the table. I have also updated setphot to load the 6 ubercal measurements and to define the flatcorr table and links (from 7 image -> flatcorr). Now I need to understand where to include this in 8 relphot. 9 10 One option would be to include it as part of the function 'getMcal'. 11 This function goes from (cat,meas) -> (image) to find the image zero 12 point (Mcal). It could also check for a photom_map_id value for that 13 image, and include that in the calculation (if it exists). 14 15 16 Another option would be to add a new function (getMmap or something) 17 and to include this essentially everywhere getMcal is called. 1 18 2 19 2012.01.13 -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/include/relphot.h
r31668 r33117 133 133 int bcatalog PROTO((Catalog *subcatalog, Catalog *catalog)); 134 134 void clean_images PROTO((void)); 135 void clean_measures PROTO((Catalog *catalog, int Ncatalog, int final ));135 void clean_measures PROTO((Catalog *catalog, int Ncatalog, int final, FlatCorrectionTable *flatcorr)); 136 136 void clean_mosaics PROTO((void)); 137 137 void clean_stars PROTO((Catalog *catalog, int Ncatalog)); … … 156 156 Coords *getCoords PROTO((off_t meas, int cat)); 157 157 off_t getImageEntry PROTO((off_t meas, int cat)); 158 float getMcal PROTO((off_t meas, int cat ));158 float getMcal PROTO((off_t meas, int cat, FlatCorrectionTable *flatcorr, Catalog *catalog)); 159 159 float getMgrid PROTO((off_t meas, int cat)); 160 160 float getMmos PROTO((off_t meas, int cat)); … … 162 162 Image *getimage PROTO((off_t N)); 163 163 Image *getimages PROTO((off_t *N, off_t **LineNumber)); 164 void global_stats PROTO((Catalog *catalog, int Ncatalog ));164 void global_stats PROTO((Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr)); 165 165 void initGrid PROTO((int dX, int dY)); 166 166 void initGridBins PROTO((Catalog *catalog, int Ncatalog)); … … 185 185 void plot_chisq PROTO((Catalog *catalog, int Ncatalog)); 186 186 void plot_defaults PROTO((Graphdata *graphdata)); 187 void plot_grid PROTO((Catalog *catalog ));187 void plot_grid PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr)); 188 188 void plot_images PROTO((void)); 189 189 void plot_list PROTO((Graphdata *graphdata, double *xlist, double *ylist, int N, char *label, char *format, ...) OHANA_FORMAT(printf, 6, 7) ); 190 190 void plot_mosaic_fields PROTO((Catalog *catalog)); 191 191 void plot_mosaics PROTO((void)); 192 void plot_scatter PROTO((Catalog *catalog, int Ncatalog ));192 void plot_scatter PROTO((Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr)); 193 193 void plot_star_coords PROTO((Catalog *catalog, int Ncatalog)); 194 194 void plot_stars PROTO((Catalog *catalog, int Ncatalog)); 195 void reload_catalogs PROTO((SkyList *skylist ));195 void reload_catalogs PROTO((SkyList *skylist, FlatCorrectionTable *flatcorr)); 196 196 int reload_images PROTO((FITS_DB *db)); 197 197 int setExclusions PROTO((Catalog *catalog, int Ncatalog)); 198 198 void setMcal PROTO((Catalog *catalog, int Poor)); 199 199 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 ));200 int setMcalOutput PROTO((Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr)); 201 void setMgrid PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr)); 202 int setMmos PROTO((Catalog *catalog, int Poor, FlatCorrectionTable *flatcorr)); 203 int setMrel PROTO((Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr)); 204 void setMrelFinal PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr)); 205 int setMrelOutput PROTO((Catalog *catalog, int Ncatalog, int mark, FlatCorrectionTable *flatcorr)); 206 206 int setMave PROTO((Catalog *catalog, int Ncatalog)); 207 207 void set_ZP PROTO((double ZERO)); 208 208 int setrefcode PROTO((Image *image, off_t Nimage)); 209 void skip_measurements PROTO((Catalog *catalog, int pass ));209 void skip_measurements PROTO((Catalog *catalog, int pass, FlatCorrectionTable *flatcorr)); 210 210 void sortA PROTO((double *X, int N)); 211 211 void sortB PROTO((double *X, double *Y, int N)); … … 213 213 void sortD PROTO((double *X, double *Y, double *Z, int N)); 214 214 StatType statsImageM PROTO((Catalog *catalog)); 215 StatType statsImageN PROTO((Catalog *catalog ));215 StatType statsImageN PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr)); 216 216 StatType statsImageX PROTO((Catalog *catalog)); 217 217 StatType statsImagedM PROTO((Catalog *catalog)); 218 218 StatType statsMosaicM PROTO((Catalog *catalog)); 219 StatType statsMosaicN PROTO((Catalog *catalog ));219 StatType statsMosaicN PROTO((Catalog *catalog, FlatCorrectionTable *flatcorr)); 220 220 StatType statsMosaicX PROTO((Catalog *catalog)); 221 221 StatType statsMosaicdM PROTO((Catalog *catalog)); 222 StatType statsStarN PROTO((Catalog *catalog, int Ncatalog, int Nsec, int seccode ));222 StatType statsStarN PROTO((Catalog *catalog, int Ncatalog, int Nsec, int seccode, FlatCorrectionTable *flatcorr)); 223 223 StatType statsStarS PROTO((Catalog *catalog, int Ncatalog, int Nsec)); 224 224 StatType statsStarX PROTO((Catalog *catalog, int Ncatalog, int Nsec)); -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/GridOps.c
r31450 r33117 284 284 285 285 /* direct (non-iterative) solution for Mgrid values for all grid bins */ 286 void setMgridDirect (Catalog *catalog, int Ncatalog ) {286 void setMgridDirect (Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr) { 287 287 288 288 int **gotstar, **gridmeas; … … 399 399 400 400 // skip images marked as BAD 401 Mcal = getMcal (m, c );401 Mcal = getMcal (m, c, flatcorr, catalog); 402 402 if (isnan(Mcal)) { 403 403 Ncal ++; … … 522 522 523 523 /* determine Mgrid values for all grid bins */ 524 void setMgrid (Catalog *catalog ) {524 void setMgrid (Catalog *catalog, FlatCorrectionTable *flatcorr) { 525 525 526 526 int i, j, m, c, n, N, Nmax, Nbad, Nmos, Ncal, Nrel, Nsys, Nfit; … … 554 554 continue; 555 555 } 556 Mcal = getMcal (m, c );556 Mcal = getMcal (m, c, flatcorr, catalog); 557 557 if (isnan(Mcal)) { 558 558 Ncal ++; … … 609 609 } 610 610 611 void plot_grid (Catalog *catalog ) {611 void plot_grid (Catalog *catalog, FlatCorrectionTable *flatcorr) { 612 612 613 613 int i, j, m, c, n, N, Narea; … … 641 641 continue; 642 642 } 643 Mcal = getMcal (m, c );643 Mcal = getMcal (m, c, flatcorr, catalog); 644 644 if (isnan(Mcal)) continue; 645 645 Mmos = getMmos (m, c); -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/ImageOps.c
r33101 r33117 253 253 } 254 254 255 float getMcal (off_t meas, int cat ) {255 float getMcal (off_t meas, int cat, FlatCorrectionTable *flatcorr, Catalog *catalog) { 256 256 257 257 off_t i; 258 float value ;258 float value, offset; 259 259 260 260 i = MeasureToImage[cat][meas]; … … 263 263 if (image[i].flags & IMAGE_BAD) return (NAN); 264 264 value = image[i].Mcal; 265 offset = 0.0; 266 267 // to do this, I need to pass in the catalog and flatcorr pointers 268 int flat_id = image[i].photom_map_id; 269 if (flat_id) { 270 offset = FlatCorrectionOffset (flatcorr, flat_id, catalog[cat].measure[meas].Xccd, catalog[cat].measure[meas].Yccd); 271 } 272 value += offset; 273 265 274 return (value); 266 275 } … … 493 502 } 494 503 495 StatType statsImageN (Catalog *catalog ) {504 StatType statsImageN (Catalog *catalog, FlatCorrectionTable *flatcorr) { 496 505 497 506 off_t i, j, m, c, n, N; … … 516 525 c = ImageToCatalog[i][j]; 517 526 518 Mcal = getMcal (m, c );527 Mcal = getMcal (m, c, flatcorr, catalog); 519 528 if (isnan(Mcal)) continue; 520 529 Mmos = getMmos (m, c); -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/MosaicOps.c
r33101 r33117 376 376 } 377 377 378 int setMmos (Catalog *catalog, int PoorImages ) {378 int setMmos (Catalog *catalog, int PoorImages, FlatCorrectionTable *flatcorr) { 379 379 380 380 off_t i, j, m, c, N, Nmax; … … 425 425 continue; 426 426 } 427 Mcal = getMcal (m, c );427 Mcal = getMcal (m, c, flatcorr, catalog); 428 428 if (isnan(Mcal)) { 429 429 Ncal++; … … 745 745 } 746 746 747 StatType statsMosaicN (Catalog *catalog ) {747 StatType statsMosaicN (Catalog *catalog, FlatCorrectionTable *flatcorr) { 748 748 749 749 off_t i, j, m, c, n, N; … … 769 769 c = MosaicToCatalog[i][j]; 770 770 771 Mcal = getMcal (m, c );771 Mcal = getMcal (m, c, flatcorr, catalog); 772 772 if (isnan(Mcal)) continue; 773 773 Mgrid = getMgrid (m, c); -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/StarOps.c
r31668 r33117 47 47 } 48 48 49 int setMrel (Catalog *catalog, int Ncatalog ) {49 int setMrel (Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr) { 50 50 51 51 off_t j, k, m; … … 88 88 Mcal = Mmos = Mgrid = 0; 89 89 } else { 90 Mcal = getMcal (m, i );90 Mcal = getMcal (m, i, flatcorr, catalog); 91 91 if (isnan(Mcal)) { 92 92 Ncal ++; … … 144 144 } 145 145 146 int setMrelOutput (Catalog *catalog, int Ncatalog, int mark ) {146 int setMrelOutput (Catalog *catalog, int Ncatalog, int mark, FlatCorrectionTable *flatcorr) { 147 147 148 148 int i, N; … … 190 190 Mcal = Mmos = Mgrid = 0; 191 191 } else { 192 Mcal = getMcal (m, i );192 Mcal = getMcal (m, i, flatcorr, catalog); 193 193 if (isnan(Mcal)) continue; 194 194 Mmos = getMmos (m, i); … … 253 253 254 254 // update average photometry for each of the average filters 255 256 // XXX Note that this would be faster if we had an array of results and accumulated 257 // them in a single pass 258 255 259 for (Ns = 0; Ns < Nsecfilt; Ns++) { 256 260 … … 353 357 354 358 /* set measure.Mcal for all measures except ID_MEAS_NOCAL and ID_IMAGE_PHOTOM_NOCAL */ 355 int setMcalOutput (Catalog *catalog, int Ncatalog ) {359 int setMcalOutput (Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr) { 356 360 357 361 int i; … … 368 372 for (k = 0; k < catalog[i].averageT[j].Nmeasure; k++, m++) { 369 373 if (catalog[i].measureT[m].dbFlags & MEAS_BAD) continue; 370 Mcal = getMcal (m, i );374 Mcal = getMcal (m, i, flatcorr, catalog); 371 375 if (isnan(Mcal)) continue; 372 376 Mmos = getMmos (m, i); … … 456 460 # define NSIGMA_CLIP 3.0 457 461 # define NSIGMA_REJECT 5.0 458 void clean_measures (Catalog *catalog, int Ncatalog, int final ) {462 void clean_measures (Catalog *catalog, int Ncatalog, int final, FlatCorrectionTable *flatcorr) { 459 463 460 464 off_t j, k, m, Nmax, Ndel, Nave; … … 510 514 511 515 /* if (catalog[i].measureT[m].dbFlags & MEAS_BAD) continue; */ 512 Mcal = getMcal (m, i );516 Mcal = getMcal (m, i, flatcorr, catalog); 513 517 if (isnan(Mcal)) { Ncal ++; continue; } 514 518 Mmos = getMmos (m, i); … … 554 558 555 559 /* if (catalog[i].measureT[m].dbFlags & MEAS_BAD) continue; */ 556 Mcal = getMcal (m, i );560 Mcal = getMcal (m, i, flatcorr, catalog); 557 561 if (isnan(Mcal)) continue; 558 562 Mmos = getMmos (m, i); … … 593 597 } 594 598 595 StatType statsStarN (Catalog *catalog, int Ncatalog, int Nsec, int seccode ) {599 StatType statsStarN (Catalog *catalog, int Ncatalog, int Nsec, int seccode, FlatCorrectionTable *flatcorr) { 596 600 597 601 off_t j, k, m, Ntot; … … 625 629 int ecode = GetPhotcodeEquivCodebyCode (catalog[i].measureT[m].photcode); 626 630 if (ecode != seccode) { continue;} 627 Mcal = getMcal (m, i );631 Mcal = getMcal (m, i, flatcorr, catalog); 628 632 if (isnan(Mcal)) { continue;} 629 633 Mmos = getMmos (m, i); -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/global_stats.c
r31450 r33117 1 1 # include "relphot.h" 2 2 3 void global_stats (Catalog *catalog, int Ncatalog ) {3 void global_stats (Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr) { 4 4 5 5 StatType stN, stX, stS, imN, imX, imM, imD, msM, msX, msN, msD; … … 17 17 int seccode = photcodes[Ns][0].code; 18 18 19 stN = statsStarN (catalog, Ncatalog, Nsec, seccode );19 stN = statsStarN (catalog, Ncatalog, Nsec, seccode, flatcorr); 20 20 stX = statsStarX (catalog, Ncatalog, Nsec); 21 21 stS = statsStarS (catalog, Ncatalog, Nsec); … … 27 27 } 28 28 29 imN = statsImageN (catalog );29 imN = statsImageN (catalog, flatcorr); 30 30 imX = statsImageX (catalog); 31 31 imM = statsImageM (catalog); 32 32 imD = statsImagedM (catalog); 33 33 34 msN = statsMosaicN (catalog );34 msN = statsMosaicN (catalog, flatcorr); 35 35 msM = statsMosaicM (catalog); 36 36 msD = statsMosaicdM (catalog); -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/plot_scatter.c
r31450 r33117 1 1 # include "relphot.h" 2 2 3 void plot_scatter (Catalog *catalog, int Ncatalog ) {3 void plot_scatter (Catalog *catalog, int Ncatalog, FlatCorrectionTable *flatcorr) { 4 4 5 5 off_t i, j, k, m, N, Ntot; … … 40 40 41 41 if (catalog[i].measureT[m].dbFlags & MEAS_BAD) continue; 42 Mcal = getMcal (m, i );42 Mcal = getMcal (m, i, flatcorr, catalog); 43 43 if (isnan(Mcal)) continue; 44 44 Mmos = getMmos (m, i); -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/reload_catalogs.c
r31668 r33117 7 7 gettimeofday (&start, (void *) NULL); 8 8 9 void reload_catalogs (SkyList *skylist ) {9 void reload_catalogs (SkyList *skylist, FlatCorrectionTable *flatcorr) { 10 10 11 11 int i; … … 69 69 TIMESTAMP(time4); 70 70 71 setMrelFinal (&catalog );71 setMrelFinal (&catalog, flatcorr); 72 72 TIMESTAMP(time5); 73 73 -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/relphot.c
r31668 r33117 1 1 # include "relphot.h" 2 # define USE_DIRECT 03 4 # define TIMESTAMP(TIME) \5 gettimeofday (&stop, (void *) NULL); \6 dtime = DTIME (stop, start); \7 TIME += dtime; \8 gettimeofday (&start, (void *) NULL);9 2 10 3 # define MARKTIME(MSG,...) { \ … … 24 17 gettimeofday (&start, (void *) NULL); 25 18 26 // XXX quick and stupid test:27 if (0) {28 int i, j;29 off_t *Nlist, *NLIST, **mlist;30 off_t *NlistI, *NLISTI, **mlistI;31 int **clist;32 int **clistI;33 float dtime;34 float time1 = 0.0;35 float time2 = 0.0;36 37 int Nmosaic = 10000;38 int Nimage = 600000;39 40 for (j = 0; j < 19000; j++) {41 42 // mosaic indexes43 ALLOCATE (Nlist, off_t, Nmosaic);44 ALLOCATE (NLIST, off_t, Nmosaic);45 ALLOCATE (clist, int *, Nmosaic);46 ALLOCATE (mlist, off_t *, Nmosaic);47 48 for (i = 0; i < Nmosaic; i++) {49 Nlist[i] = 0;50 NLIST[i] = 100;51 ALLOCATE (clist[i], int, NLIST[i]);52 ALLOCATE (mlist[i], off_t, NLIST[i]);53 }54 55 // image indexes56 ALLOCATE (NlistI, off_t, Nimage);57 ALLOCATE (NLISTI, off_t, Nimage);58 ALLOCATE (clistI, int *, Nimage);59 ALLOCATE (mlistI, off_t *, Nimage);60 61 for (i = 0; i < Nimage; i++) {62 NlistI[i] = 0;63 NLISTI[i] = 100;64 ALLOCATE (clistI[i], int, NLISTI[i]);65 ALLOCATE (mlistI[i], off_t, NLISTI[i]);66 }67 68 TIMESTAMP(time1);69 70 // free mosaic indexes71 for (i = 0; i < Nmosaic; i++) {72 free (clist[i]);73 free (mlist[i]);74 }75 free (Nlist);76 free (NLIST);77 free (clist);78 free (mlist);79 80 // free image indexes81 for (i = 0; i < Nimage; i++) {82 free (clistI[i]);83 free (mlistI[i]);84 }85 free (NlistI);86 free (NLISTI);87 free (clistI);88 free (mlistI);89 90 TIMESTAMP(time2);91 92 if (j % 100 == 0) {93 fprintf (stderr, "done with %d\n", j);94 fprintf (stderr, "time1 %f : init mosaic\n", time1);95 fprintf (stderr, "time2 %f : free mosaic\n", time2);96 }97 }98 99 fprintf (stderr, "time1 %f : init mosaic\n", time1);100 fprintf (stderr, "time2 %f : free mosaic\n", time2);101 exit (1);102 }103 104 19 /* get configuration info, args */ 105 20 initialize (argc, argv); … … 125 40 // LCK_EMPTY (if UPDATE) or LCK_MISSING (if !UPDATE) 126 41 if ((db.dbstate == LCK_EMPTY) || (db.dbstate == LCK_MISSING)) { 127 // XXX get ZERO_POINT from config 128 dvo_image_create (&db, 25.0); 129 // Shutdown ("ERROR: No images in catalog %s (1)", db.filename); 42 43 // 25.0 is the nominal zero point for measurements in the database 44 // for all measurements except PHOT_REF: 45 // measure.M contains: -2.5*log(DN) + 2.5*log(exptime) + 25.0 46 // for measurements using PHOT_REF: 47 // measure.M contains: -2.5*log(DN) + 2.5*log(exptime) + True Zero Point (but exptime and ZP are known) 48 dvo_image_create (&db, 25.0); 49 50 // XXX why are we running relphot on an empty database? 130 51 } else { 131 52 if (!dvo_image_load (&db, VERBOSE, FALSE)) Shutdown ("can't read image catalog %s", db.filename); … … 143 64 if (!UPDATE) dvo_image_unlock (&db); 144 65 66 // load the flat correction table (if defined) 67 char flatcorrfile[256]; 68 sprintf (flatcorrfile, "%s/flatcorr.fits", CATDIR); 69 FlatCorrectionTable *flatcorr = FlatCorrectionLoad (flatcorrfile, VERBOSE); 70 145 71 /* load catalog data from region files */ 146 72 catalog = load_catalogs (skylist, &Ncatalog); … … 167 93 setExclusions (catalog, Ncatalog); 168 94 169 global_stats (catalog, Ncatalog );95 global_stats (catalog, Ncatalog, flatcorr); 170 96 171 97 if (PLOTSTUFF) { … … 184 110 for (i = 0; i < NGRID; i++) { 185 111 STAR_BAD = ID_STAR_POOR; 186 setMrel (catalog, Ncatalog );112 setMrel (catalog, Ncatalog, flatcorr); 187 113 STAR_BAD = ID_STAR_POOR | ID_STAR_FEW; 188 setMgrid (catalog );114 setMgrid (catalog, flatcorr); 189 115 } 190 116 STAR_BAD = ID_STAR_POOR | ID_STAR_FEW; … … 194 120 /* determine fit values */ 195 121 for (i = 0; i < NLOOP; i++) { 196 setMrel (catalog, Ncatalog );122 setMrel (catalog, Ncatalog, flatcorr); 197 123 setMcal (catalog, FALSE); 198 setMmos (catalog, FALSE );199 setMgrid (catalog );124 setMmos (catalog, FALSE, flatcorr); 125 setMgrid (catalog, flatcorr); 200 126 201 127 if (PLOTSTUFF) { 202 plot_scatter (catalog, Ncatalog );203 plot_grid (catalog );128 plot_scatter (catalog, Ncatalog, flatcorr); 129 plot_grid (catalog, flatcorr); 204 130 plot_mosaics (); 205 131 plot_images (); … … 209 135 // if (i < NLOOP - 1) rationalize_mosaics (catalog, Ncatalog); 210 136 // if (i % 6 == 1) rationalize_images (); 211 if (i % 6 == 2) clean_measures (catalog, Ncatalog, FALSE );137 if (i % 6 == 2) clean_measures (catalog, Ncatalog, FALSE, flatcorr); 212 138 if (i % 6 == 3) clean_stars (catalog, Ncatalog); 213 139 if (i % 6 == 5) clean_mosaics (); … … 218 144 // if ((i == 4) || (i == 8) || (i == 12) || (i == 16)) clean_mosaics (); 219 145 // if ((i == 4) || (i == 8) || (i == 12) || (i == 16)) clean_images (); 220 global_stats (catalog, Ncatalog );146 global_stats (catalog, Ncatalog, flatcorr); 221 147 MARKTIME("-- finished loop %d: %f sec\n", i, dtime); 222 148 } 223 149 224 150 if (PLOTSTUFF) { 225 plot_scatter (catalog, Ncatalog );226 plot_grid (catalog );151 plot_scatter (catalog, Ncatalog, flatcorr); 152 plot_grid (catalog, flatcorr); 227 153 plot_mosaics (); 228 154 plot_images (); … … 235 161 /* set Mcal & Mmos for bad images */ 236 162 setMcal (catalog, TRUE); 237 setMmos (catalog, TRUE );163 setMmos (catalog, TRUE, flatcorr); 238 164 MARKTIME("-- finalize Mcal values: %f sec\n", dtime); 239 165 … … 309 235 310 236 /* load catalog data from region files, update Mrel include all data */ 311 reload_catalogs (skylist );237 reload_catalogs (skylist, flatcorr); 312 238 MARKTIME("-- updated all catalogs: %f sec\n", dtime); 313 239 -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/relphot_objects.c
r31450 r33117 1 1 # include "relphot.h" 2 3 // apply the current calibration values to the measurements to determine the average 4 // magnitudes, applying the desired clipping analysis. Note that this does not depend on 5 // the form of the image zero point measurement. If there is a grid or map term, and this 6 // has been correctly propagated to the measurement, the average will respect that value. 2 7 3 8 int relphot_objects () { -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/setMrelFinal.c
r31450 r33117 5 5 // output dbFlags values 6 6 7 void setMrelFinal (Catalog *catalog ) {7 void setMrelFinal (Catalog *catalog, FlatCorrectionTable *flatcorr) { 8 8 9 9 off_t i, j, m; … … 60 60 61 61 for (i = 0; i < 5; i++) { 62 skip_measurements (catalog, i ); /* set ID_MEAS_SKIP for measures to be skipped */63 setMrelOutput (catalog, 1, FALSE ); /* set Mrel using all measures not skipped */64 clean_measures (catalog, 1, TRUE ); /* mark outliers ID_MEAS_POOR_PHOTOM */65 setMrelOutput (catalog, 1, TRUE ); /* set Mrel using remaining measures */62 skip_measurements (catalog, i, flatcorr); /* set ID_MEAS_SKIP for measures to be skipped */ 63 setMrelOutput (catalog, 1, FALSE, flatcorr); /* set Mrel using all measures not skipped */ 64 clean_measures (catalog, 1, TRUE, flatcorr); /* mark outliers ID_MEAS_POOR_PHOTOM */ 65 setMrelOutput (catalog, 1, TRUE, flatcorr); /* set Mrel using remaining measures */ 66 66 } 67 setMcalOutput (catalog, 1 );67 setMcalOutput (catalog, 1, flatcorr); 68 68 69 69 int Nsecfilt = GetPhotcodeNsecfilt (); … … 86 86 87 87 /* ID_MEAS_SKIP marks measurements which were not used to calculate Mrel */ 88 void skip_measurements (Catalog *catalog, int pass ) {88 void skip_measurements (Catalog *catalog, int pass, FlatCorrectionTable *flatcorr) { 89 89 90 90 off_t i, k, m; … … 134 134 /* skip measurements from BAD images and mosaics */ 135 135 /* do NOT skip measurements without a matching image */ 136 if (isnan(getMcal (m, 0 ))) goto skip;136 if (isnan(getMcal (m, 0, flatcorr, catalog))) goto skip; 137 137 if (isnan(getMmos (m, 0))) goto skip; 138 138
Note:
See TracChangeset
for help on using the changeset viewer.
