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

mask out ocean using fractional overlap

  • 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.


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


  • Uses the 1:110m land mask from Natural Earth (

  • 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().