armi.nuclearDataIO.xsLibraries module

Cross section library objects.

Cross section libraries, currently, contain neutron and/or gamma cross sections, but are not necessarily intended to be only neutron and gamma data.

armi.nuclearDataIO.xsLibraries.compare(lib1, lib2)[source]

Compare two XSLibraries, and return True if equal, or False if not.

armi.nuclearDataIO.xsLibraries.compareXSLibraryAttribute(lib1, lib2, attributeName, tolerance=0.0)[source]

Compare the values of an attribute in two libraries.

armi.nuclearDataIO.xsLibraries.compareLibraryNeutronEnergies(lib1, lib2, tolerance=0.0)[source]

Compare the neutron velocities and energy upper bounds for two libraries.

armi.nuclearDataIO.xsLibraries.getSuffixFromNuclideLabel(nucLabel)[source]

Return the xs suffix for the nuclide label.

Parameters:

nucLabel (str) – A string representing the nuclide and xs suffix, eg, “U235AA”

Returns:

suffix – The suffix of this string

Return type:

str

armi.nuclearDataIO.xsLibraries.getISOTXSLibrariesToMerge(xsLibrarySuffix, xsLibFileNames)[source]

Find ISOTXS libraries out of a list that should be merged based on the provided xsLibrarySuffix.

Parameters:
  • xsLibrarySuffix (str) – XS library suffix is used to determine which ISOTXS files should be merged together. This can be an empty string or be something like -doppler.

  • xsLibFileNames (list) – A list of library file paths like ISOAA, ISOBA, ISOCA, etc. Can be a standalone file name or a full path.

Notes

Files that exist: ISOAA-n1, ISOAB-n1, ISOAA-n2, ISOAB-n2, ISOAA, ISOAB, ISODA, ISOBA. xsLibrarySuffix: ‘n2’ Results: ISOAA-n2, ISOAB-n2

armi.nuclearDataIO.xsLibraries.mergeXSLibrariesInWorkingDirectory(lib, xsLibrarySuffix='', mergeGammaLibs=False, alternateDirectory=None)[source]

Merge neutron (ISOTXS) and gamma (GAMISO/PMATRX) library data into the provided library.

Notes

Convention is for fuel XS id to come first alphabetically (A, B, C, etc.) and then be followed by non-fuel. This should allow referenceDummyNuclide to be defined before it is needed by a non-fuel cross section, but if the convention is not followed then this could cause an issue.

Parameters:
  • lib (obj) – ISOTXS library object

  • xsLibrarySuffix (str, optional) – XS library suffix used to determine which ISOTXS files are merged together, typically something like -doppler. If empty string, will merge everything without suffix (indicated by a -).

  • mergeGammaLibs (bool, optional) – If True, the GAMISO and PMATRX files that correspond to the ISOTXS library will be merged. Note: if these files do not exist this will fail.

  • alternateDirectory (str, optional) – An alternate directory in which to search for files other than the working directory. The main purpose of this is for testing, but it could also be useful to users.

class armi.nuclearDataIO.xsLibraries.IsotxsLibrary[source]

Bases: _XSLibrary

IsotxsLibrary objects are a collection of cross sections (XS) for both neutron and gamma reactions.

IsotxsLibrary objects must be initialized with data through one of the read methods within this package

See also

armi.nuclearDataIO.cccc.isotxs.readBinary(), armi.nuclearDataIO.cccc.gamiso.readBinary(), armi.nuclearDataIO.cccc.pmatrx.readBinary(), CompxsLibrary

Examples

>>> lib = xsLibraries.IsotxsLibrary()
>>> # this doesn't have any information yet, we can read ISOTXS information
>>> libIsotxs = isotxs.readBinary('ISOAA')
>>> # any number of XSLibraries can be merged
>>> lib.merge(libIsotxs) # now the `lib` contains the ISOAA information.
property gammaEnergyUpperBounds

Get or set the gamma energy groups.

property neutronDoseConversionFactors

Get or set the neutron dose conversion factors.

property gammaDoseConversionFactors

Get or set the gamma does conversion factors.

property numGroups

Get the number of neutron energy groups.

property numGroupsGamma

Get the number of gamma energy groups.

property xsIDs

Get the XS ID’s present in this library.

Assumes the suffixes are the last 2 letters in the nucNames

get(nuclideLabel, default)[source]
getNuclide(nucName, suffix)[source]

Get a nuclide object from the XS library.

Parameters:
  • nucName (str) – ARMI nuclide name, e.g. ‘U235’, ‘PU239’

  • suffix (str) – Restrict to a specific nuclide lib suffix e.g. ‘AA’

Returns:

nuclide – A nuclide from the library or None

Return type:

Nuclide object

property nuclideLabels

Get the nuclide Names.

property nuclides
getNuclides(suffix)[source]

Returns a list of the nuclide objects in the library.

merge(other)[source]

Merge two XSLibraries.

resetScatterWeights()[source]
getScatterWeights(scatterMatrixKey='elasticScatter')[source]

Build or retrieve pre-built scatter weight data.

This acts like a cache for _buildScatterWeights

See also

_buildScatterWeights

purgeFissionProducts(r)[source]

Purge the fission products based on the active nuclides within the reactor.

Parameters:
  • r (py:class:armi.reactors.reactor.Reactor) – a reactor, or None

  • warning: (..) – Sometimes worker nodes do not have a reactor:

  • purged. (fission products will not be) –

class armi.nuclearDataIO.xsLibraries.CompxsLibrary[source]

Bases: _XSLibrary

Library object used in reading/writing COMPXS files.

Contains macroscopic cross sections for homogenized regions.

See also

IsotxsLibrary, armi.nuclearDataIO.cccc.compxs.readBinary()

Examples

>>> lib = compxs.readBinary('COMPXS')
>>> lib.regions
property regions
property regionLabels
merge(other)[source]

Merge two COMPXS libraries.