- Timestamp:
- Nov 17, 2011, 1:09:10 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111110/psphot/src/psphotStackReadout.c
r32686 r32689 1 1 # include "psphotInternal.h" 2 bool psphotDumpTest (pmConfig *config, const pmFPAview *view, const char *filerule);3 2 4 3 // we have 3 possible real filesets: … … 83 82 } 84 83 85 // XXX I think this is not defined correctly for an array of images.86 // XXX I probably need to subtract the model (same model?) for both RAW and OUT.87 // XXX But, probably not a problem in practice since the stacks are constructed with 0.0 mean level.88 89 84 // generate a background model (median, smoothed image) 90 85 if (!psphotModelBackground (config, view, STACK_DET)) { … … 92 87 } 93 88 if (!psphotSubtractBackground (config, view, STACK_DET)) { 89 return psphotReadoutCleanup (config, view, STACK_SRC); 90 } 91 if (!psphotSubtractBackground (config, view, STACK_SRC)) { 94 92 return psphotReadoutCleanup (config, view, STACK_SRC); 95 93 } … … 133 131 return psphotReadoutCleanup (config, view, STACK_SRC); 134 132 } 135 psphotDumpTest (config, view, STACK_SRC);133 // psphotDumpTest (config, view, STACK_SRC); 136 134 psMemDump("sourcestats"); 137 135 … … 170 168 171 169 // linear PSF fit to source peaks, subtract the models from the image (in PSF mask) 172 // XXX why do this as a stack operation?173 // psphotFitSourcesLinearStack (config, objects, false);174 170 psphotFitSourcesLinear (config, view, STACK_SRC, false); 175 171 psphotStackVisualFilerule(config, view, STACK_SRC); 176 psphotDumpTest (config, view, STACK_SRC);177 172 178 173 // measure the radial profiles to the sky … … 206 201 // NOTE: this block performs the 2nd pass low-significance PSF detection stage 207 202 { 208 // XXX the steps below to subtract the sources from DET should be skipped if SRC == DET! 209 210 // generate children sources for all sources in the SRC image 211 // XXX (DROP existing detections list) 212 psphotSourceChildren (config, view, STACK_DET, STACK_SRC); 213 214 // subtract all sources from DET (this will subtract using the psf model for SRC, which 215 // will somewhat oversubtract the sources -- this is OK 216 // *** this fails because the source->pixels are still pointing at SRC, not DET 217 psphotRemoveAllSources (config, view, STACK_DET, true); // ignore subtraction state for sources 203 // if DET and SRC are different images, generate children sources for all sources in 204 // the SRC image. This operation replaces the existing DETECTION container on DET 205 // which is currently a view to the one on SRC). children sources go to 206 // det->allSources 207 if (strcmp(STACK_SRC, STACK_DET)) { 208 psphotSourceChildren (config, view, STACK_DET, STACK_SRC); 209 210 // subtract all sources from DET (this will subtract using the psf model for SRC, which 211 // will somewhat oversubtract the sources -- this is OK 212 psphotRemoveAllSources (config, view, STACK_DET, false); // ignore subtraction state for sources 213 } 218 214 219 215 // add noise for subtracted objects … … 231 227 // (this operation just ensures the metadata container has a view on SRC as well 232 228 if (strcmp(STACK_SRC, STACK_DET)) { 233 // XXX this operation now needs to create source parents for the new detections 234 // XXX if (!psphotCopySources (config, view, STACK_SRC, STACK_DET)) { 235 // XXX psError (PSPHOT_ERR_UNKNOWN, false, "failure in peak analysis"); 236 // XXX return psphotReadoutCleanup (config, view, STACK_SRC); 237 // XXX } 238 239 // the old detection here are children of SRC; generate parents for the new detections 240 if (!psphotSourceParents (config, view, STACK_SRC, STACK_DET)) { 229 // replace all sources in DET 230 psphotReplaceAllSources (config, view, STACK_DET, false); // ignore subtraction state for sources 231 232 // copy the newly detected peaks from DET to SRC so SourceStats below can operate on them 233 if (!psphotCopyPeaks (config, view, STACK_SRC, STACK_DET)) { 241 234 psError (PSPHOT_ERR_UNKNOWN, false, "failure in peak analysis"); 242 235 return psphotReadoutCleanup (config, view, STACK_SRC); … … 244 237 } 245 238 246 // replace all sources in DET247 psphotReplaceAllSources (config, view, STACK_DET, true); // ignore subtraction state for sources248 249 239 // define new sources based on only the new peaks & measure moments 250 240 // NOTE: new sources are saved on detections->newSources 251 241 psphotSourceStats (config, view, STACK_SRC, false); // pass 2 (detections->newSources) 252 psphotDumpTest (config, view, STACK_SRC);253 242 254 243 // set source type … … 271 260 // XXX check on free of sources... 272 261 psphotMergeSources (config, view, STACK_SRC); // (detections->newSources + detections->allSources -> detections->allSources) 273 psphotDumpTest (config, view, STACK_SRC);274 262 } 275 263 … … 285 273 286 274 psphotStackObjectsSelectForAnalysis (config, view, STACK_SRC, objects); 287 psphotDumpTest (config, view, STACK_SRC);288 275 289 276 // NOTE: apply to ALL sources … … 324 311 325 312 int nRadialEntries = psphotStackMatchPSFsEntries(config, view, STACK_OUT); 326 327 psphotDumpTest (config, view, STACK_SRC);328 313 329 314 for (int entry = 1; entry < nRadialEntries; entry++) {
Note:
See TracChangeset
for help on using the changeset viewer.
