opendrift.models.eulerdrift.grid

Attributes

logger

Classes

RegularGrid

A regular grid.

Module Contents

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 = None
crs = None
ccrs = None
grid = None
extent_xy = None
res = None
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.