Module Contents



An abstract reader. Implementors provide a method to read data and specify how it is interpolated.


rotate_vectors_angle(u, v, radians)



class opendrift.readers.reader_ROMS_native.Reader(filename=None, name=None, gridfile=None, standard_name_mapping={})[source]

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

An abstract reader. Implementors provide a method to read data and specify how it is interpolated.

This class inherits variables.Variables which inherits variables.ReaderDomain. ReaderDomain is responsible for the extent and domain of the reader, including checking for out-of-bounds and projection conversion. Variables is responsible for returning interpolated data at the requests positions or profiles. Apart from coercing the returned data into the right type for opendrift.models.basemodel, it defines the abstract interface to variables.Variables._get_variables_interpolated_() which reader-implementations must provide (_usually_ through one of the main reader-types, see: opendrift.readers).

Common constructor for all readers

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.


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)



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

opendrift.readers.reader_ROMS_native.rotate_vectors_angle(u, v, radians)[source]