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

armi.nuclearDataIO.cccc.isotxs.compareNuclideXS(nuc1, nuc2, tolerance=0.0, verbose=False, nucName='')[source]
armi.nuclearDataIO.cccc.isotxs.addDummyNuclidesToLibrary(lib, dummyNuclides)[source]

This method adds DUMMY nuclides to the current ISOTXS library.

Parameters:
  • lib (obj) – ISOTXS library object

  • dummyNuclides (list) – List of DUMMY nuclide objects that will be copied and added to the GAMISO file

Notes

Since MC2-3 does not write DUMMY nuclide information for GAMISO files, this is necessary to provide a consistent set of nuclide-level data across all the nuclides in a XSLibrary.

class armi.nuclearDataIO.cccc.isotxs.IsotxsIO(fileName, lib, fileMode, getNuclideFunc)[source]

Bases: 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.

readWrite()[source]

Read and write ISOTSX file.

Implementation: Tool to read and write ISOTXS files. I_ARMI_NUCDATA_ISOTXS
signature: readWrite
requirements: R_ARMI_NUCDATA_ISOTXS

Reading and writing ISOTXS files is performed using the general nuclear data I/O functionalities described in I_ARMI_NUCDATA. Reading/writing a ISOTXS file is performed through the following steps:

  1. Read/write file ID record

  2. Read/write file 1D record, which includes:

    • Number of energy groups (NGROUP)

    • Maximum number of up-scatter groups (MAXUP)

    • Maximum number of down-scatter groups (MAXDN)

    • Maximum scattering order (MAXORD)

    • File-wide specification on fission spectrum type, i.e. vector or matrix (ICHIST)

    • Maximum number of blocks of scattering data (MSCMAX)

    • Subblocking control for scatter matrices (NSBLOK)

  3. Read/write file 2D record, which includes:

    • Library IDs for each isotope (HSETID(I))

    • Isotope names (HISONM(I))

    • Global fission spectrum (CHI(J)) if file-wide spectrum is specified (ICHIST = 1)

    • Energy group structure (EMAX(J) and EMIN)

    • Locations of each nuclide record in the file (LOCA(I))

      Note

      The offset data is not read from the binary file because the ISOTXS reader can dynamically calculate the offset itself. Therefore, during a read operation, this data is ignored.

  4. Read/write file 4D record for each nuclide, which includes isotope-dependent, group-independent data.

  5. Read/write file 5D record for each nuclide, which includes principal cross sections.

  6. Read/write file 6D record for each nuclide, which includes fission spectrum if it is flagged as a matrix (ICHI > 1).

  7. Read/write file 7D record for each nuclide, which includes the scattering matrices.