opendrift.readers.reader_current_from_drifter ============================================= .. py:module:: opendrift.readers.reader_current_from_drifter Classes ------- .. autoapisummary:: opendrift.readers.reader_current_from_drifter.Reader Module Contents --------------- .. py:class:: Reader(lons, lats, times, waves=None, z=0, name='reader_current_from_drifter') Bases: :py:obj:`opendrift.readers.basereader.BaseReader`, :py:obj:`opendrift.readers.basereader.ContinuousReader` An abstract reader. Implementors provide a method to read data and specify how it is interpolated. This class inherits :class:`.variables.Variables` which inherits :class:`.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 :py:mod:`opendrift.models.basemodel`, it defines the abstract interface to :meth:`.variables.Variables._get_variables_interpolated_` which reader-implementations must provide (_usually_ through one of the main reader-types, see: :py:mod:`opendrift.readers`). .. seealso:: :py:mod:`opendrift.readers`. :py:mod:`.variables`. Reconstruct currents from time series of drifter positions .. py:attribute:: variables :value: ['x_sea_water_velocity', 'y_sea_water_velocity'] .. py:attribute:: name :value: 'reader_current_from_drifter' .. py:attribute:: proj4 :value: '+proj=latlong' .. py:attribute:: xmin :value: -180 .. py:attribute:: xmax :value: 180 .. py:attribute:: ymin :value: -90 .. py:attribute:: ymax :value: 90 .. py:attribute:: times Setting this to `True` overrides temporal and spatial bounds checks. Also useful for readers that are constant and do not have a temporal dimension. .. py:attribute:: start_time .. py:attribute:: end_time .. py:attribute:: time_step .. py:attribute:: lon .. py:attribute:: lat .. py:attribute:: speed :value: [] .. py:attribute:: x_sea_water_velocity .. py:attribute:: y_sea_water_velocity .. py:method:: get_variables(requested_variables, time=None, x=None, y=None, z=None) Obtain and return values of the requested variables at all positions (x, y, z) closest to given time. Returns: Dictionary with arrays of length len(x) with values at exact positions x, y and z.