openmc.lib.Tally

class openmc.lib.Tally(uid=None, new=True, index=None)[source]

Tally stored internally.

This class exposes a tally that is stored internally in the OpenMC library. To obtain a view of a tally with a given ID, use the openmc.lib.tallies mapping.

Parameters
  • uid (int or None) – Unique ID of the tally

  • new (bool) – When index is None, this argument controls whether a new object is created or a view of an existing object is returned.

  • index (int or None) – Index in the tallies array.

Variables
  • id (int) – ID of the tally

  • estimator (str) – Estimator type of tally (analog, tracklength, collision)

  • filters (list) – List of tally filters

  • mean (numpy.ndarray) – An array containing the sample mean for each bin

  • multiply_density (bool) –

    Whether reaction rates should be multiplied by atom density

    New in version 0.14.0.

  • nuclides (list of str) – List of nuclides to score results for

  • num_realizations (int) – Number of realizations

  • results (numpy.ndarray) – Array of tally results

  • std_dev (numpy.ndarray) – An array containing the sample standard deviation for each bin

  • type (str) – Type of tally (volume, mesh_surface, surface)

ci_width(alpha=0.05)[source]

Confidence interval half-width based on a Student t distribution

Parameters

alpha (float) – Significance level (one minus the confidence level!)

Returns

Half-width of a two-sided (1 - \(alpha\)) confidence interval

Return type

float

find_filter(filter_type)[source]

Returns the first instance of a filter matching the specified type

Parameters

filter_type (subclass of openmc.lib.Filter) – The filter type to match when retrieving a filter instance

Returns

filter – The filter instance matching the input filter type

Return type

openmc.lib.Filter

Raises

ValueError if a filter instance matching the input filter type cannot be found.

reset()[source]

Reset results and num_realizations of tally