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.
-
armi.nuclearDataIO.xsLibraries.getISOTXSLibrariesToMerge(xsLibrarySuffix, xsLibFileNames)[source]¶ Find ISOTXS libraries out of a list that should be merged based on the provided
xsLibrarySuffix- Parameters
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)[source]¶ Merge neutron (ISOTXS) and gamma (GAMISO/PMATRX) library data into the provided library.
- 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.
-
class
armi.nuclearDataIO.xsLibraries._XSLibrary[source]¶ Bases:
objectParent class for Isotxs and Compxs library objects.
-
property
neutronEnergyUpperBounds¶ Get or set the neutron energy groups.
-
property
neutronVelocity¶ Get or set the mean neutron velocity in cm/s.
-
property
-
class
armi.nuclearDataIO.xsLibraries.IsotxsLibrary[source]¶ Bases:
armi.nuclearDataIO.xsLibraries._XSLibraryIsotxsLibrary 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(),CompxsLibraryExamples
>>> 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
-
property
nuclideLabels¶ Get the nuclide Names.
-
property
nuclides¶
-
getScatterWeights(scatterMatrixKey='elasticScatter')[source]¶ Build or retrieve pre-built scatter weight data
This acts like a cache for _buildScatterWeights
See also
-
_buildScatterWeights(scatterMatrixKey)[source]¶ Build a scatter-weight lookup table for the scatter matrix.
Scatter “weights” are needed for sensitivity studies when deriviatives wrt the scatter XS are required. They are defined like:
\[w_{g^{\prime} \leftarrow g} = \frac{\sigma_{s,g^{\prime} \leftarrow g}} {\sum_{g^{\prime\prime}=1}^G \sigma_{s, g^{\prime\prime} \leftarrow g}}\]- Returns
scatterWeights – (xsID, fromGroup) : weight column (sparse Gx1).
- Return type
See also
terrapower.physics.neutronics.uq.sensitivities.MeshMatrix.derivativeM()
-
plotNucXs(nucNames, xsNames, fName=None, label=None, noShow=False, title=None)[source]¶ generates a XS plot for a nuclide on the ISOTXS library
- nucNamestr or list
The nuclides to plot
- xsNamestr or list
the XS to plot e.g. n,g, n,f, nalph, etc. see xsCollections for actual names.
- fNamestr, optional
if fName is given, the file will be written rather than plotting to screen
- labelstr, optional
is an optional label for image legends, useful in ipython sessions.
- noShowbool, optional
Won’t finalize plot. Useful for using this to make custom plots.
Examples
>>> l = ISOTXS() >>> l.plotNucXs('U238NA','fission')
Plot n,g for all xenon and krypton isotopes >>> f = lambda name: ‘XE’ in name or ‘KR’ in name >>> l.plotNucXs(sorted(filter(f,l.nuclides.keys())),itertools.repeat(‘nGamma’))
See also
armi.nucDirectory.nuclide.plotScatterMatrix()
-
property
-
class
armi.nuclearDataIO.xsLibraries.CompxsLibrary[source]¶ Bases:
armi.nuclearDataIO.xsLibraries._XSLibraryLibrary 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¶
-
property