:py:mod:`opendrift.models.eulerdrift.grid` ========================================== .. py:module:: opendrift.models.eulerdrift.grid Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: opendrift.models.eulerdrift.grid.RegularGrid Attributes ~~~~~~~~~~ .. autoapisummary:: opendrift.models.eulerdrift.grid.logger .. py:data:: logger .. py:class:: RegularGrid(srs, grid) 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). .. py:attribute:: srs .. py:attribute:: crs .. py:attribute:: ccrs .. py:attribute:: grid .. py:attribute:: extent_xy .. py:attribute:: res .. py:method:: new(lon, lat, res, shape) :staticmethod: Make a new regular grid. Args: lon, lat: Upper left corner of grid. res: Size of grid cell (meters). .. py:method:: __make_grid__() .. py:method:: center() Center of grid in longitude and latitude .. py:method:: contains(x, y) Check if points x and y are within grid. .. py:method:: plot(ax=None, crs=None) 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.