pylag.composite_data_reader module
Data reader for multiple sources of input data (ocean, wind, waves).
Note
composite_data_reader is implemented in Cython. Only a small portion of the API is exposed in Python with accompanying documentation. However, more details can be found in pylag.data_reader, where a set of python wrappers have been implemented.
- class pylag.composite_data_reader.CompositeDataReader(config, ocean_data_reader, atmosphere_data_reader=None, waves_data_reader=None)
Bases:
DataReader
DataReader for multiple sources of input data
Objects of type CompositeDataReader can be used to read in data from from multiple sources. The class structure follows the canonical Composite design pattern, in which both CompositeDataReader and the separate concrete data readers (class variables) it manages inherit a common interface from an abstract base class (DataReader).
CompositeDataReaders can be used to read in ocean data with atmospheric and wave data, where the latter may be stored on a different grid. CompositeDataReaders coordinate the reading in of all data, and direct data access requests to the appropriate data reader.
- Parameters
config (ConfigParser) – Configuration object.
ocean_data_reader (DataReader) – Ocean data reader. Optional, default None.
atmosphere_data_reader (DataReader) – Atmosphere data reader. Optional, default None.
waves_data_reader (DataReader) – Waves data reader. Optional, default None.
- get_grid_names(self)
Return a list of grid names
- get_xmin(self) DTYPE_FLOAT_t
- get_ymin(self) DTYPE_FLOAT_t
- read_data(self, DTYPE_FLOAT_t time)
Read in time dependent variable data from file?
time is used to test if new data should be read in from file. If this is the case, arrays containing time-dependent variable data are updated.
- Parameters
time (float) – The current time.
- setup_data_access(self, start_datetime, end_datetime)
Set up access to time-dependent variables.
- Parameters
start_datetime (Datetime) – Datetime object corresponding to the simulation start time.
end_datetime (Datetime) – Datetime object corresponding to the simulation end time.