IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 15958


Ignore:
Timestamp:
Dec 30, 2007, 5:02:08 PM (18 years ago)
Author:
eugene
Message:

need to exclude mostly-masked pixels, use nan as a sentinel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/imageops/psImageConvolve.c

    r15437 r15958  
    77/// @author Eugene Magnier, IfA
    88///
    9 /// @version $Revision: 1.60 $ $Name: not supported by cvs2svn $
    10 /// @date $Date: 2007-11-02 03:23:46 $
     9/// @version $Revision: 1.61 $ $Name: not supported by cvs2svn $
     10/// @date $Date: 2007-12-31 03:02:08 $
    1111///
    1212/// Copyright 2004-2007 Institute for Astronomy, University of Hawaii
     
    826826                g += *sg;
    827827            }
    828             *vo = (g > 0) ? s / g : 0.0;
     828            *vo = (g > 0.25) ? s / g : NAN;
    829829        }
    830830        memcpy(image->data.F32[j], calculation->data.F32, Nx*sizeof(psF32));
    831831    }
    832832    psFree(calculation);
     833
     834    // XXX test
     835    if (0) {
     836        psFree(gaussnorm);
     837        return true;
     838    }
    833839
    834840    /** Smooth in Y direction  **/
     
    855861            double g = gauss[n - j];
    856862            for (int i = 0; i < Nx; i++, vi++, vo++, vm++, vs++) {
    857                 if (*vm & maskVal)
    858                     continue;
     863                if (*vm & maskVal) continue;
     864                if (!isfinite(*vi)) continue;
    859865                *vo += *vi * g;
    860866                *vs += g;
     
    865871        psF32 *vs = outsum->data.F32;
    866872        for (int i = 0; i < Nx; i++, vo++, vs++) {
    867             *vo = (*vs > 0) ? *vo / *vs : 0.0;
     873            *vo = (*vs > 0.25) ? *vo / *vs : NAN;
    868874        }
    869875
Note: See TracChangeset for help on using the changeset viewer.