armi.nuclearDataIO.cccc.isotxs module¶
This module reads and writes ISOTXS files.
ISOTXS is a binary file that contains multigroup microscopic cross sections. ISOTXS stands for Isotope Cross Sections.
ISOTXS files are often created by a lattice physics code such as MC2 or DRAGON and used as input to a global flux solver such as DIF3D.
This module implements reading and writing of the ISOTXS file format, consistent with [CCCC-IV].
Examples
>>> from armi.nuclearDataIO.cccc import isotxs
>>> myLib = isotxs.readBinary('ISOTXS-ref')
>>> nuc = myLib.getNuclide('U235','AA')
>>> fis5 = nuc.micros.fission[5]
>>> scat = nuc.micros.scatter[(0, 5, 6, 1)] # 1st order elastic scatter from group 5->6
>>> nuc.micros.fission[7] = fis5*1.01 # you can modify the isotxs too.
>>> captureEnergy = nuc.isotxsMetadata["ecapt"]
>>> isotxs.writeBinary(myLib, 'ISOTXS-modified')
-
armi.nuclearDataIO.cccc.isotxs.
compareSet
(fileNames, tolerance=0.0, verbose=False)[source]¶ takes a list of strings and reads all binaries with that name comparing them in all combinations
Notes
useful for finding mcc bugs when you want to compare a series of very similar isotxs outputs Verbose gets VERY long
-
armi.nuclearDataIO.cccc.isotxs.
compare
(lib1, lib2, tolerance=0.0, verbose=False)[source]¶ Compare two XSLibraries, and return True if equal, or False if not.
Notes
Tolerance allows the user to ignore small changes that may be caused by small library differences or floating point cacluations the closer to zero the more differences will be shown 10**-5 is a good tolerance to use if not using default. Verbose shows the XS matrixes that are not equal
-
class
armi.nuclearDataIO.cccc.isotxs.
_IsotxsIO
(fileName, lib, fileMode, getNuclideFunc)[source]¶ Bases:
armi.nuclearDataIO.cccc.cccc.Stream
A semi-abstract stream for reading and writing to a
Isotxs
.Notes
This is a bit of a special case compared to most other CCCC files because of the special nuclide-level container in addition to the XSLibrary container.
The
readWrite()
defines the ISOTXS file structure as specified in http://t2.lanl.gov/codes/transx-hyper/isotxs.html.Create an instance of a
Stream
.- Parameters
-
_FILE_LABEL
= 'ISOTXS'¶
-
_updateFileLabel
()[source]¶ Update the file label when reading in the ISOTXS-like file if it differs from its expected value.
Notes
This occurs when MC2-3 is preparing GAMISO files. The merging of ISOTXS-like files fail if the labels are not unique (i.e. merging ISOTXS into GAMISO with each file having a file label of ISOTXS.
-
readWrite
()[source]¶ This method should be implemented on any sub-classes to specify the order of records.
-
_rw2DRecord
(numNucs, nucNames)[source]¶ Read 2D ISOTXS record.
Notes
Contains isotope names, global chi distribution, energy group structure, and locations of each nuclide record in the file
-
class
armi.nuclearDataIO.cccc.isotxs.
_IsotxsNuclideIO
(nuclide, isotxsIO, lib)[source]¶ Bases:
object
A reader/writer class for ISOTXS nuclides.
Notes
This is to be used in conjunction with an _IsotxsIO object.
-
_rw4DRecord
()[source]¶ Read 4D ISOTXS record.
Notes
Read the following individual nuclide XS record. Load data into nuc. This record contains non-mg data like atomic mass, temperature, and some flags.
-
_rw7DRecord
(blockNumIndex, subBlock)[source]¶ Read scatter matrix
- Parameters
Notes
The data is stored as a giant array, and read in as a CSR matrix. The below matrix is lower triangular, where periods are non-zero.
. 0 0 0 0 0 . . 0 0 0 0 … 0 0 0 … . 0 0 … . . 0 … …
The data is read in rows starting at the top and going to the bottom. Per row, there are JBAND non-zero entries. Per row, there are JJ non-zero entries on or beyond the diagonal.
. 0 0 0 0 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Additionally, the data is reversed for whatever reason. So, let’s say we are reading the third row in our ficitious matrix. JBAND is 2, JJ is 1. We will read “1” first, and then “2” from the ISOTXS. Since they are backwards, we need to reverse the numbers before putting them into the matrix.
. 0 0 0 0 0 . . - - - - . 2 1 - - - - - - - - - - - - - - - - - - - - -
However, since we are reading a CSR, we can just add the indices in reverse (this is fast) and read the data in as is (which is a bit slower). Then we will allow the CSR matrix to fix the order later on, if necessary.
-
_getScatterBlockNum
(scatterType)[source]¶ Determine which scattering block is elastic scattering.
This information is stored in the scatFlab libparam and is possibly different for each nuclide (e.g. C, B-10, etc.)
-