yt.frontends.enzo.simulation_handling.EnzoSimulation.get_time_series

EnzoSimulation.get_time_series(time_data=True, redshift_data=True, initial_time=None, final_time=None, initial_redshift=None, final_redshift=None, initial_cycle=None, final_cycle=None, times=None, redshifts=None, tolerance=None, parallel=True, setup_function=None)[source]

Instantiate a DatasetSeries object for a set of outputs.

If no additional keywords given, a DatasetSeries object will be created with all potential datasets created by the simulation.

Outputs can be gather by specifying a time or redshift range (or combination of time and redshift), with a specific list of times or redshifts, a range of cycle numbers (for cycle based output), or by simply searching all subdirectories within the simulation directory.

time_data : bool
Whether or not to include time outputs when gathering datasets for time series. Default: True.
redshift_data : bool
Whether or not to include redshift outputs when gathering datasets for time series. Default: True.
initial_time : tuple of type (float, str)
The earliest time for outputs to be included. This should be given as the value and the string representation of the units. For example, (5.0, “Gyr”). If None, the initial time of the simulation is used. This can be used in combination with either final_time or final_redshift. Default: None.
final_time : tuple of type (float, str)
The latest time for outputs to be included. This should be given as the value and the string representation of the units. For example, (13.7, “Gyr”). If None, the final time of the simulation is used. This can be used in combination with either initial_time or initial_redshift. Default: None.
times : tuple of type (float array, str)
A list of times for which outputs will be found and the units of those values. For example, ([0, 1, 2, 3], “s”). Default: None.
initial_redshift : float
The earliest redshift for outputs to be included. If None, the initial redshift of the simulation is used. This can be used in combination with either final_time or final_redshift. Default: None.
final_redshift : float
The latest redshift for outputs to be included. If None, the final redshift of the simulation is used. This can be used in combination with either initial_time or initial_redshift. Default: None.
redshifts : array_like
A list of redshifts for which outputs will be found. Default: None.
initial_cycle : float
The earliest cycle for outputs to be included. If None, the initial cycle of the simulation is used. This can only be used with final_cycle. Default: None.
final_cycle : float
The latest cycle for outputs to be included. If None, the final cycle of the simulation is used. This can only be used in combination with initial_cycle. Default: None.
tolerance : float
Used in combination with “times” or “redshifts” keywords, this is the tolerance within which outputs are accepted given the requested times or redshifts. If None, the nearest output is always taken. Default: None.
parallel : bool/int
If True, the generated DatasetSeries will divide the work such that a single processor works on each dataset. If an integer is supplied, the work will be divided into that number of jobs. Default: True.
setup_function : callable, accepts a ds
This function will be called whenever a dataset is loaded.

Examples

>>> import yt
>>> es = yt.simulation("my_simulation.par", "Enzo")
>>> es.get_time_series(initial_redshift=10, final_time=(13.7, "Gyr"), 
                       redshift_data=False)
>>> es.get_time_series(redshifts=[3, 2, 1, 0])
>>> es.get_time_series(final_cycle=100000)
>>> # after calling get_time_series
>>> for ds in es.piter():
...     p = ProjectionPlot(ds, 'x', "density")
...     p.save()
>>> # An example using the setup_function keyword
>>> def print_time(ds):
...     print ds.current_time
>>> es.get_time_series(setup_function=print_time)
>>> for ds in es:
...     SlicePlot(ds, "x", "Density").save()