IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11178


Ignore:
Timestamp:
Jan 18, 2007, 6:57:40 PM (19 years ago)
Author:
eugene
Message:

adding second pass analysis: remeasure sky, redetect peaks, classify, refit ensemble, subtract

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotReadout.c

    r10975 r11178  
    1212    char *breakPt = psMetadataLookupStr (NULL, recipe, "BREAK_POINT");
    1313
    14     // XXX does this need to invoke I/O?
    15     // XXX move this input the psphotImageLoop level?
     14    // generate mask & weight images if they don't already exit
    1615    if (!pmReadoutGenerateMaskWeight (readout, true)) {
    1716        return false;
     
    9998    psphotBlendFit (readout, sources, recipe, psf);
    10099
    101     // next steps:
    102     // remeasure the sky after objects have been subrtracted
    103     // re-find the peaks.
    104     // re-run ensemble fit
    105 
    106     // XXX this was an attempt to measure bias due to the weighting.
    107     // psphotWeightBias (readout, sources, recipe, psf);
    108 
    109     // replace fitted sources
    110     // XXX we need to replace failed objects, not all objects
    111     // psphotReplaceUnfit (sources);
    112 
    113     // XXX find remaining peaks after first source subtraction pass
    114     // psphotFindPeaks ();
    115 
    116     // replace subtracted sources
     100    // replace all sources
    117101    psphotReplaceAll (sources);
    118     // psphotSaveImage (NULL, readout->image,  "replace.fits");
    119102
    120103    // linear PSF fit to remaining peaks
    121104    psphotEnsemblePSF (readout, sources, recipe, psf, TRUE);
     105    if (!strcasecmp (breakPt, "PASS1")) {
     106        goto finish;
     107    }
    122108
    123     // XXX test the plotting function
    124     // psphotPlotPSFModel (config, view, sources);
     109    // replace background in residual image
     110    psphotSkyReplace (config, view);
     111
     112    // re-measure background model (median, smoothed image)
     113    psphotImageMedian (config, view);
     114
     115    // find the peaks in the image
     116    psMetadataAddF32 (recipe, PS_LIST_TAIL, "PEAKS_NSIGMA_LIMIT", PS_META_REPLACE, "", 5.0);
     117    psArray *newPeaks = psphotFindPeaks (readout, recipe);
     118
     119    // define new sources based on the new peaks
     120    psArray *newSources = psphotSourceStats (readout, recipe, newPeaks);
     121    psFree (newPeaks);
     122
     123    // set source type
     124    psphotRoughClass (newSources, recipe);
     125
     126    // create full input models
     127    psphotGuessModels (readout, newSources, recipe, psf);
     128
     129    // linear PSF fit to remaining peaks
     130    psphotEnsemblePSF (readout, newSources, recipe, psf, TRUE);
     131
     132    // merge the newly selected peaks into the existing list
     133    // psphotIncludeNewPeaks (sources, newSources);
     134    psFree (newSources);
    125135
    126136finish:
     
    135145    // calculate source magnitudes
    136146    psphotMagnitudes(sources, recipe, psf, background);
     147
     148    // replace fitted sources
     149    // XXX we need to replace failed objects, not all objects
     150    // psphotReplaceUnfit (sources);
    137151
    138152    // replace background in residual image
Note: See TracChangeset for help on using the changeset viewer.