astropy/astropy — pull request #180 by wkerzendorf (2012-03-05 18:55:19+00:00)
Title: BoolMask

While developing the Spectrum1D class, we realized that there's a need for masks and errors that can deal with arithmetic.
The BoolMask is a first attempt to write a simple ndarray subclass that will create a new mask (in the maskedarray sense, masked=True) by applying a logical or to the mask of both operands.

mask1 = BoolMask(ones((100,100)))
mask2 = BoolMask(ones((100,100)))

mask1 + 5 -> ValueError unsupported operand types

mask1 + mask2 -> logical_or of the whole bool array.

There's obviously documentation missing, but I wanted to get some initial feedback before proceeding further.