IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25617


Ignore:
Timestamp:
Sep 27, 2009, 11:16:46 AM (17 years ago)
Author:
eugene
Message:

set the aperture independently of the fit radius; fix some errors in setting the fit radius

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090715/psphot/src/psphotRadiusChecks.c

    r25497 r25617  
    77                                        // and a per-object radius is calculated)
    88
     9static float PSF_APERTURE = 0;  // radius to use in PSF aperture mags
     10
     11
    912bool psphotInitRadiusPSF(const psMetadata *recipe, const pmModelType type) {
    1013
     
    1316    PSF_FIT_NSIGMA  = psMetadataLookupF32(&status, recipe, "PSF_FIT_NSIGMA");
    1417    PSF_FIT_PADDING = psMetadataLookupF32(&status, recipe, "PSF_FIT_PADDING");
    15     PSF_FIT_RADIUS =  psMetadataLookupF32(&status, recipe, "PSF_FIT_RADIUS");
     18    PSF_FIT_RADIUS  =  psMetadataLookupF32(&status, recipe, "PSF_FIT_RADIUS");
     19    PSF_APERTURE    =  psMetadataLookupF32(&status, recipe, "PSF_APERTURE");
    1620
    1721    return true;
     
    3438            radiusFit = model->modelRadius(model->params, 1.0);
    3539        }
     40        model->fitRadius = (RADIUS_TYPE)(radiusFit + PSF_FIT_PADDING);
     41    } else {
     42        model->fitRadius = radiusFit;
    3643    }
    37     model->fitRadius = (RADIUS_TYPE)(radiusFit + PSF_FIT_PADDING);
    38 
    3944    if (isnan(model->fitRadius)) psAbort("error in radius");
    4045       
     
    4348    }
    4449
    45     source->apRadius = model->fitRadius;
    46     // XXX for now, use the same radius for aperture and fit
    47     // XXX to use different radii, we will need to set the apRadius mask with a call to
    48     // psImageKeepCircle in the function psphotMagnitudes_Threaded
     50    // radius used to measure aperture photometry
     51    source->apRadius = PSF_APERTURE;
    4952
    5053    bool status = pmSourceRedefinePixels (source, readout, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->fitRadius);
     
    6366
    6467    // set the fit radius based on the object flux limit and the model
    65     model->fitRadius = (RADIUS_TYPE) (model->modelRadius (model->params, PSF_FIT_NSIGMA*moments->dSky) + dR + PSF_FIT_PADDING);
     68    float radiusFit = PSF_FIT_RADIUS;
     69    if (radiusFit <= 0) {               // use fixed radius
     70        if (moments == NULL) {
     71            radiusFit = model->modelRadius(model->params, PSF_FIT_NSIGMA*moments->dSky);
     72        } else {
     73            radiusFit = model->modelRadius(model->params, 1.0);
     74        }
     75        model->fitRadius = (RADIUS_TYPE)(radiusFit + PSF_FIT_PADDING);
     76    } else {
     77        model->fitRadius = radiusFit;
     78    }
    6679    if (isnan(model->fitRadius)) psAbort("error in radius");
    67        
     80
     81    // above sets a radius for a single star, bump by blend separation
     82    model->fitRadius += dR;
     83
    6884    if (source->mode &  PM_SOURCE_MODE_SATSTAR) {
    6985        model->fitRadius *= 2;
    7086    }
    7187
    72     source->apRadius = model->fitRadius;
    73     // XXX for now, use the same radius for aperture and fit
    74     // XXX to use different radii, we will need to set the apRadius mask with a call to
    75     // psImageKeepCircle in the function psphotMagnitudes_Threaded
     88    // radius used to measure aperture photometry
     89    source->apRadius = PSF_APERTURE;
    7690
    7791    bool status = pmSourceRedefinePixels (source, readout, PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], model->fitRadius);
Note: See TracChangeset for help on using the changeset viewer.