- Timestamp:
- May 21, 2021, 10:03:06 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/relphot.20210521/src/relphot_images.c
r41556 r41603 54 54 FlatCorrectionTable *flatcorr = NULL; 55 55 56 initGridBins (); // allocates the empty array of corrections (elements are build below) 57 56 58 if (CALIBRATE_STACKS_AND_WARPS || (NLOOP > 0)) { 57 59 /* load catalog data from region files (hostID is 0 since we are not a client */ … … 68 70 initTGroupBins (catalog, Ncatalog); 69 71 70 initGridBins (catalog, Ncatalog);71 72 initMrel (catalog, Ncatalog); 72 73 … … 74 75 MARKTIME("-- set up image indexes: %f sec\n", dtime); 75 76 76 findMosaics (catalog, Ncatalog, TRUE); /* also sets Grid values */77 findMosaics (catalog, Ncatalog, TRUE); 77 78 MARKTIME("-- set up mosaic indexes: %f sec\n", dtime); 78 79 79 80 findTGroups (catalog, Ncatalog); 80 81 MARKTIME("-- set up mosaic indexes: %f sec\n", dtime); 82 83 initGrid (); // allocate grid correction entries for existing photcodes 81 84 82 85 SAVEPLOT = FALSE; … … 91 94 } 92 95 93 // if we are measuring the flat-field correction grid, we need to perform a number of iterations first:94 if (USE_GRID) {95 int star_toofew;96 97 // until we finish the grid analysis, do not reject stars out-of-hand based on ID_OBJ_FEW98 // XXX this is kind of poor: need to have a better distinctions about STAR_BAD in setMrel vs getMrel99 star_toofew = STAR_TOOFEW;100 STAR_TOOFEW = 0;101 for (i = 0; i < NGRID; i++) {102 STAR_BAD = ID_OBJ_POOR;103 setMrel (catalog, Ncatalog, flatcorr);104 STAR_BAD = ID_OBJ_POOR | ID_OBJ_FEW;105 setMgrid (catalog, flatcorr);106 }107 STAR_BAD = ID_OBJ_POOR | ID_OBJ_FEW;108 STAR_TOOFEW = star_toofew;109 }110 111 96 /* determine fit values */ 112 97 for (i = 0; i < NLOOP; i++) { … … 119 104 setMgrp (catalog, flatcorr); 120 105 121 setMgrid (catalog, flatcorr);106 setMgrid (catalog, Ncatalog); 122 107 MARKTIME("-- set Mrel, Mcal, Mmos, Mgrid : %f sec\n", dtime); 123 108 124 109 if (PLOTSTUFF) { 125 110 plot_scatter (catalog, Ncatalog, flatcorr); 126 plot_grid (catalog, flatcorr);127 111 plot_mosaics (); 128 112 plot_images (); … … 140 124 if (PLOTSTUFF) { 141 125 plot_scatter (catalog, Ncatalog, flatcorr); 142 plot_grid (catalog, flatcorr);143 126 plot_mosaics (); 144 127 plot_images (); … … 147 130 } 148 131 149 if (USE_GRID) dump_grid ();132 // if (GRID_ZEROPT) dump_grid (); 150 133 151 134 MARKTIME("-- finalize Mcal values: %f sec\n", dtime); … … 169 152 freeMosaicBins (Ncatalog, TRUE); 170 153 freeTGroupBins (Ncatalog); 171 freeGridBins (Ncatalog);172 173 154 // end of if (NLOOP > 0) block : this loop determines the offsets per chip 174 155 } else { … … 205 186 freeImages (db.ftable.buffer); 206 187 freeMosaics (); 188 freeGridBins (); 189 207 190 gfits_db_free (&db); 208 191
Note:
See TracChangeset
for help on using the changeset viewer.
