DatasetDeque
- class typhon.datasets.dataset.DatasetDeque(ds, window, init_time, *args, **kwargs)[source]
A deque-like object sliding through a dataset.
For a particular dataset, keep data corresponding to time period in memory. When reading new data, discard a corresponding time period of data in the past. This should be useful to process longer periods of data that do not fit into memory, to calculate sliding window statistics, or to perform processing where values nearby in time are required.
- __init__(ds, window, init_time, *args, **kwargs)[source]
Initialise a DatasetDeque
- Parameters:
[Dataset] (ds) – Dataset that this belongs to, for example, HIRS(). This dataset must have an implementation of .as_xarray_dataset().
[timedelta] (window) – Duration that should be kept in memory. For example, datetime.timedelta(hours=48).
[datetime] (init_time) – Instant around which initial window shall be centred.
read_period. (Remaining arguments passed to)
Methods
__init__
(ds, window, init_time, *args, **kwargs)Initialise a DatasetDeque
move
(period, *args, **kwargs)Read period on the right, discard period on the left
reset
([newtime])Reset to initial conditions
resize
(window)Resize window
Attributes
center_time
data
dsobj
init_time
window