opendrift.readers.reader_constant_2d

Classes

Reader

Reader based on static 2D arrays of variables

Module Contents

class opendrift.readers.reader_constant_2d.Reader(x, y, array_dict, proj4='+proj=latlong')[source]

Bases: opendrift.readers.basereader.BaseReader, opendrift.readers.basereader.StructuredReader

Reader based on static 2D arrays of variables

init with a map {‘variable_name’: array, …}

proj4
xmin
xmax
ymin
ymax
variables
array_dict
start_time = None
end_time = None
time_step = None
name = 'reader_constant_2d'
get_variables(requestedVariables, 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.