IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 8, 2011, 2:56:56 PM (15 years ago)
Author:
eugene
Message:

add unofficial PS1_V4 output format (not yet standard); add clean radial profile to find sky limit; use sky limit to control kron analysis window; fix thread / memory problem for radial photometry; fix object matching for forced psf photometry; fix object matching to get the right matches

Location:
trunk/psphot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot

  • trunk/psphot/src/psphotStackReadout.c

    r32348 r32633  
    4343
    4444bool psphotStackReadout (pmConfig *config, const pmFPAview *view) {
     45
     46    psArray *objects = NULL; // used below after 'pass1finish' label
    4547
    4648    // measure the total elapsed time in psphotReadout.  dtime is the elapsed time used jointly
     
    169171    psphotStackVisualFilerule(config, view, STACK_SRC);
    170172
     173    // measure the radial profiles to the sky
     174    psphotRadialProfileWings (config, view, STACK_SRC);
     175
    171176    // re-measure the kron mags with models subtracted.  this pass starts with a circular
    172177    // window of size PSF_MOMENTS_RADIUS (same window used to measure the psf-scale moments)
     
    184189    psphotReplaceAllSources (config, view, STACK_SRC); // pass 1 (detections->allSources)
    185190
     191    // if we only do one pass, skip to extended source analysis
     192    if (!strcasecmp (breakPt, "PASS1")) goto pass1finish;
     193
    186194    // linear fit to include all sources (subtract again)
    187195    // NOTE : apply to ALL sources (extended + psf)
    188196    psphotFitSourcesLinear (config, view, STACK_SRC, true); // pass 2 (detections->allSources)
    189 
    190     // if we only do one pass, skip to extended source analysis
    191     if (!strcasecmp (breakPt, "PASS1")) goto pass1finish;
    192197
    193198    // NOTE: possibly re-measure background model here with objects subtracted / or masked
     
    238243        // XXX check on free of sources...
    239244        psphotMergeSources (config, view, STACK_SRC); // (detections->newSources + detections->allSources -> detections->allSources)
    240 
    241         // NOTE: apply to ALL sources
    242         psphotFitSourcesLinear (config, view, STACK_SRC, true); // pass 3 (detections->allSources)
    243245    }
    244246
    245247pass1finish:
     248
     249    // generate the objects (objects unify the sources from the different images) NOTE: could
     250    // this just match the detections for the chisq image, and not bother measuring the source
     251    // stats in that case...?
     252    objects = psphotMatchSources (config, view, STACK_SRC);
     253    psMemDump("matchsources");
     254
     255    psphotStackObjectsUnifyPosition (objects);
     256
     257    psphotStackObjectsSelectForAnalysis (config, view, STACK_SRC, objects);
     258
     259    // NOTE: apply to ALL sources
     260    psphotFitSourcesLinear (config, view, STACK_SRC, true); // pass 3 (detections->allSources)
     261
     262    // measure the radial profiles to the sky (only measures new objects)
     263    psphotRadialProfileWings (config, view, STACK_SRC);
    246264
    247265    // re-measure the kron mags with models subtracted
     
    254272
    255273    psMemDump("psfstats");
    256 
    257     // generate the objects (objects unify the sources from the different images)
    258     // XXX this could just match the detections for the chisq image, and not bother measuring the
    259     // source stats in that case...
    260     psArray *objects = psphotMatchSources (config, view, STACK_SRC);
    261     psMemDump("matchsources");
    262 
    263     psphotStackObjectsUnifyPosition (objects);
    264 
    265     psphotStackObjectsSelectForAnalysis (config, view, STACK_SRC, objects);
    266274
    267275    // measure elliptical apertures, petrosians (objects sorted by S/N)
     
    281289
    282290    // measure circular, radial apertures (objects sorted by S/N)
    283     // XXX can we just use psphotRadialApertures
    284     // XXX make sure the headers are consistent with this (which PSF convolutions, ie mark 'none')
    285     // psphotRadialAperturesByObject (config, objectsRadial, view, STACK_SRC, nMatchedPSF);
     291    // this forces photometry on the undetected sources from other images
    286292    psphotRadialApertures (config, view, STACK_SRC, 0); // XXX entry 0 == unmatched?
    287293    psMemDump("extmeas");
     
    323329    psphotMagnitudes(config, view, STACK_SRC);
    324330
    325     if (0 && !psphotEfficiency(config, view, STACK_DET)) {
     331    // XXX NOTE: this function wants to have the PSF of the image, but we (so far) only measure the
     332    // PSF of the SRC image.  can we fake it by generating the PSF for DET as well (up above)?
     333    if (false && !psphotEfficiency(config, view, STACK_DET)) {
    326334        psErrorStackPrint(stderr, "Unable to determine detection efficiencies from fake sources");
    327335        psErrorClear();
Note: See TracChangeset for help on using the changeset viewer.