IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 31, 2006, 4:58:31 PM (20 years ago)
Author:
eugene
Message:

fixed up low-level issues with sky levels, sky bias

File:
1 edited

Legend:

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

    r6715 r6753  
    11# include "psphot.h"
     2# define RADIUS_TYPE float
    23
    34static float PSF_FIT_NSIGMA;
     
    2324
    2425    // set the fit radius based on the object flux limit and the model
    25     model->radius = modelRadiusPSF (model->params, PSF_FIT_NSIGMA*moments->dSky) + PSF_FIT_PADDING;
    26     if (isnan(model->radius)) psAbort ("apply_psf_model", "error in radius");
     26    model->radiusTMP = (RADIUS_TYPE) (modelRadiusPSF (model->params, PSF_FIT_NSIGMA*moments->dSky) + PSF_FIT_PADDING);
     27    if (isnan(model->radiusTMP)) psAbort ("apply_psf_model", "error in radius");
    2728       
    28     if (source->mode &  PM_SOURCE_MODE_SATSTAR) {
    29         model->radius *= 2;
     29    if (source->mode & PM_SOURCE_MODE_SATSTAR) {
     30        model->radiusTMP *= 2;
    3031    }
    3132
    32     bool status = pmSourceRedefinePixels (source, readout, model->params->data.F32[2], model->params->data.F32[3], model->radius);
     33    bool status = pmSourceRedefinePixels (source, readout, model->params->data.F32[2], model->params->data.F32[3], model->radiusTMP);
    3334    return status;
    3435}
     
    4041
    4142    // set the fit radius based on the object flux limit and the model
    42     model->radius = modelRadiusPSF (model->params, PSF_FIT_NSIGMA*moments->dSky) + dR + PSF_FIT_PADDING;
    43     if (isnan(model->radius)) psAbort ("apply_psf_model", "error in radius");
     43    model->radiusTMP = (RADIUS_TYPE) (modelRadiusPSF (model->params, PSF_FIT_NSIGMA*moments->dSky) + dR + PSF_FIT_PADDING);
     44    if (isnan(model->radiusTMP)) psAbort ("apply_psf_model", "error in radius");
    4445       
    4546    if (source->mode &  PM_SOURCE_MODE_SATSTAR) {
    46         model->radius *= 2;
     47        model->radiusTMP *= 2;
    4748    }
    4849
    49     bool status = pmSourceRedefinePixels (source, readout, model->params->data.F32[2], model->params->data.F32[3], model->radius);
     50    bool status = pmSourceRedefinePixels (source, readout, model->params->data.F32[2], model->params->data.F32[3], model->radiusTMP);
    5051    return status;
    5152}
     
    7374
    7475    // set the fit radius based on the object flux limit and the model
    75     model->radius = modelRadiusEXT (model->params, EXT_FIT_NSIGMA*moments->dSky) + EXT_FIT_PADDING;
    76     if (isnan(model->radius)) psAbort (__func__, "error in radius");
     76    model->radiusTMP = (RADIUS_TYPE) (modelRadiusEXT (model->params, EXT_FIT_NSIGMA*moments->dSky) + EXT_FIT_PADDING);
     77    if (isnan(model->radiusTMP)) psAbort (__func__, "error in radius");
    7778
    7879    // redefine the pixels if needed
    79     bool status = pmSourceRedefinePixels (source, readout, model->params->data.F32[2], model->params->data.F32[3], model->radius);
     80    bool status = pmSourceRedefinePixels (source, readout, model->params->data.F32[2], model->params->data.F32[3], model->radiusTMP);
    8081    return status;
    8182}
Note: See TracChangeset for help on using the changeset viewer.