IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 23, 2006, 6:16:11 PM (20 years ago)
Author:
eugene
Message:

fixed some errors with double sources, added second-pass linear PSF fit, multiple-depths

File:
1 edited

Legend:

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

    r6427 r6481  
    33// XXX I don't like this name
    44bool psphotBlendFit (pmReadout *readout, psMetadata *config, psArray *sources, pmPSF *psf) {
     5
     6    bool status;
    57
    68    psTimerStart ("psphot");
     
    911    sources = psArraySort (sources, psphotSortBySN);
    1012   
     13    // S/N limit to perform full non-linear fits
     14    float FIT_SN_LIM = psMetadataLookupF32 (&status, config, "FULL_FIT_SN_LIM");
     15
    1116    psphotInitLimitsPSF (config);
    1217    psphotInitLimitsEXT (config);
    1318    psphotInitRadiusPSF (config, psf->type);
    1419
     20    // option to limit analysis to a specific region
     21    char *region = psMetadataLookupStr (&status, config, "ANALYSIS_REGION");
     22    psRegion AnalysisRegion = psRegionForImage (readout->image, psRegionFromString (region));
     23    if (psRegionIsNaN (AnalysisRegion)) psAbort ("psphot", "analysis region mis-defined");
     24
    1525    for (int i = 0; i < sources->n; i++) {
    16 
    1726        pmSource *source = sources->data[i];
    1827
     
    2231        if (source->type == PM_SOURCE_SATURATED) continue;
    2332
     33        // limit selection to some SN limit
     34        if (source->moments == NULL) continue;
     35        if (source->moments->SN < FIT_SN_LIM) continue;
     36
    2437        // if model is NULL, we don't have a starting guess
    2538        if (source->modelPSF == NULL) continue;
     39
     40        if (source->moments->x < AnalysisRegion.x0) continue;
     41        if (source->moments->y < AnalysisRegion.y0) continue;
     42        if (source->moments->x > AnalysisRegion.x1) continue;
     43        if (source->moments->y > AnalysisRegion.y1) continue;
    2644
    2745        // replace object in image
     
    2947
    3048        psTrace ("psphot.blend", 5, "trying source at %f, %f\n", source->moments->x, source->moments->y);
    31 
     49       
    3250        // try fitting PSFs, then try extended sources
    3351        if (psphotFitBlend (readout, source)) continue;
Note: See TracChangeset for help on using the changeset viewer.