Changeset 19880 for trunk/psphot/src/psphotReadout.c
- Timestamp:
- Oct 3, 2008, 10:59:38 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotReadout.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotReadout.c
r19869 r19880 69 69 } 70 70 71 // display the backsub and backgnd images71 // display the peaks and footprints 72 72 psphotVisualShowPeaks (config, view, detections); 73 73 psphotVisualShowFootprints (config, view, detections); 74 75 // XXX test write out the footprint image76 if (0) {77 psImage *footprintImage = pmSetFootprintArrayIDs (detections->footprints, true);78 psphotSaveImage (NULL, footprintImage, "footprints.1.fits");79 psFree (footprintImage);80 }81 74 82 75 // construct sources and measure basic stats … … 109 102 110 103 psphotVisualShowRoughClass (config, view, sources); 104 psphotVisualShowFlags (config, view, sources); 111 105 112 106 // if we were not supplied a PSF, choose one here … … 173 167 psphotVisualShowPSFStars (config, view, psf, sources); 174 168 psphotVisualShowSatStars (config, view, psf, sources); 175 psphotVisualShowLinearFit (config, readout); 176 177 if (0) { 178 FILE *out = fopen ("out.pass1.dat", "w"); 179 180 for (int i = 0; i < sources->n; i++) { 181 pmSource *source = sources->data[i]; 182 if (!source) continue; 183 pmPeak *peak = source->peak; 184 if (!peak) continue; 185 pmModel *model = source->modelPSF; 186 if (!model) continue; 187 if (!model->params) continue; 188 189 fprintf (out, "%d %f %f %f %f %f %f\n", 190 i, peak->xf, peak->yf, peak->flux, peak->SN, 191 model->params->data.F32[PM_PAR_I0], 192 model->dparams->data.F32[PM_PAR_I0]); 193 } 194 fclose (out); 195 } 169 psphotVisualShowResidualImage (config, readout); 170 psphotVisualShowFlags (config, view, sources); 196 171 197 172 // identify CRs and extended sources … … 201 176 } 202 177 203 // XXXpsphotVisualShowSourceSize (config, view, sources);178 psphotVisualShowSourceSize (config, view, sources); 204 179 205 180 // non-linear PSF and EXT fit to brighter sources 206 181 psphotBlendFit (readout, sources, recipe, psf); 207 182 208 // XXX psphotVisualShowNonLinearFit (config, view, sources); 183 psphotVisualShowResidualImage (config, readout); 184 psphotVisualShowFlags (config, view, sources); 209 185 210 186 // replace all sources … … 213 189 // linear fit to include all sources 214 190 psphotFitSourcesLinear (readout, sources, recipe, psf, TRUE); 191 192 psphotVisualShowResidualImage (config, readout); 193 psphotVisualShowFlags (config, view, sources); 215 194 216 195 // if we only do one pass, skip to extended source analysis … … 231 210 detections = psphotFindDetections (detections, readout, recipe); 232 211 233 // XXX test write out the footprint image234 if (0) {235 psImage *footprintImage = pmSetFootprintArrayIDs (detections->footprints, true);236 psphotSaveImage (NULL, footprintImage, "footprints.2.fits");237 psFree (footprintImage);238 }239 212 // remove noise for subtracted objects (ie, return to normal noise level) 240 213 psphotSubNoise (readout, sources, recipe); 214 215 // display the new peaks and footprints 216 psphotVisualShowPeaks (config, view, detections); 217 psphotVisualShowFootprints (config, view, detections); 241 218 242 219 // define new sources based on only the new peaks … … 249 226 } 250 227 228 psphotVisualShowRoughClass (config, view, sources); 229 psphotVisualShowFlags (config, view, sources); 230 251 231 // create full input models 252 232 psphotGuessModels (readout, newSources, recipe, psf); … … 262 242 psphotFitSourcesLinear (readout, sources, recipe, psf, TRUE); 263 243 264 if (0) { 265 FILE *out = fopen ("out.pass2.dat", "w"); 266 267 for (int i = 0; i < sources->n; i++) { 268 pmSource *source = sources->data[i]; 269 if (!source) continue; 270 pmPeak *peak = source->peak; 271 if (!peak) continue; 272 pmModel *model = source->modelPSF; 273 if (!model) continue; 274 if (!model->params) continue; 275 276 fprintf (out, "%d %f %f %f %f %f %f\n", 277 i, peak->xf, peak->yf, peak->flux, peak->SN, 278 model->params->data.F32[PM_PAR_I0], 279 model->dparams->data.F32[PM_PAR_I0]); 280 } 281 fclose (out); 282 } 244 psphotVisualShowResidualImage (config, readout); 245 psphotVisualShowFlags (config, view, sources); 283 246 284 247 pass1finish: … … 286 249 // measure source size for the remaining sources 287 250 psphotSourceSize (config, readout, sources, recipe, 0); 288 if (0) { 289 psphotSaveImage (NULL, readout->mask, "mask.fits"); 290 } 291 251 psphotVisualShowSourceSize (config, view, sources); 252 292 253 psphotExtendedSourceAnalysis (readout, sources, recipe); 293 254 … … 305 266 } 306 267 268 psphotVisualPlotApResid (config, sources); 269 307 270 // calculate source magnitudes 308 271 pmReadout *background = psphotSelectBackground (config, view, false);
Note:
See TracChangeset
for help on using the changeset viewer.
