IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34416


Ignore:
Timestamp:
Sep 7, 2012, 10:45:14 AM (14 years ago)
Author:
eugene
Message:

add SUBTRACT_SATSTAR_PROFILE to the psphot recipe; add psphotDeblendSatstar to psphotStackReadout

Location:
branches/eam_branches/ipp-20120905/psphot/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20120905/psphot/src/psphot.h

    r34404 r34416  
    8181
    8282bool            psphotDeblendSatstars (pmConfig *config, const pmFPAview *view, const char *filerule);
    83 bool            psphotDeblendSatstarsReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index);
     83bool            psphotDeblendSatstarsReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int index, psMetadata *recipe);
    8484
    8585bool            psphotBasicDeblend (pmConfig *config, const pmFPAview *view, const char *filerule);
  • branches/eam_branches/ipp-20120905/psphot/src/psphotDeblendSatstars.c

    r34415 r34416  
    1616bool psphotDeblendSatstars (pmConfig *config, const pmFPAview *view, const char *filerule)
    1717{
     18    bool status = false;
     19
    1820    int num = psphotFileruleCount(config, filerule);
     21
     22    // select the appropriate recipe information
     23    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
     24    psAssert (recipe, "missing recipe?");
     25
     26    // perform full extended source non-linear fits?
     27    if (!psMetadataLookupBool (&status, recipe, "SUBTRACT_SATSTAR_PROFILE")) {
     28        psLogMsg ("psphot", PS_LOG_INFO, "skipping extended source fits\n");
     29        return true;
     30    }
    1931
    2032    // loop over the available readouts
    2133    for (int i = 0; i < num; i++) {
    22         if (!psphotDeblendSatstarsReadout (config, view, filerule, i)) {
     34        if (!psphotDeblendSatstarsReadout (config, view, filerule, i, recipe)) {
    2335            psError (PSPHOT_ERR_CONFIG, false, "failed on saturated star deblend analysis for %s entry %d", filerule, i);
    2436            return false;
     
    4052    4) subtract the radial profile
    4153   
     54    There is also support code for calculation of magnitudes and add/subtract the profile (a la pmSourceOp)
     55
    4256    TBD:
    4357
    44     * function to replace the radial profile for a source
    4558    * recenter the profile (based on cross-correlation / convolution with 1D profile)
    46 
    47     * raise a bit somewhere for these super saturated stars (if they were so modeled)
    48     * consider the subtraction bit : when to raise it?
    49 
    5059 **/
    5160
    52 bool psphotDeblendSatstarsReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int fileIndex) {
     61bool psphotDeblendSatstarsReadout (pmConfig *config, const pmFPAview *view, const char *filerule, int fileIndex, psMetadata *recipe) {
    5362
    5463    int N;
     
    7584        return true;
    7685    }
    77 
    78     // select the appropriate recipe information
    79     psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
    80     psAssert (recipe, "missing recipe?");
    8186
    8287    // user-defined masks to test for good/bad pixels (build from recipe list if not yet set)
     
    448453    // XXX do something sensible here if the profile is crap
    449454
     455    // replace an existing profile
     456    psFree (source->satstar);
    450457    source->satstar = pmSourceSatstarAlloc();
    451458    source->satstar->Xo = Xo;
  • branches/eam_branches/ipp-20120905/psphot/src/psphotStackReadout.c

    r34415 r34416  
    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);
Note: See TracChangeset for help on using the changeset viewer.