yt.data_objects.time_series.DatasetSeries

class yt.data_objects.time_series.DatasetSeries(outputs, parallel=True, setup_function=None, **kwargs)[source]

The DatasetSeries object is a container of multiple datasets, allowing easy iteration and computation on them.

DatasetSeries objects are designed to provide easy ways to access, analyze, parallelize and visualize multiple datasets sequentially. This is primarily expressed through iteration, but can also be constructed via analysis tasks (see Time Series Analysis).

Parameters:

filenames : list or pattern

This can either be a list of filenames (such as [“DD0001/DD0001”, “DD0002/DD0002”]) or a pattern to match, such as “DD*/DD*.index”). If it’s the former, they will be loaded in order. The latter will be identified with the glob module and then sorted.

parallel : True, False or int

This parameter governs the behavior when .piter() is called on the resultant DatasetSeries object. If this is set to False, the time series will not iterate in parallel when .piter() is called. If this is set to either True or an integer, it will be iterated with 1 or that integer number of processors assigned to each parameter file provided to the loop.

setup_function : callable, accepts a ds

This function will be called whenever a dataset is loaded.

Examples

>>> ts = DatasetSeries(
        "GasSloshingLowRes/sloshing_low_res_hdf5_plt_cnt_0[0-6][0-9]0")
>>> for ds in ts:
...     SlicePlot(ds, "x", "Density").save()
...
>>> def print_time(ds):
...     print ds.current_time
...
>>> ts = DatasetSeries(
...     "GasSloshingLowRes/sloshing_low_res_hdf5_plt_cnt_0[0-6][0-9]0",
...      setup_function = print_time)
...
>>> for ds in ts:
...     SlicePlot(ds, "x", "Density").save()

Methods