SciPy

numpy.ma.masked_array.hardmask

attribute

masked_array.hardmask

Hardness of the mask