IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 6, 2012, 6:32:19 PM (14 years ago)
Author:
watersc1
Message:

merge from trunk. Preliminary versions of stacktool/warptool updates and regenerate_background.pl script. The warp code is finished and tested, and I still need to get the stack version resolved.

Location:
branches/czw_branch/20120906/psphot
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20120906/psphot

  • branches/czw_branch/20120906/psphot/src

  • branches/czw_branch/20120906/psphot/src/psphotStackReadout.c

    r34354 r34772  
    169169    }
    170170
     171    // If DET and SRC are different images, subtract radial profiles for the convolved
     172    // image first.  The profiles found on the convolved image will be replaced by those
     173    // found for the unconvolved image.  Downstream, in psphotFindDetections, we will
     174    // replace the the profiles (and re-subtract them) for the detection image, so we want
     175    // to keep those versions of the profiles on the sources.
     176    if (strcmp(STACK_SRC, STACK_DET)) {
     177      // find and subtract radial profile models for saturated stars (XXX change name eventually)
     178      if (!psphotDeblendSatstars (config, view, STACK_SRC)) {
     179        psError (PSPHOT_ERR_UNKNOWN, false, "failed on satstar deblend analysis");
     180        return psphotReadoutCleanup (config, view, STACK_SRC);
     181      }
     182    }
     183    // find and subtract radial profile models for saturated stars (XXX change name eventually)
     184    if (!psphotDeblendSatstars (config, view, STACK_DET)) {
     185        psError (PSPHOT_ERR_UNKNOWN, false, "failed on satstar deblend analysis");
     186        return psphotReadoutCleanup (config, view, STACK_SRC);
     187    }
     188
    171189    // if we were not supplied a PSF model, determine the IQ stats here (detections->newSources)
    172190    // only run this on detections from the input images, not chisq image
     
    206224    // window of size PSF_MOMENTS_RADIUS (same window used to measure the psf-scale moments)
    207225    // but iterates to an appropriately larger size
    208         logMemStats("before.kron.1");
     226    logMemStats("before.kron.1");
    209227    psphotKronIterate(config, view, STACK_SRC, 1);
    210         logMemStats("after.kron.1");
    211 
     228    logMemStats("after.kron.1");
     229       
    212230    // identify CRs and extended sources
    213231    psphotSourceSize (config, view, STACK_SRC, true);
     
    332350    psphotStackObjectsSelectForAnalysis (config, view, STACK_SRC, objects);
    333351
    334     if (splitLinearFit) {
    335         // NOTE: apply to Matched sources. Since the sources that we fit above are subtracted, they will
    336         // not be included in this fit.
    337         psphotFitSourcesLinear (config, view, STACK_SRC, true, false); // pass 4 (detections->allSources)
    338     } else {
    339         // Fit all sources together
    340         psphotFitSourcesLinear (config, view, STACK_SRC, true, false); // pass 3 (detections->allSources)
    341     }
     352    // final linear fit. NOTE: if splitLinearFit is true above, this pass will only fit
     353    // the unsubtracted (matched) sources (the sources that we fit above are subtracted)
     354    psphotFitSourcesLinear (config, view, STACK_SRC, true, false); // pass 4 (detections->allSources)
    342355
    343356    // measure the radial profiles to the sky (only measures new objects)
     
    356369    psMemDump("psfstats");
    357370
    358     // drop matched sources without any useful measurements
    359     psphotDropBadMatchedSources (config, view, STACK_SRC, objects);
     371    // drop matched sources without any useful measurements and set kron radii for the ones
     372    // we decide to keep
     373    psphotFilterMatchedSources (config, view, STACK_SRC, objects);
     374
     375    // measure kron fluxes for the matched sources only
     376    psphotKronIterate(config, view, STACK_SRC, 3);
    360377
    361378    // measure elliptical apertures, petrosians (objects sorted by S/N)
     
    392409            }
    393410        }
     411        // mark any inputs that we want to skip the matched apertures for
     412        psphotStackSetInputsToSkip(config, view, STACK_CNV, true);
     413        psphotStackSetInputsToSkip(config, view, STACK_OUT, true);
    394414        psphotRadialApertures (config, view, STACK_CNV, 0); // entry 0 == unmatched
    395415        psMemDump("extmeas");
    396416
    397         // mark any inputs that we want to skip the matched apertures for
    398         psphotStackSetInputsToSkip(config, view, STACK_OUT, true);
    399417
    400418        int nRadialEntries = psphotStackMatchPSFsEntries(config, view, STACK_OUT);
     
    422440        }
    423441    }
     442    psphotStackSetInputsToSkip(config, view, STACK_CNV, false);
    424443    psphotStackSetInputsToSkip(config, view, STACK_OUT, false);
    425444
Note: See TracChangeset for help on using the changeset viewer.