yt.frontends.stream.data_structures.
load_uniform_grid
(data, domain_dimensions, length_unit=None, bbox=None, nprocs=1, sim_time=0.0, mass_unit=None, time_unit=None, velocity_unit=None, magnetic_unit=None, periodicity=(True, True, True), geometry='cartesian')[source]¶Load a uniform grid of data into yt as a
StreamHandler
.
This should allow a uniform grid of data to be loaded directly into yt and analyzed as would any others. This comes with several caveats:
Particle fields are detected as one-dimensional fields. The number of particles is set by the “number_of_particles” key in data.
Parameters: | data : dict
domain_dimensions : array_like
length_unit : string
bbox : array_like (xdim:zdim, LE:RE), optional
nprocs: integer, optional :
sim_time : float, optional
mass_unit : string
time_unit : string
velocity_unit : string
magnetic_unit : string
periodicity : tuple of booleans
geometry : string or tuple
|
---|
Examples
>>> bbox = np.array([[0., 1.0], [-1.5, 1.5], [1.0, 2.5]])
>>> arr = np.random.random((128, 128, 128))
>>> data = dict(density = arr)
>>> ds = load_uniform_grid(data, arr.shape, length_unit='cm',
bbox=bbox, nprocs=12)
>>> dd = ds.all_data()
>>> dd['Density']
#FIXME YTArray[123.2856, 123.854, ..., 123.456, 12.42] (code_mass/code_length^3)
>>> data = dict(density = (arr, 'g/cm**3'))
>>> ds = load_uniform_grid(data, arr.shape, 3.03e24, bbox=bbox, nprocs=12)
>>> dd = ds.all_data()
>>> dd['Density']
#FIXME YTArray[123.2856, 123.854, ..., 123.456, 12.42] (g/cm**3)