openmc.ParticleList

class openmc.ParticleList(iterable=(), /)[source]

A collection of SourceParticle objects.

Parameters

particles (list of SourceParticle) – Particles to collect into the list

export_to_hdf5(filename: str | os.PathLike, **kwargs)[source]

Export particle list to an HDF5 file.

This method write out an .h5 file that can be used as a source file in conjunction with the openmc.FileSource class.

Parameters
  • filename (path-like) – Path to source file to write

  • **kwargs – Keyword arguments to pass to h5py.File

classmethod from_hdf5(filename: str | os.PathLike) ParticleList[source]

Create particle list from an HDF5 file.

Parameters

filename (path-like) – Path to source file to read.

Return type

ParticleList instance

classmethod from_mcpl(filename: str | os.PathLike) ParticleList[source]

Create particle list from an MCPL file.

Parameters

filename (path-like) – Path to MCPL file to read.

Return type

ParticleList instance

to_dataframe() DataFrame[source]

A dataframe representing the source particles

Returns

DataFrame containing the source particles attributes.

Return type

pandas.DataFrame