IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 14, 2006, 6:33:17 AM (20 years ago)
Author:
eugene
Message:

mods to change from threshold above sky to S/N thresholds

File:
1 edited

Legend:

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

    r6056 r6427  
    11# include "psphot.h"
    22
    3 static float PSF_OUTER_RADIUS;
     3static float PSF_FIT_NSIGMA;
    44static float PSF_FIT_PADDING;
    5 static float PSF_FLUX_LIMIT;
    65static pmModelRadius modelRadiusPSF;
    76
    8 bool psphotInitRadiusPSF (psMetadata *config, psStats *sky, pmModelType type) {
     7bool psphotInitRadiusPSF (psMetadata *config, pmModelType type) {
    98
    109    bool status;
    1110
    12     float PSF_FIT_NSIGMA = psMetadataLookupF32 (&status, config, "PSF_FIT_NSIGMA");
    13     PSF_OUTER_RADIUS     = psMetadataLookupF32 (&status, config, "PSF_OUTER_RADIUS");
    14     PSF_FIT_PADDING      = psMetadataLookupF32 (&status, config, "PSF_FIT_PADDING");
    15     PSF_FLUX_LIMIT       = PSF_FIT_NSIGMA * sky->sampleStdev;
     11    PSF_FIT_NSIGMA   = psMetadataLookupF32 (&status, config, "PSF_FIT_NSIGMA");
     12    PSF_FIT_PADDING  = psMetadataLookupF32 (&status, config, "PSF_FIT_PADDING");
    1613
    1714    // this function specifies the radius at this the model hits the given flux
     
    2219bool psphotCheckRadiusPSF (pmReadout *readout, pmSource *source, pmModel *model) {
    2320
     21    pmMoments *moments = source->moments;
     22    if (moments == NULL) return false;
     23
    2424    // set the fit radius based on the object flux limit and the model
    25     // XXX EAM : FLUX_LIMIT should be set based on local sky model (not global median)
    26     model->radius = modelRadiusPSF (model->params, PSF_FLUX_LIMIT) + PSF_FIT_PADDING;
     25    model->radius = modelRadiusPSF (model->params, PSF_FIT_NSIGMA*moments->dSky) + PSF_FIT_PADDING;
    2726    if (isnan(model->radius)) psAbort ("apply_psf_model", "error in radius");
    2827       
     
    3534}
    3635
    37 static float EXT_OUTER_RADIUS;
     36static float EXT_FIT_NSIGMA;
    3837static float EXT_FIT_PADDING;
    39 static float EXT_FLUX_LIMIT;
    4038static pmModelRadius modelRadiusEXT;
    4139
    42 bool psphotInitRadiusEXT (psMetadata *config, psStats *sky, pmModelType type) {
     40bool psphotInitRadiusEXT (psMetadata *config, pmModelType type) {
    4341
    4442    bool status;
    4543
    46     float EXT_FIT_NSIGMA = psMetadataLookupF32 (&status, config, "EXT_FIT_NSIGMA");
    47     EXT_OUTER_RADIUS     = psMetadataLookupF32 (&status, config, "EXT_OUTER_RADIUS");
    48     EXT_FIT_PADDING      = psMetadataLookupF32 (&status, config, "EXT_FIT_PADDING");
    49     EXT_FLUX_LIMIT       = EXT_FIT_NSIGMA * sky->sampleStdev;
     44    EXT_FIT_NSIGMA   = psMetadataLookupF32 (&status, config, "EXT_FIT_NSIGMA");
     45    EXT_FIT_PADDING  = psMetadataLookupF32 (&status, config, "EXT_FIT_PADDING");
    5046
    5147    // this function specifies the radius at this the model hits the given flux
     
    5652bool psphotCheckRadiusEXT (pmReadout *readout, pmSource *source, pmModel *model) {
    5753
     54    pmMoments *moments = source->moments;
     55    if (moments == NULL) return false;
     56
    5857    // set the fit radius based on the object flux limit and the model
    59     model->radius = modelRadiusEXT (model->params, EXT_FLUX_LIMIT) + EXT_FIT_PADDING;
     58    model->radius = modelRadiusEXT (model->params, EXT_FIT_NSIGMA*moments->dSky) + EXT_FIT_PADDING;
    6059    if (isnan(model->radius)) psAbort (__func__, "error in radius");
    6160
Note: See TracChangeset for help on using the changeset viewer.