opendrift.readers.reader_grib

Attributes

logger

grib_variable_mapping

Classes

Reader

A structured reader. Data is gridded on a regular grid. Used by e.g.:

Module Contents

opendrift.readers.reader_grib.logger
opendrift.readers.reader_grib.grib_variable_mapping
class opendrift.readers.reader_grib.Reader(filename=None, name=None)[source]

Bases: opendrift.readers.basereader.structured.StructuredReader

A structured reader. Data is gridded on a regular grid. Used by e.g.: opendrift.readers.reader_netCDF_CF_generic.Reader.

Attributes:

projected: is True if fakeproj.fakeproj is used because of missing projection information. The data points are assumed to be approximately equidistant on the surface (i.e. in meters).

clipped: pixels to to remove along boundary (e.g. in case of bad data).

Common constructor for all readers

xmin
xmax
ymin
ymax
delta_x
delta_y
marsParams
variables
indices
levels
get_variables(requested_variables, time=None, x=None, y=None, z=None)[source]

Obtain a _block_ of values of the requested variables at all positions (x, y, z) closest to given time. These will be stored in opendrift.readers.interpolation.structured.ReaderBlock and accessed from there.

Arguments:

variables: list of variables.

time: datetime or None, time at which data are requested.

x, y: float or ndarrays; coordinates of requested points.

z: float or ndarray; vertical position (in meters, positive up)

Returns:

Dictionary

keywords: variables (string) values: 2D ndarray bounding x and y.