Changeset 17568
- Timestamp:
- May 7, 2008, 2:04:11 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotModelBackground.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotModelBackground.c
r16820 r17568 163 163 // XXX don't bother trying if there are no valid pixels... 164 164 165 psVector *sample = NULL;166 167 // turn on stats tracing in desired cells168 # if (0)169 psMetadata *plots = psMetadataLookupPtr (&status, recipe, "DIAGNOSTIC.PLOTS");170 assert (plots);171 172 int xPlot = psMetadataLookupS32 (&status, plots, "IMAGE.BACKGROUND.CELL.HISTOGRAM.X");173 assert (status);174 int yPlot = psMetadataLookupS32 (&status, plots, "IMAGE.BACKGROUND.CELL.HISTOGRAM.Y");175 assert (status);176 177 bool gotX = (xPlot < 0) || (xPlot == ix);178 bool gotY = (yPlot < 0) || (yPlot == iy);179 180 if (gotX && gotY) {181 psTraceSetLevel ("psLib.math.vectorFittedStats_v4", 6);182 psTraceSetLevel ("psLib.math.vectorRobustStats", 6);183 } else {184 psTraceSetLevel ("psLib.math.vectorFittedStats_v4", 0);185 psTraceSetLevel ("psLib.math.vectorRobustStats", 0);186 } 187 # endif165 psVector *sample = NULL; 166 167 // turn on stats tracing in desired cells 168 # if (0) 169 psMetadata *plots = psMetadataLookupPtr (&status, recipe, "DIAGNOSTIC.PLOTS"); 170 assert (plots); 171 172 int xPlot = psMetadataLookupS32 (&status, plots, "IMAGE.BACKGROUND.CELL.HISTOGRAM.X"); 173 assert (status); 174 int yPlot = psMetadataLookupS32 (&status, plots, "IMAGE.BACKGROUND.CELL.HISTOGRAM.Y"); 175 assert (status); 176 177 bool gotX = (xPlot < 0) || (xPlot == ix); 178 bool gotY = (yPlot < 0) || (yPlot == iy); 179 180 if (gotX && gotY) { 181 psTraceSetLevel ("psLib.math.vectorFittedStats_v4", 6); 182 psTraceSetLevel ("psLib.math.vectorRobustStats", 6); 183 } else { 184 psTraceSetLevel ("psLib.math.vectorFittedStats_v4", 0); 185 psTraceSetLevel ("psLib.math.vectorRobustStats", 0); 186 } 187 # endif 188 188 189 189 if (psImageBackground(stats, &sample, subset, submask, maskVal, rng)) { … … 195 195 modelStdevData[iy][ix] = psStatsGetValue(stats, statsOptionWidth); 196 196 197 // supply sample to plotting routing 198 psphotDiagnosticPlots (config, "IMAGE.BACKGROUND.CELL.HISTOGRAM", ix, iy, modelData[iy][ix], modelStdevData[iy][ix], sample); 199 psFree (sample); 197 // supply sample to plotting routing 198 psphotDiagnosticPlots (config, "IMAGE.BACKGROUND.CELL.HISTOGRAM", ix, iy, modelData[iy][ix], modelStdevData[iy][ix], sample); 200 199 } else { 201 200 psStatsOptions currentOptions = stats->options; … … 210 209 modelStdevData[iy][ix] = psStatsGetValue(stats, PS_STAT_ROBUST_STDEV); 211 210 212 // supply sample to plotting routing 213 psphotDiagnosticPlots (config, "IMAGE.BACKGROUND.CELL.HISTOGRAM", ix, iy, modelData[iy][ix], modelStdevData[iy][ix], sample); 214 psFree (sample); 211 // supply sample to plotting routing 212 psphotDiagnosticPlots (config, "IMAGE.BACKGROUND.CELL.HISTOGRAM", ix, iy, modelData[iy][ix], modelStdevData[iy][ix], sample); 215 213 } 216 214 // drop errors caused by psImageBackground failures … … 219 217 stats->options = currentOptions; 220 218 } 219 psFree(sample); 221 220 modelData[iy][ix] += SKY_BIAS; 222 221 psFree (subset); … … 263 262 if (Count == 0) { 264 263 psError (PSPHOT_ERR_DATA, true, "failed to build background image"); 265 psFree(stats);266 psFree(statsDefaults);267 psFree(binning);268 psFree(rng);264 psFree(stats); 265 psFree(statsDefaults); 266 psFree(binning); 267 psFree(rng); 269 268 return false; 270 269 }
Note:
See TracChangeset
for help on using the changeset viewer.
