[SciPy-User] ndimage aware of masked arrays?

Jose Gomez-Dans jgomezdans@gmail....
Thu Oct 8 07:42:37 CDT 2009

I would like to apply a gaussian filter to a 2d (masked) array, but I would
only like to consider unmasked values (so that whenever it is calculating
the output for a given pixel, only pixels in the neighbourhood with values
unmasked are taken into account in the calculation). However,
ndimage.filters.gaussian_filter seems to be unaware of masked arrays:
>>> type( arr1 )
<class 'numpy.ma.core.MaskedArray'>
>>> gauss_arr1 = filters.gaussian_filter( arr1, (20,20) )

Is there some simple way of doing this?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20091008/dfe49aa5/attachment.html 

More information about the SciPy-User mailing list