yt.frontends.stream.data_structures.
load_particles
(data, length_unit=None, bbox=None, sim_time=0.0, mass_unit=None, time_unit=None, velocity_unit=None, magnetic_unit=None, periodicity=(True, True, True), n_ref=64, over_refine_factor=1, geometry='cartesian')[source]¶Load a set of particles into yt as a
StreamParticleHandler
.
This should allow a collection of particle data to be loaded directly into yt and analyzed as would any others. This comes with several caveats:
This will initialize an Octree of data. Note that fluid fields will not work yet, or possibly ever.
Parameters: | data : dict
length_unit : float
mass_unit : float
time_unit : float
velocity_unit : float
magnetic_unit : float
bbox : array_like (xdim:zdim, LE:RE), optional
sim_time : float, optional
periodicity : tuple of booleans
n_ref : int
|
---|
Examples
>>> pos = [np.random.random(128*128*128) for i in range(3)]
>>> data = dict(particle_position_x = pos[0],
... particle_position_y = pos[1],
... particle_position_z = pos[2])
>>> bbox = np.array([[0., 1.0], [0.0, 1.0], [0.0, 1.0]])
>>> ds = load_particles(data, 3.08e24, bbox=bbox)