mesmer.core.mask.mask_ocean_fraction

mesmer.core.mask.mask_ocean_fraction#

mesmer.core.mask.mask_ocean_fraction(data, threshold, *, x_coords='lon', y_coords='lat')#

mask out ocean using fractional overlap

Parameters:
  • data (xr.Dataset | xr.DataArray) – Array to mask.

  • threshold (float) – Threshold above which land fraction to consider a grid point as a land grid point. Must be must be between 0 and 1 inclusive.

  • x_coords (str, default: “lon”) – Name of the x-coordinates.

  • y_coords (str, default: “lat”) – Name of the y-coordinates.

Returns:

data (xr.Dataset | xr.DataArray) – Array with ocean grid points masked out.

Notes

  • Uses the 1:110m land mask from Natural Earth (http://www.naturalearthdata.com).

  • The fractional overlap of individual grid points and the land mask can only be computed for regularly-spaced 1D x- and y-coordinates. For irregularly spaced coordinates use mesmer.mask.mask_land().