Changeset 14787
- Timestamp:
- Sep 7, 2007, 11:00:34 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20070830/psphot/src/psphotImageMedian.c
r14729 r14787 80 80 PS_STAT_FITTED_MEAN | 81 81 PS_STAT_FITTED_MEAN_V2 | 82 PS_STAT_FITTED_MEAN_V3))) { 82 PS_STAT_FITTED_MEAN_V3 | 83 PS_STAT_FITTED_MEAN_V4))) { 83 84 statsOptionLocation = PS_STAT_FITTED_MEAN; 84 85 } … … 101 102 } else if (statsOptionLocation & PS_STAT_FITTED_MEAN_V3) { 102 103 statsOptionWidth = PS_STAT_FITTED_STDEV_V3; 104 } else if (statsOptionLocation & PS_STAT_FITTED_MEAN_V4) { 105 statsOptionWidth = PS_STAT_FITTED_STDEV_V4; 103 106 } else { 104 107 psAbort("Unable to estimate variance of selected statsOptionLocations 0x%x", statsOptionLocation); … … 196 199 // XXX don't bother trying if there are no valid pixels... 197 200 198 if (psImageBackground(stats, subset, submask, maskVal, rng)) { 201 psVector *sample = NULL; 202 203 if (psImageBackground(stats, &sample, subset, submask, maskVal, rng)) { 199 204 if (stats->options & PS_STAT_ROBUST_QUARTILE) { 200 205 modelData[iy][ix] = stats->robustMedian; … … 203 208 } 204 209 modelStdevData[iy][ix] = psStatsGetValue(stats, statsOptionWidth); 210 211 // supply sample to plotting routing 212 psphotDiagnosticPlots (config, "IMAGE.BACKGROUND.CELL.HISTOGRAM", ix, iy, modelData[iy][ix], modelStdevData[iy][ix], sample); 213 psFree (sample); 205 214 } else { 206 215 psStatsOptions currentOptions = stats->options; 207 216 stats->options = PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV; 208 if (!psImageBackground(stats, subset, submask, maskVal, rng)) {217 if (!psImageBackground(stats, &sample, subset, submask, maskVal, rng)) { 209 218 psLogMsg ("psphot", PS_LOG_WARN, "Failed to estimate background using ROBUST_MEDIAN for " 210 219 "(%dx%d, (row0,col0) = (%d,%d)", … … 214 223 modelData[iy][ix] = psStatsGetValue (stats, PS_STAT_ROBUST_MEDIAN); 215 224 modelStdevData[iy][ix] = psStatsGetValue(stats, PS_STAT_ROBUST_STDEV); 225 226 // supply sample to plotting routing 227 psphotDiagnosticPlots (config, "IMAGE.BACKGROUND.CELL.HISTOGRAM", ix, iy, modelData[iy][ix], modelStdevData[iy][ix], sample); 228 psFree (sample); 216 229 } 217 230 // drop errors caused by psImageBackground failures … … 224 237 psFree (submask); 225 238 } 239 } 240 241 if (psTraceGetLevel("psphot") > 5) { 242 char name[256]; 243 sprintf (name, "backraw.%02d.fits", npass); 244 psphotSaveImage (NULL, model->image, name); 226 245 } 227 246
Note:
See TracChangeset
for help on using the changeset viewer.
