- Timestamp:
- Nov 17, 2011, 5:41:38 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111110/psphot/src/psphotStackReadout.c
r32633 r32685 1 1 # include "psphotInternal.h" 2 bool psphotDumpTest (pmConfig *config, const pmFPAview *view, const char *filerule); 2 3 3 4 // we have 3 possible real filesets: … … 130 131 return psphotReadoutCleanup (config, view, STACK_SRC); 131 132 } 133 psphotDumpTest (config, view, STACK_SRC); 132 134 psMemDump("sourcestats"); 133 135 … … 170 172 psphotFitSourcesLinear (config, view, STACK_SRC, false); 171 173 psphotStackVisualFilerule(config, view, STACK_SRC); 174 psphotDumpTest (config, view, STACK_SRC); 172 175 173 176 // measure the radial profiles to the sky … … 186 189 psphotBlendFit (config, view, STACK_SRC); // pass 1 (detections->allSources) 187 190 188 // replace all sources 189 psphotReplaceAllSources (config, view, STACK_SRC ); // pass 1 (detections->allSources)191 // replace all sources (do NOT ignore subtraction state) 192 psphotReplaceAllSources (config, view, STACK_SRC, false); // pass 1 (detections->allSources) 190 193 191 194 // if we only do one pass, skip to extended source analysis … … 194 197 // linear fit to include all sources (subtract again) 195 198 // NOTE : apply to ALL sources (extended + psf) 199 // NOTE 2 : this function subtracts the models from the given filerule (SRC) 196 200 psphotFitSourcesLinear (config, view, STACK_SRC, true); // pass 2 (detections->allSources) 197 201 … … 200 204 // NOTE: this block performs the 2nd pass low-significance PSF detection stage 201 205 { 206 // subtract all sources from DET (this will subtract using the psf model for SRC, which 207 // will somewhat oversubtract the sources -- this is OK 208 psphotRemoveAllSources (config, view, STACK_DET, true); // ignore subtraction state for sources 209 202 210 // add noise for subtracted objects 203 211 psphotAddNoise (config, view, STACK_DET); // pass 1 (detections->allSources) … … 212 220 213 221 // if DET and SRC are different images, copy the detections from DET to SRC 222 // (this operation just ensures the metadata container has a view on SRC as well 214 223 if (strcmp(STACK_SRC, STACK_DET)) { 215 // XXX how does this handle 1st vs 2nd pass sources?216 224 if (!psphotCopySources (config, view, STACK_SRC, STACK_DET)) { 217 225 psError (PSPHOT_ERR_UNKNOWN, false, "failure in peak analysis"); … … 220 228 } 221 229 230 // replace all sources in DET 231 psphotReplaceAllSources (config, view, STACK_DET, true); // ignore subtraction state for sources 232 222 233 // define new sources based on only the new peaks & measure moments 223 234 // NOTE: new sources are saved on detections->newSources 224 235 psphotSourceStats (config, view, STACK_SRC, false); // pass 2 (detections->newSources) 236 psphotDumpTest (config, view, STACK_SRC); 225 237 226 238 // set source type … … 237 249 // replace all sources so fit below applies to all at once 238 250 // NOTE: apply only to OLD sources (which have been subtracted) 239 psphotReplaceAllSources (config, view, STACK_SRC ); // pass 2251 psphotReplaceAllSources (config, view, STACK_SRC, false); // pass 2 240 252 241 253 // merge the newly selected sources into the existing list … … 243 255 // XXX check on free of sources... 244 256 psphotMergeSources (config, view, STACK_SRC); // (detections->newSources + detections->allSources -> detections->allSources) 257 psphotDumpTest (config, view, STACK_SRC); 245 258 } 246 259 … … 256 269 257 270 psphotStackObjectsSelectForAnalysis (config, view, STACK_SRC, objects); 271 psphotDumpTest (config, view, STACK_SRC); 258 272 259 273 // NOTE: apply to ALL sources … … 295 309 int nRadialEntries = psphotStackMatchPSFsEntries(config, view, STACK_OUT); 296 310 311 psphotDumpTest (config, view, STACK_SRC); 312 297 313 for (int entry = 1; entry < nRadialEntries; entry++) { 298 314 // NOTE: entry 0 is the unmatched image set … … 312 328 313 329 // replace the flux in the image so it is returned to its original state 314 psphotReplaceAllSources (config, view, STACK_OUT );330 psphotReplaceAllSources (config, view, STACK_OUT, false); 315 331 316 332 // smooth to the next FWHM, or set 'smoothAgain' to false if no more
Note:
See TracChangeset
for help on using the changeset viewer.
