stilt.Grid#

class stilt.Grid(*, xmin: float, xmax: float, ymin: float, ymax: float, xres: float, yres: float, crs: str = '+proj=longlat') → None[source]#

Footprint grid: longitude/latitude bounds, cell size, and CRS.

The bounds are always longitude/latitude. With a projected crs, the grid covers the bounds’ extent in that projection and xres and yres are in its units.

Parameters#

Parameter

Description

Default

xmin

Western edge, in degrees longitude.

Required

xmax

Eastern edge, in degrees longitude.

Required

ymin

Southern edge, in degrees latitude.

Required

ymax

Northern edge, in degrees latitude.

Required

xres

Cell width in projection units (degrees for longlat, meters for UTM).

Required

yres

Cell height in projection units (degrees for longlat, meters for UTM).

Required

crs

Coordinate reference system of the footprint grid, such as a PROJ string or EPSG:32612. Particles and bounds are projected to it before gridding. Also read under STILT-R’s name, projection.

'+proj=longlat'

Attributes#

axes

Cell-center coordinates (x, y) in projection units, ascending.

cells

Every cell center as flat (x, y) arrays, with x varying slowest.

dims

The names of a footprint's horizontal dimensions on this grid, ("lat", "lon") or ("y", "x").

index

Index of every cell, in the same order as cells.

is_longlat

Whether the grid is in longitude/latitude degrees.

Methods#

to_xarray()

Return the grid as a CF-1.8 dataset of cell centers.