cf.Data.soften_mask

Data.soften_mask()[source]

Force the mask to soft.

Whether the mask of a masked array is hard or soft is determined by its hardmask property. soften_mask sets hardmask to False.

New in version 3.14.0.

See also

hardmask, harden_mask

Examples

>>> d = cf.Data([1, 2, 3])
>>> d.hardmask
True
>>> d.soften_mask()
>>> d.hardmask
False
>>> d = cf.Data([1, 2, 3], mask=[False, True, False], hardmask=False)
>>> d.hardmask
False
>>> d[1] = 999
>>> print(d.array)
[  1 999   3]