opendrift.readers.reader_constant_2d

Module Contents

Classes

Reader

Reader based on static 2D arrays of variables

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, …}

get_variables(self, 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.