IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25679


Ignore:
Timestamp:
Sep 29, 2009, 9:58:47 PM (17 years ago)
Author:
eugene
Message:

add asserts to catch bad radius tests

Location:
branches/eam_branches/20090715/psModules/src/objects/models
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090715/psModules/src/objects/models/pmModel_GAUSS.c

    r25351 r25679  
    260260    psEllipseAxes axes = psEllipseShapeToAxes (shape, 20.0);
    261261    psF64 radius = axes.major * sqrt (2.0 * log(PAR[PM_PAR_I0] / flux));
     262    psAssert (isfinite(radius, "fix this code: radius should not be nan for %f", PAR[PM_PAR_I0]));
     263
    262264    return (radius);
    263265}
  • branches/eam_branches/20090715/psModules/src/objects/models/pmModel_PGAUSS.c

    r25351 r25679  
    287287    // choose a z value guaranteed to be beyond our limit
    288288    float z0 = pow((1.0 / limit), (1.0 / 3.0));
     289    psAssert (isfinite(z0, "fix this code: z0 should not be nan for %f", PAR[PM_PAR_I0]));
    289290    float z1 = (1.0 / limit);
     291    psAssert (isfinite(z1, "fix this code: z1 should not be nan for %f", PAR[PM_PAR_I0]));
    290292    z1 = PS_MAX (z0, z1);
    291293    z0 = 0.0;
  • branches/eam_branches/20090715/psModules/src/objects/models/pmModel_PS1_V1.c

    r25678 r25679  
    325325    float z0 = 0.0;
    326326    float z1 = pow((1.0 / limit), (1.0 / ALPHA));
     327    psAssert (isfinite(z1, "fix this code: z1 should not be nan for %f", PAR[PM_PAR_7]));
    327328    if (PAR[PM_PAR_7] < 0.0) z1 *= 2.0;
    328329
  • branches/eam_branches/20090715/psModules/src/objects/models/pmModel_QGAUSS.c

    r25351 r25679  
    321321    // choose a z value guaranteed to be beyond our limit
    322322    float z0 = pow((1.0 / limit), (1.0 / 2.25));
     323    psAssert (isfinite(z0, "fix this code: z0 should not be nan for %f", PAR[PM_PAR_7]));
    323324    float z1 = (1.0 / limit) / PAR[PM_PAR_7];
     325    psAssert (isfinite(z1, "fix this code: z1 should not be nan for %f", PAR[PM_PAR_7]));
    324326    z1 = PS_MAX (z0, z1);
    325327    z0 = 0.0;
  • branches/eam_branches/20090715/psModules/src/objects/models/pmModel_RGAUSS.c

    r25351 r25679  
    314314    // choose a z value guaranteed to be beyond our limit
    315315    float z0 = pow((1.0 / limit), (1.0 / PAR[PM_PAR_7]));
     316    psAssert (isfinite(z0, "fix this code: z0 should not be nan for %f", PAR[PM_PAR_7]));
    316317    float z1 = (1.0 / limit);
     318    psAssert (isfinite(z1, "fix this code: z1 should not be nan for %f", PAR[PM_PAR_7]));
    317319    z1 = PS_MAX (z0, z1);
    318320    z0 = 0.0;
  • branches/eam_branches/20090715/psModules/src/objects/models/pmModel_SERSIC.c

    r25351 r25679  
    324324
    325325    psF64 z = pow (-log(limit), (1.0 / PAR[PM_PAR_7]));
     326    psAssert (isfinite(z, "fix this code: z should not be nan for %f", PAR[PM_PAR_7]));
    326327
    327328    psF64 radius = sigma * sqrt (2.0 * z);
     329    psAssert (isfinite(radius, "fix this code: radius should not be nan for %f, %f", PAR[PM_PAR_7], sigma));
    328330
    329331    if (isnan(radius))
Note: See TracChangeset for help on using the changeset viewer.