[Numpy-discussion] masked arrays and nd_image

Todd Miller jmiller at stsci.edu
Wed Aug 11 06:25:11 CDT 2004


On Wed, 2004-08-11 at 08:53, Curzio Basso wrote:
> Hi all.
> 
> I just tried to use a masked array with nd_image, namely to pass it to 
> the convolve1d() function, and I got:
> 
> error: getShape: couldn't get sequence length.
> 
> Does someone know if it possible at all to use nd_image on masked 
> arrays? 

I don't believe it is possible to use masked arrays directly because
they are not NumArrays or NumArray subclasses.   Masked arrays only
contain NumArrays which store the data and mask.

> Or if there is a possibility to do operations on masked images 
> without using the ma module?

I think the key here may be the "filled()" method which lets you convert
a masked array into a NumArray with the masked values filled into some
fill value, say 0.  I'm not sure what the post convolution mask value
should be.

Regards,
Todd





More information about the Numpy-discussion mailing list