InitialConditions#
- class pisces.extensions.simulation.core.initial_conditions.InitialConditions(directory: str | Path)[source]#
Central base class for configuring simulation initial conditions.
This class provides the backbone of simulation initial conditions (ICs) in Pisces. It effectively provides a wrapper by which to place multiple models into a cartesian space with various orientations, velocities, etc. The initial conditions can then be processed by the simulation frontends to generate input files for various astrophysical simulation codes.
For more detailed information about using and interacting with initial conditions, read Initial Conditions for Simulations.
Methods
__init__
(directory)Load an existing set of initial conditions from a target directory.
add_model
(name, model, model_config[, ...])Add a new model to these initial conditions.
add_particles_to_model
(particle_path, model_name)Attach a particle dataset file to an existing model in the initial conditions.
compute_center_of_mass
([models, masses])Compute the mass-weighted center of mass (COM) position for one or more models in the initial conditions.
Compute the positions of models in the center-of-mass (COM) frame.
Compute the velocities of models in the center-of-mass (COM) frame.
compute_center_of_mass_velocity
([models, masses])Compute the mass-weighted center-of-mass (COM) velocity for one or more models in the initial conditions.
compute_total_mass
([models, masses])Compute the total mass of one or more models in the initial conditions.
create_ics
(directory, *models[, particle_files])Create a new initial conditions (IC) directory with optional particle datasets.
generate_particles
(model_name, num_particles)Generate particles for a stored model using its internal particle generation method.
get_model_coordinate_system
(model_name)Retrieve the coordinate system of a stored model without fully loading it.
get_model_fields
(model_name)Inspect the available fields in a stored model without fully loading it.
get_model_grid
(model_name)Retrieve the grid object of a stored model without fully loading it.
get_model_info
(model_name)Retrieve the configuration information for a specific model.
get_model_metadata
(model_name)Inspect the metadata of a stored model without fully loading it.
get_model_summary
(model_name[, include_fields])Retrieve a combined summary of a stored model without fully loading it.
get_particle_count
(model_name)Inspect the number of particles in each species group for a stored model.
get_particle_fields
(model_name)Inspect the available fields for each particle species in a model.
get_particle_path
(model_name)Retrieve the particle file path associated with a specific model.
Retrieve a dictionary mapping model names to their associated particle file paths.
get_particle_species
(model_name)List the particle species present in the stored particle dataset for a given model.
has_model
(model_name)Check if a model with the given name exists in these initial conditions.
has_particles
(model_name)Check if a specific model has associated particles.
integrate_point_mass_orbits
([models, ...])Integrate the point-mass equivalent orbits for selected models.
List all models currently stored in these initial conditions.
List all models that have associated particle datasets.
load_model
(name)Load a specific model from the initial conditions.
load_particles
(model_name, **kwargs)Load the particle dataset associated with a specific model.
remove_model
(name)Remove a model and its associated files from the initial conditions.
remove_particles_from_model
(model_name[, ...])Detach and optionally delete the particle dataset associated with a specific model.
shift_to_COM_frame
([models, masses])Shift the positions and velocities of models into the center-of-mass (COM) frame.
update_model
(model_name, **parameters)Update parameters of an existing model in the initial conditions.
Attributes
The configuration manager for the initial conditions.
The directory where the initial conditions are stored.
Logger instance for the InitialConditions class.
The metadata associated with the initial conditions.
The orientations of the models in the initial conditions.
The positions of the models in the initial conditions.
The spins of the models in the initial conditions.
The velocities of the models in the initial conditions.
The processed models used in the initial conditions.
The number of dimensions for the initial conditions.
The particle files associated with the models in the initial conditions.