get_data_and_mask#
- astropy.utils.masked.get_data_and_mask(array)[source]#
Split possibly masked array into unmasked and mask.
- Parameters:
- arraynumpy:array_like
Possibly masked item, judged by whether it has a
maskattribute. If so, checks for having anunmaskedattribute (as expected for instances ofMasked), or uses the_dataattribute if the inpuit is an instance ofMaskedArray.
- Returns:
- unmasked, masknumpy:array_like
If the input array had no mask, this will be
array, None.
- Raises:
AttributeErrorIf
arrayhas amaskbut not anunmaskedattribute, and is not an instance ofMaskedArray.ValueErrorIf
arrayisnp.ma.masked(since it has no data).