IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 15, 2006, 8:30:16 AM (21 years ago)
Author:
eugene
Message:

API cleanup, removed old test files, some re-organization, changed FLT/GAL to EXT

File:
1 edited

Legend:

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

    r5980 r5993  
    3131    }
    3232
    33 # if (1)
    3433    bool status = psphotRedefinePixels (source, imdata, model->params->data.F32[2], model->params->data.F32[3], model->radius);
    3534    return status;
    36 
    37 # else
    38 
    39     if (model->radius > PSF_OUTER_RADIUS) {
    40         // (re)-allocate image, weight, mask arrays for each peak (square of radius OUTER)
    41         psphotDefinePixels (source, imdata, model->params->data.F32[2], model->params->data.F32[3], model->radius);
    42         return true;
    43     } else {
    44         fprintf (stderr, "skipping %f,%f\n", model->params->data.F32[2], model->params->data.F32[3]);
    45     }
    46     return false;
    47 # endif
    4835}
    4936
     37static float EXT_OUTER_RADIUS;
     38static float EXT_FIT_PADDING;
     39static float EXT_FLUX_LIMIT;
     40static pmModelRadius modelRadiusEXT;
    5041
    51 static float GAL_OUTER_RADIUS;
    52 static float GAL_FIT_PADDING;
    53 static float GAL_FLUX_LIMIT;
    54 static pmModelRadius modelRadiusGAL;
    55 
    56 bool psphotInitRadiusFLT (psMetadata *config, psStats *sky, pmModelType type) {
     42bool psphotInitRadiusEXT (psMetadata *config, psStats *sky, pmModelType type) {
    5743
    5844    bool status;
    5945
    60     float GAL_FIT_NSIGMA = psMetadataLookupF32 (&status, config, "GAL_FIT_NSIGMA");
    61     GAL_OUTER_RADIUS     = psMetadataLookupF32 (&status, config, "GAL_OUTER_RADIUS");
    62     GAL_FIT_PADDING      = psMetadataLookupF32 (&status, config, "GAL_FIT_PADDING");
    63     GAL_FLUX_LIMIT       = GAL_FIT_NSIGMA * sky->sampleStdev;
     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;
    6450
    6551    // this function specifies the radius at this the model hits the given flux
    66     modelRadiusGAL       = pmModelRadius_GetFunction (type);
     52    modelRadiusEXT       = pmModelRadius_GetFunction (type);
    6753    return true;
    6854}
    6955
    70 bool psphotCheckRadiusFLT (eamReadout *imdata, pmSource *source, pmModel *model) {
     56bool psphotCheckRadiusEXT (eamReadout *imdata, pmSource *source, pmModel *model) {
    7157
    7258    // set the fit radius based on the object flux limit and the model
    73     model->radius = modelRadiusGAL (model->params, GAL_FLUX_LIMIT) + GAL_FIT_PADDING;
    74     if (isnan(model->radius)) psAbort ("fit_galaxies", "error in radius");
     59    model->radius = modelRadiusEXT (model->params, EXT_FLUX_LIMIT) + EXT_FIT_PADDING;
     60    if (isnan(model->radius)) psAbort (__func__, "error in radius");
    7561
    76 # if (1)
    7762    // redefine the pixels if needed
    7863    bool status = psphotRedefinePixels (source, imdata, model->params->data.F32[2], model->params->data.F32[3], model->radius);
    7964    return status;
    80 
    81 # else
    82 
    83     // check if we need to redefine the pixels
    84     if (model->radius > GAL_OUTER_RADIUS) {
    85         // (re)-allocate image, weight, mask arrays for each peak (square of radius OUTER)
    86         // do I need to save the old pixel and mask data?
    87         psphotDefinePixels (source, imdata, model->params->data.F32[2], model->params->data.F32[3], model->radius);
    88         return true;
    89     }
    90     return false;
    91 # endif
    9265}
Note: See TracChangeset for help on using the changeset viewer.