particles.ClusterParticles#
- class particles.ClusterParticles(particle_types, fields)[source]#
Container class for particle initial conditions
Methods
__init__
(particle_types, fields)add_black_hole
(bh_mass[, pos, vel, use_pot_min])Add a black hole particle to the set of cluster particles.
add_offsets
(r_ctr, v_ctr[, ptypes])Add offsets in position and velocity to the cluster particles, which can be added to one or more particle types.
drop_ptypes
(ptypes)Drop all particles with a type in ptypes.
from_fields
(fields)from_file
(filename[, ptypes])Generate cluster particles from an HDF5 file.
from_gadget_file
(filename[, ptypes])Read in particle data from a Gadget (or Arepo, GIZMO, etc.) snapshot
from_h5_file
(filename[, ptypes])keys
()make_radial_cut
(r_max[, center, ptypes])Make a radial cut on particles.
set_field
(ptype, name, value[, units, add, ...])Add or update a particle field using a unyt_array.
to_yt_dataset
(box_size[, ptypes])Create an in-memory yt dataset for the particles.
write_particles
(output_filename[, overwrite])Write the particles to an HDF5 file.
write_particles_to_h5
(output_filename[, ...])write_to_gadget_file
(ic_filename, box_size)Write the particles to a file in the HDF5 Gadget format which can be used as initial conditions for a simulation.
Attributes