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.

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

to_xml_element()[source]

Return XML Element representing the filter.

Returns

element – XML element containing spherical harmonics filter data

Return type

lxml.etree._Element