IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33839


Ignore:
Timestamp:
May 1, 2012, 11:49:02 AM (14 years ago)
Author:
bills
Message:

if the MIN_RADIUS (from readout->analysis PSF_MOMENTS_RADIUS) is
larger than MAX_RADIUS (from EXT_FIT_MAX_RADIUS from recipe)
set MIN_RADIUS to the recipe's PSF_MOMENTS_RADIUS value

Get SKY_SLOPE_MIN a recipe value instead of the hard coded 3.0

File:
1 edited

Legend:

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

    r33411 r33839  
    5555static float MIN_RADIUS = NAN;
    5656static float SKY_STDEV  = NAN;
     57static float SKY_SLOPE_MIN = NAN;
    5758// static FILE *file = NULL;
    5859
     
    8182
    8283    MIN_RADIUS = psMetadataLookupF32 (&status, readout->analysis, "PSF_MOMENTS_RADIUS");
    83     if (!status) {
     84    if (!status || (MIN_RADIUS > MAX_RADIUS)) {
    8485        MIN_RADIUS = psMetadataLookupF32 (&status, recipe, "PSF_MOMENTS_RADIUS");
    8586    }
     
    8990    if (!status) {
    9091        SKY_STDEV = 1.0; // a crude default value (why would this not exist?)
     92    }
     93
     94    // SKY_SLOPE_MIN is the sigma of the sky model (ie, smoothed on large scales)
     95    SKY_SLOPE_MIN = psMetadataLookupF32 (&status, recipe, "SKY_SLOPE_MIN");
     96    if (!status) {
     97        SKY_SLOPE_MIN = 3.0;
    9198    }
    9299
     
    302309            limitSlope = slope;
    303310        }
    304         if (!limit && isfinite(slope) && (fabs(slope) < 3.0)) {
     311        if (!limit && isfinite(slope) && (fabs(slope) < SKY_SLOPE_MIN)) {
    305312            // SB no longer changing.       
    306313            limit = true;
    307314            // linearly interpolate to the radius at which we hit the sky, using the last flux and the limiting slope
    308315            if (isfinite(lastFlux)) {
    309                 float interpolatedRadius = lastRadius + lastFlux / 3.0;
     316                float interpolatedRadius = lastRadius + lastFlux / SKY_SLOPE_MIN;
    310317                if (interpolatedRadius < MAX_RADIUS) {
    311318                    limitRadius = interpolatedRadius;
Note: See TracChangeset for help on using the changeset viewer.