serpentTools.MicroXSReader¶
-
class
serpentTools.
MicroXSReader
(filePath)¶ Parser responsible for reading and working with micro-xs (mdx) files.
- Parameters
filePath (str) – path to the
*mdx[n].m
file
-
nfy
¶ Nested dictionary with tuples (parent, energy) as keys. Parent is the isotope undergoing fission, e.g. 922350 and energy is the impending neutron energy causing fission in MeV. The values are nested dictionaries with the following structure:
"fissProd": list of fission product ZAI ids, e.g. [541350, 551350, ...] "indYield": list of independent yields "cumYield": list of cumulative yields
- Type
-
fluxRatio
¶ Dictionary with universes id as keys and the corresponding group-wise flux values. e.g.,
fluxRatio['0'] = [9.91938E+14, 1.81729E+15]
- Type
-
fluxUnc
¶ Dictionary with universes id as keys and the corresponding group-wise flux uncertainty values. e.g.,
fluxRatio['0'] = [0.00023, 0.00042]
- Type
-
xsVal
¶ Expected value on microscopic cross sections, sorted by universe then by isotope, reaction, and metastable flag. Nested dictionary with universes as keys, e.g. ‘0’. The values are nested dictionary with
MicroXSTuple
as keys (isotope, reaction, flag) and group xs as values. e.g.,(922350, 18, 0)
- Type
-
xsUnc
¶ Uncertainties on microscopic cross sections, sorted by universe then by isotope, reaction, and metastable flag. Nested dictionary with universes as keys, e.g. ‘0’. The values are nested dictionary with
MicroXSTuple
as keys (isotope, reaction, flag) and group xs as values. e.g.,(922350, 18, 0)
- Type
- Raises
SerpentToolsException – No results exist in the file, or no results are collected
-
compare
(other, lower=0, upper=10, sigma=2, verbosity=None)¶ Compare the results of this reader to another.
For values without uncertainties, the upper and lower arguments control what passes and what messages get raised. If a quantity in
other
is less thanlower
percent different that the same quantity on this object, consider this allowable and make no messages. Quantities that are greater thanupper
percent different will have a error messages printed and the comparison will returnFalse
, but continue. Quantities with difference between these ranges will have warning messages printed.- Parameters
other – Other reader instance against which to compare. Must be a similar class as this one.
lower (float or int) – Lower limit for relative tolerances in percent Differences below this will be considered allowable
upper (float or int) – Upper limit for relative tolerances in percent. Differences above this will be considered failure and errors messages will be raised
sigma (int) – Size of confidence interval to apply to quantities with uncertainties. Quantities that do not have overlapping confidence intervals will fail
verbosity (None or str) – If given, update the verbosity just for this comparison.
- Returns
True
if the objects are in agreement with each other according to the parameters specified- Return type
- Raises
TypeError – If
other
is not of the same class as this class nor a subclass of this classValueError – If upper > lower, If sigma, lower, or upper are negative
-
getFY
(parent, energy, daughter, flagEnergy=True)¶ - Return a specific fission yield given the parent ID, neutron energy
and daughter ID
If the energy does not exist in the results, the fission yield corresponding to the closest energy is returned
- Parameters
- Returns
indYield (float) – Independent fission yield
cumYield (float) – Cumulative fission yield
- Raises
SerpentToolsException: – If energy is a negative number If parent or fission product are not found
-
getXS
(universe, isotope, reaction, isomeric=0)¶ Return the group-wise micro cross-sections for a specific isotope, and reaction
- Parameters
- Returns
xsVal (numpy.ndarray) – Group-wise cross-section values
xsUnc (numpy.ndarray) – Group-wise uncertainty values
- Raises
SerpentToolsException: – If the universe does not exist If the isotope’s format is incorrect (not ZZAAA0/1)
-
read
()¶ The main method for reading that not only parses data, but also runs pre and post checks.