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 names like ISOAA, ISOBA, ISOCA, etc.
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) – XS library suffix used to determine which ISOTXS files are merged together
mergeGammaLibs (bool) – 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.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.isotxs.readBinary(),armi.nuclearDataIO.gamiso.readBinary(),armi.nuclearDataIO.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
-
getNuclide(nucName, suffix)[source]¶ Get a nuclide object from the XS library or None.
- 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¶
-
getScatterWeights(scatterMatrixKey='elasticScatter')[source]¶ Build or retrieve pre-built scatter weight data
This acts like a cache for _buildScatterWeights
See also
_buildScatterWeights()
-
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.compxs.readBinary()Examples
>>> lib = compxs.readBinary('COMPXS') >>> lib.regions
-
property
regions¶
-
property
regionLabels¶
-
property