IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 24045


Ignore:
Timestamp:
May 3, 2009, 3:23:46 PM (17 years ago)
Author:
eugene
Message:

handle case where the ellipse is ill-defined

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psastro/src/psastroMaskUtils.c

    r23810 r24045  
    181181bool psastroMaskEllipticalAnnulus (psImage *mask, psImageMaskType value, float x0, float y0, psEllipseAxes eInner, psEllipseAxes eOuter) {
    182182
     183    // skip the masking if the outer ellipse is nonsensical
     184    psEllipseShape sOuter = psEllipseAxesToShape (eOuter);
     185    if (isnan(sOuter.sx) || isnan(sOuter.sy) || isnan(sOuter.sxy)) return false;
     186
    183187    psEllipseShape sInner = psEllipseAxesToShape (eInner);
    184     psEllipseShape sOuter = psEllipseAxesToShape (eOuter);
     188    if (isnan(sInner.sx) || isnan(sInner.sy) || isnan(sInner.sxy)) {
     189        // use a solid ellipse if the inner ellipse is nonsensical
     190        sInner.sx = 0.1;
     191        sInner.sy = 0.1;
     192        sInner.sxy = 0.0;
     193    }
    185194
    186195    // phi is the coordinate along the elliptical path
Note: See TracChangeset for help on using the changeset viewer.