- compass.landice.mesh.gridded_flood_fill(field, iStart=None, jStart=None)[source]¶
Generic flood-fill routine to create mask of connected elements in the desired input array (field) from a gridded dataset. This is generally used to remove glaciers and ice-fields that are not connected to the ice sheet. Note that there may be more efficient algorithms.
field (numpy.ndarray) – Array from gridded dataset to use for flood-fill. Usually ice thickness.
iStart (int) – x index from which to start flood fill for field. Defaults to the center x coordinate.
jStart (int) – y index from which to start flood fill. Defaults to the center y coordinate.
flood_mask (numpy.ndarray) – mask calculated by the flood fill routine, where cells connected to the ice sheet (or main feature) are 1 and everything else is 0.