orbit.bunch_utils#

Functions

collect_bunch(bunch[, output_dir, return_memmap])

Collects attributes from a PyOrbit Bunch across all MPI ranks and returns it as a dictionary. :param bunch: The PyOrbit::Bunch object from which to collect attributes. :type bunch: Bunch :param output_dir: The director to use for temporary storage of the bunch coordinates on each MPI rank. If None, the bunch will be stored in "/tmp". Note: take care that the temporary files are created in a directory where all MPI ranks have write access. :type output_dir: str | pathlib.Path, optional :param return_memmap: Return the bunch coordinates as a memory-mapped NumPy array, otherwise the entire array is copied into RAM and returned as normal NDArray. Default is True. :type return_memmap: bool, optional.

load_bunch(input_dir[, Handler])

Loads the bunch attributes from a specified directory containing NumPy binary files. :param input_dir: The directory from which to load the bunch data files. :type input_dir: str | pathlib.Path :param Handler: The file handler class to use for reading the bunch data. Default is NumPyHandler. See orbit.bunch_utils.file_handler for available handlers. :type Handler: FileHandler, optional.

save_bunch(bunch[, output_dir, Handler])

Saves the collected bunch attributes to a specified directory.

Classes

ParticleIdNumber()

This routine adds id numbers to particle in a bunch.

Modules

orbit.bunch_utils.particleidnumber

orbit.bunch_utils.serialize