opendrift.models.eulerdrift.grid

Module Contents

Classes

RegularGrid

A regular grid.

Attributes

logger

opendrift.models.eulerdrift.grid.logger
class opendrift.models.eulerdrift.grid.RegularGrid(srs, grid)[source]

A regular grid.

The grid is projected using UTM with units in meters.

TODO: Subclass ndarray so that we don’t need to grid.grid.

Attributes:

grid: 2D grid, first dimension is easting (longitude), second northing (latitude).

srs
crs
ccrs
grid
extent_xy
res
static new(lon, lat, res, shape)[source]

Make a new regular grid.

Args:

lon, lat: Upper left corner of grid.

res: Size of grid cell (meters).

__make_grid__()[source]
center()[source]

Center of grid in longitude and latitude

contains(x, y)[source]

Check if points x and y are within grid.

plot(ax=None, crs=None)[source]

Show grid on axis (or create new figure and axis)

Args:

ax: Axis to plot grid on.

crs: Projection to use for plot (when setting up new plot), default (and

fastest) is grid projection.