pisces.extensions.simulation.gadget.particles.GadgetParticleDataset.copy#

GadgetParticleDataset.copy(output_path: str | Path, overwrite: bool = False, **kwargs) ParticleDataset#

Create a full copy of this particle dataset at a new location.

This method replicates the entire contents of the HDF5 file, including all particle groups, fields, field metadata, and global attributes, into a new file. It returns a new ParticleDataset instance pointing to the copied file.

Parameters:
  • output_path (str or Path) – The path to the new HDF5 file to create.

  • overwrite (bool, optional) – If True, overwrite the file at output_path if it already exists. Defaults to False.

  • **kwargs – Additional keyword arguments passed to the constructor of the copied dataset.

Returns:

A new dataset instance pointing to the copied file.

Return type:

ParticleDataset

Raises: