Module Contents



A combination of two readers.


none_or_cmp(a, b, cmp)

opendrift.readers.operators.readerops.none_or_cmp(a, b, cmp)[source]
class opendrift.readers.operators.readerops.Combined(a, b, op)[source]

Bases: opendrift.readers.basereader.BaseReader

A combination of two readers.

Common constructor for all readers

a :opendrift.readers.basereader.BaseReader
b :opendrift.readers.basereader.BaseReader
op :types.LambdaType
covers_positions(lon, lat)[source]

Return indices of input points covered by reader.

get_variables_interpolated(variables, *args, **kwargs)[source]

get_variables_interpolated is the main interface to opendrift.basemodel.OpenDriftSimulation, and is responsible for returning variables at the correct positions.

Readers should implement _get_variables_interpolated_().

variables: string, or list of strings (standard_name) of

requested variables. These must be provided by reader.

profiles: List of variable names that should be returned for the range in profiles_depth.

profiles_depth: A range [z-start, z-end] for which to return values for profile-variables. The exact z-depth are given by the reader and returned as z variable in env_profiles.

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

Can be None (default) if reader/variable has no time dimension (e.g. climatology or landmask).

lon: longitude, 1d array.

lat: latitude, 1d array, same length as lon.

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

of requested points. either scalar or same length as lon, lat. default: 0 m (unless otherwise documented by reader)

block: bool, see return below

rotate_to_proj: N/A


(env, env_profiles)

Interpolated variables at x, y and z. env contains values at a fixed depth (z), while env_profiles contains depth-profiles in the range profile_depth for the variables listed in profiles for each element (in x, y). The exact depth is determined by the reader and specified in env_profiles[‘z’]. Thus variables in env_profiles are not interpolated in z-direction.

See also