openmc.SphericalHarmonicsFilter

class openmc.SphericalHarmonicsFilter(order, filter_id=None)[source]

Score spherical harmonic expansion moments up to specified order.

This filter allows you to obtain real spherical harmonic moments of either the particle’s direction or the cosine of the scattering angle. Specifying a filter with order \(\ell\) tallies moments for all orders from 0 to \(\ell\).

Parameters:
  • order (int) – Maximum spherical harmonics order, \(\ell\)
  • filter_id (int or None) – Unique identifier for the filter
Variables:
  • order (int) – Maximum spherical harmonics order, \(\ell\)
  • id (int) – Unique identifier for the filter
  • cosine ({'scatter', 'particle'}) – How to handle the cosine term.
  • num_bins (int) – 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.
to_xml_element()[source]

Return XML Element representing the filter.

Returns:element – XML element containing spherical harmonics filter data
Return type:xml.etree.ElementTree.Element