openmc.ParticleFilter

class openmc.ParticleFilter(bins, filter_id=None)[source]

Bins tally events based on the Particle type.

Parameters
  • bins (str, or iterable of str) – The particles to tally represented as strings (‘neutron’, ‘photon’, ‘electron’, ‘positron’).

  • filter_id (int) – Unique identifier for the filter

Variables
  • bins (iterable of str) – The particles to tally

  • id (int) – Unique identifier for the filter

  • num_bins (Integral) – The number of filter bins

classmethod from_hdf5(group, **kwargs)[source]

Construct a new Filter instance from HDF5 data.

Parameters

group (h5py.Group) – HDF5 group to read from

Keyword Arguments

meshes (dict) – Dictionary mapping integer IDs to openmc.MeshBase objects. Only used for openmc.MeshFilter objects.

classmethod from_xml_element(elem, **kwargs)[source]

Generate a filter from an XML element

Parameters
  • elem (lxml.etree._Element) – XML element

  • **kwargs – Keyword arguments (e.g., mesh information)

Returns

Filter object

Return type

openmc.Filter