IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 22, 2006, 4:27:14 AM (20 years ago)
Author:
rhl
Message:

1/ Added some consts
2/ Made recipe variable PSF_FIT_RADIUS set radius for fitting independent
of brightness of source

File:
1 edited

Legend:

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

    r10053 r10137  
    44static float PSF_FIT_NSIGMA;
    55static float PSF_FIT_PADDING;
     6static float PSF_FIT_RADIUS = 0;        // radius to use in fitting (ignored if <= 0,
     7                                        // and a per-object radius is calculated)
    68static pmModelRadius modelRadiusPSF;
    79
    8 bool psphotInitRadiusPSF (psMetadata *recipe, pmModelType type) {
     10bool psphotInitRadiusPSF(const psMetadata *recipe,
     11                         const pmModelType type)
     12{
     13    bool status = true;
    914
    10     bool status;
    11 
    12     PSF_FIT_NSIGMA   = psMetadataLookupF32 (&status, recipe, "PSF_FIT_NSIGMA");
    13     PSF_FIT_PADDING  = psMetadataLookupF32 (&status, recipe, "PSF_FIT_PADDING");
     15    PSF_FIT_NSIGMA  = psMetadataLookupF32(&status, recipe, "PSF_FIT_NSIGMA");
     16    PSF_FIT_PADDING = psMetadataLookupF32(&status, recipe, "PSF_FIT_PADDING");
     17    PSF_FIT_RADIUS =  psMetadataLookupF32(&status, recipe, "PSF_FIT_RADIUS");
    1418
    1519    // this function specifies the radius at this the model hits the given flux
     
    1923
    2024// call this function whenever you (re)-define the PSF model
    21 bool psphotCheckRadiusPSF (pmReadout *readout, pmSource *source, pmModel *model) {
    22 
     25bool psphotCheckRadiusPSF (pmReadout *readout, pmSource *source, pmModel *model)
     26{
    2327    pmMoments *moments = source->moments;
    2428    if (moments == NULL) return false;
    2529
    2630    // set the fit radius based on the object flux limit and the model
    27     model->radiusFit = (RADIUS_TYPE) (modelRadiusPSF (model->params, PSF_FIT_NSIGMA*moments->dSky) + PSF_FIT_PADDING);
     31    float radiusFit = PSF_FIT_RADIUS;
     32    if (radiusFit <= 0) {               // use fixed radius
     33        radiusFit = modelRadiusPSF(model->params, PSF_FIT_NSIGMA*moments->dSky);
     34    }
     35    model->radiusFit = (RADIUS_TYPE)(RadiusFit + PSF_FIT_PADDING);
     36
    2837    if (isnan(model->radiusFit)) psAbort ("apply_psf_model", "error in radius");
    2938       
Note: See TracChangeset for help on using the changeset viewer.