def mask_dilate(a, iterations=1, erode=False):
import scipy.ndimage as ndimage
a = checkma(a)
if erode:
a = mask_islands(a, iterations)
newmask = ~(np.ma.getmaskarray(a))
newmask = ndimage.morphology.binary_dilation(newmask, iterations=iterations)
return ~newmask
#This has not been tested thoroughly
评论列表
文章目录