njoy / NJOY2016

Nuclear data processing with legacy NJOY
https://www.njoy21.io/NJOY2016
Other
95 stars 82 forks source link

add verbose, extended precision file format output option to COVR #310

Open gregfi opened 9 months ago

gregfi commented 9 months ago

This change creates an alternative to the BOXR output file in COVR using currently-undefined values of the matype parameter. Modifying test #65 as:

covr
 41 51 0 /
 1 /
 u235 /
 /
9228 0 0 0 /
stop

The resulting output file (tape51) can be read with conventional Python as:

import numpy as np
import re
from io import StringIO

# read data from file
fileData=open('tape51').read()

# split into substrings based on "#"
splitData=list(filter(None, re.split('^#.*$', fileData, re.DOTALL, re.MULTILINE)))

# load into numpy arrays
erg, xs, stdev, covr = [np.loadtxt(StringIO(chunk)) for chunk in splitData]

When processing IRDFF covariance matrices into multigroup formats, as a result of the increased precision, the negative eigenvalues I get from the re-binning process drop by roughly 3 orders of magnitude.