IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 17, 2011, 6:47:47 AM (15 years ago)
Author:
eugene
Message:

fixing source subtraction for DET image

File:
1 edited

Legend:

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

    r32685 r32686  
    115115    }
    116116
    117     // if DET and SRC are different images, copy the detections from DET to SRC
     117    // If DET and SRC are different images, copy the detections from DET to SRC.  This 'copy'
     118    // is just a copy of the container pointer; the sources on both DET and SRC are the same
     119    // memory objects
    118120    if (strcmp(STACK_SRC, STACK_DET)) {
    119121        if (!psphotCopySources (config, view, STACK_SRC, STACK_DET)) {
     
    197199    // linear fit to include all sources (subtract again)
    198200    // NOTE : apply to ALL sources (extended + psf)
    199     // NOTE 2 : this function subtracts the models from the given filerule (SRC)
     201    // NOTE 2 : this function subtracts the models from the given filerule (SRC), not DET
    200202    psphotFitSourcesLinear (config, view, STACK_SRC, true); // pass 2 (detections->allSources)
    201203
     
    204206    // NOTE: this block performs the 2nd pass low-significance PSF detection stage
    205207    {
     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
    206214        //  subtract all sources from DET (this will subtract using the psf model for SRC, which
    207215        //  will somewhat oversubtract the sources -- this is OK
     216        // *** this fails because the source->pixels are still pointing at SRC, not DET
    208217        psphotRemoveAllSources (config, view, STACK_DET, true); // ignore subtraction state for sources
    209218
     
    222231        // (this operation just ensures the metadata container has a view on SRC as well
    223232        if (strcmp(STACK_SRC, STACK_DET)) {
    224             if (!psphotCopySources (config, view, 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)) {
    225241                psError (PSPHOT_ERR_UNKNOWN, false, "failure in peak analysis");
    226242                return psphotReadoutCleanup (config, view, STACK_SRC);
Note: See TracChangeset for help on using the changeset viewer.