IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 17, 2011, 5:41:38 AM (15 years ago)
Author:
eugene
Message:

psphotStack is generating duplicate detections because the detection removal before the second pass only occurs on the SRC, not DET image; working on fixing this by modifying the removal process

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111110/psphot/src/psphotStackReadout.c

    r32633 r32685  
    11# include "psphotInternal.h"
     2bool psphotDumpTest (pmConfig *config, const pmFPAview *view, const char *filerule);
    23
    34// we have 3 possible real filesets:
     
    130131        return psphotReadoutCleanup (config, view, STACK_SRC);
    131132    }
     133    psphotDumpTest (config, view, STACK_SRC);
    132134    psMemDump("sourcestats");
    133135
     
    170172    psphotFitSourcesLinear (config, view, STACK_SRC, false);
    171173    psphotStackVisualFilerule(config, view, STACK_SRC);
     174    psphotDumpTest (config, view, STACK_SRC);
    172175
    173176    // measure the radial profiles to the sky
     
    186189    psphotBlendFit (config, view, STACK_SRC); // pass 1 (detections->allSources)
    187190
    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)
    190193
    191194    // if we only do one pass, skip to extended source analysis
     
    194197    // linear fit to include all sources (subtract again)
    195198    // NOTE : apply to ALL sources (extended + psf)
     199    // NOTE 2 : this function subtracts the models from the given filerule (SRC)
    196200    psphotFitSourcesLinear (config, view, STACK_SRC, true); // pass 2 (detections->allSources)
    197201
     
    200204    // NOTE: this block performs the 2nd pass low-significance PSF detection stage
    201205    {
     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
    202210        // add noise for subtracted objects
    203211        psphotAddNoise (config, view, STACK_DET); // pass 1 (detections->allSources)
     
    212220
    213221        // 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
    214223        if (strcmp(STACK_SRC, STACK_DET)) {
    215             // XXX how does this handle 1st vs 2nd pass sources?
    216224            if (!psphotCopySources (config, view, STACK_SRC, STACK_DET)) {
    217225                psError (PSPHOT_ERR_UNKNOWN, false, "failure in peak analysis");
     
    220228        }
    221229
     230        // replace all sources in DET
     231        psphotReplaceAllSources (config, view, STACK_DET, true); // ignore subtraction state for sources
     232
    222233        // define new sources based on only the new peaks & measure moments
    223234        // NOTE: new sources are saved on detections->newSources
    224235        psphotSourceStats (config, view, STACK_SRC, false); // pass 2 (detections->newSources)
     236        psphotDumpTest (config, view, STACK_SRC);
    225237
    226238        // set source type
     
    237249        // replace all sources so fit below applies to all at once
    238250        // NOTE: apply only to OLD sources (which have been subtracted)
    239         psphotReplaceAllSources (config, view, STACK_SRC); // pass 2
     251        psphotReplaceAllSources (config, view, STACK_SRC, false); // pass 2
    240252
    241253        // merge the newly selected sources into the existing list
     
    243255        // XXX check on free of sources...
    244256        psphotMergeSources (config, view, STACK_SRC); // (detections->newSources + detections->allSources -> detections->allSources)
     257        psphotDumpTest (config, view, STACK_SRC);
    245258    }
    246259
     
    256269
    257270    psphotStackObjectsSelectForAnalysis (config, view, STACK_SRC, objects);
     271    psphotDumpTest (config, view, STACK_SRC);
    258272
    259273    // NOTE: apply to ALL sources
     
    295309    int nRadialEntries = psphotStackMatchPSFsEntries(config, view, STACK_OUT);
    296310
     311    psphotDumpTest (config, view, STACK_SRC);
     312
    297313    for (int entry = 1; entry < nRadialEntries; entry++) {
    298314        // NOTE: entry 0 is the unmatched image set
     
    312328
    313329        // 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);
    315331
    316332        // smooth to the next FWHM, or set 'smoothAgain' to false if no more
Note: See TracChangeset for help on using the changeset viewer.