get_data_and_mask#

astropy.utils.masked.get_data_and_mask(array)[源代码]#

将可能屏蔽的数组拆分为未屏蔽和屏蔽。

参数:
array : array_likeNumpy:ARRAY_LIKE

可能是蒙面物品,根据其是否有 mask 属性如果是,则检查是否具有 unmasked 属性(正如实例的预期 Masked), or uses the ``_ 如果输入是的实例,则为data '属性 MaskedArray .

返回:
unmasked, mask : array_likeNumpy:ARRAY_LIKE

如果输入数组没有屏蔽,那么这将是 array, None .

加薪:
AttributeError

如果 array 具有 mask 但不是 unmasked 属性,并且不是 MaskedArray .

ValueError

如果 arraynp.ma.masked (因为它没有数据)。