Skip to content

Regions

Box dataclass

Box(lat: tuple[float, float] = (-90.0, 90.0), lon: tuple[float, float] | None = None, name: str | None = None)

A latitude and longitude box in degrees.

Parameters:

Name Type Description Default
lat (south, north)
(-90.0, 90.0)
lon (west, east)

Read eastward from west to east. west > east crosses the antimeridian. None keeps all longitudes.

None
name str
None

lon_width property

lon_width: float

Eastward width in degrees, 360 for all longitudes.

west property

west: float

West edge expressed in [-180, 180).

MaskRegion dataclass

MaskRegion(regions: Any, key: int | str)

One region of a regionmask.Regions collection, used as a polygon mask.

mask

mask(lat: ndarray, lon: ndarray) -> xr.DataArray

Boolean mask on a rectilinear grid, True inside the region.