yt.frontends.stream.data_structures.
load_amr_grids
(grid_data, domain_dimensions, field_units=None, bbox=None, sim_time=0.0, length_unit=None, mass_unit=None, time_unit=None, velocity_unit=None, magnetic_unit=None, periodicity=(True, True, True), geometry='cartesian', refine_by=2)[source]¶Load a set of grids of data into yt as a
StreamHandler
.
This should allow a sequence of grids of varying resolution of data to be
loaded directly into yt and analyzed as would any others. This comes with
several caveats:
Parameters: | grid_data : list of dicts
domain_dimensions : array_like
field_units : dict
length_unit : string or float
mass_unit : string or float
time_unit : string or float
velocity_unit : string or float
magnetic_unit : string or float
bbox : array_like (xdim:zdim, LE:RE), optional
sim_time : float, optional
periodicity : tuple of booleans
geometry : string or tuple
refine_by : integer
|
---|
Examples
>>> grid_data = [
... dict(left_edge = [0.0, 0.0, 0.0],
... right_edge = [1.0, 1.0, 1.],
... level = 0,
... dimensions = [32, 32, 32],
... number_of_particles = 0)
... dict(left_edge = [0.25, 0.25, 0.25],
... right_edge = [0.75, 0.75, 0.75],
... level = 1,
... dimensions = [32, 32, 32],
... number_of_particles = 0)
... ]
...
>>> for g in grid_data:
... g["density"] = np.random.random(g["dimensions"]) * 2**g["level"]
...
>>> units = dict(density='g/cm**3')
>>> ds = load_amr_grids(grid_data, [32, 32, 32], field_units=units,
... length_unit=1.0)