get_data_and_mask#
- astropy.utils.masked.get_data_and_mask(array)[source]#
Split possibly masked array into unmasked and mask.
- Parameters:
- arrayarray_like
Possibly masked item, judged by whether it has a
mask
attribute. If so, checks for having anunmasked
attribute (as expected for instances ofMasked
), or uses the_data
attribute if the inpuit is an instance ofMaskedArray
.
- Returns:
- unmasked, maskarray_like
If the input array had no mask, this will be
array, None
.
- Raises:
AttributeError
If
array
has amask
but not anunmasked
attribute, and is not an instance ofMaskedArray
.ValueError
If
array
isnp.ma.masked
(since it has no data).