IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 1, 2008, 2:50:07 PM (18 years ago)
Author:
Paul Price
Message:

Adding PSF_FIT_ITER, PSF_FIT_TOL, EXT_FIT_ITER and EXT_FIT_TOL recipe
parameters to control the non-linear source fitting. We want to
separate the PSF fits and the general extended source fits: we can
afford to spend more time on the PSF fits to make sure they're right
(and that they succeed), whereas we're willing to throw away other
sources if they don't fit.

File:
1 edited

Legend:

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

    r18582 r18865  
    6464    assert (status);
    6565
    66     // XXX ROBUST seems to be too agressive given the small numbers. 
     66    // XXX ROBUST seems to be too agressive given the small numbers.
    6767    // options->stats = psStatsAlloc (PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV);
    6868    options->stats = psStatsAlloc (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV);
     
    7474    options->psfFieldYo = readout->image->row0;
    7575
    76     pmSourceFitModelInit (15, 0.01, PS_SQR(SKY_SIG), options->poissonErrorsPhotLMM);
     76    int fitIter = psMetadataLookupS32(&status, recipe, "PSF_FIT_ITER"); // Maximum number of fit iterations
     77    if (!status || fitIter <= 0) {
     78        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "PSF_FIT_ITER is not positive");
     79        return false;
     80    }
     81    float fitTol = psMetadataLookupF32 (&status, recipe, "PSF_FIT_TOL"); // Fit tolerance
     82    if (!status || !isfinite(fitTol) || fitTol <= 0) {
     83        psError(PS_ERR_BAD_PARAMETER_VALUE, true, "PSF_FIT_TOL is not positive");
     84        return false;
     85    }
     86    pmSourceFitModelInit(fitIter, fitTol, PS_SQR(SKY_SIG), options->poissonErrorsPhotLMM);
    7787
    7888    psArray *stars = psArrayAllocEmpty (sources->n);
     
    188198        bool mdok;                      // Status of MD lookup
    189199        if (!psMetadataLookupBool(&mdok, recipe, PSPHOT_RECIPE_PSF_FAKE_ALLOW)) {
    190             psFree (modelNames);
    191             psFree(options);
     200            psFree (modelNames);
     201            psFree(options);
    192202            return NULL;
    193203        }
    194204
    195205        // generate a psf model using the first selection
    196         psLogMsg ("psphot.pspsf", PS_LOG_INFO, "Using guess PSF model");
     206        psLogMsg ("psphot.pspsf", PS_LOG_INFO, "Using guess PSF model");
    197207
    198208        // unset the PSFSTAR flags (none are used):
Note: See TracChangeset for help on using the changeset viewer.