sandy.sections.mf6 module
This module contains only two public functions:
read_mf6
write_mf6
Function read reads a MF6/MT section from a string and produces a content object with a dictionary-like structure. The content object can be accessed using most of the keywords specified in the ENDF6 manual for this specific MF section.
Function write_mf6 writes a content object for a MF6/MT section into a string. MAT, MF, MT and line numbers are also added (each line ends with a ` `).
- sandy.sections.mf6.read_mf6(tape, mat, mt)
Parse MAT/MF=6/MT section from sandy.Endf6 object and return structured content in nested dictionary.
- Parameters:
- tapesandy.Endf6
endf6 object containing requested section.
- matint
MAT number.
- mtint
MT number.
- Returns:
- outdict
Content of the ENDF-6 tape structured as nested dict.
Examples
Since the outputs are very large, I am only going to check only some information for the test:
LAW 1:
>>> tape = sandy.get_endf6_file("endfb_71", 'xs', 70140) >>> test = read_mf6(tape, 725, 5) >>> test["NK"][10010]["EGROUPS"][1e-05] {'ND': 0, 'NA': 1, 'NW': 6, 'NEP': 2, 'Ep': [0.0, 1e-05], 'b': [100000.0, 0.0, 0.0, 0.0]}
LAW 2:
>>> import pprint >>> tape = sandy.get_endf6_file("endfb_71", 'xs', 10010) >>> test = read_mf6(tape, 125, 102) >>> test["NK"][10020]['AWP'] = round (test["NK"][10020]['AWP'], 5) >>> pprint.pprint(test["NK"][10020]) {'AWP': 1.99626, 'E': array([1.e-05, 2.e+07]), 'LAW': 4, 'NP': [2], 'NR': [2], 'Y': array([1., 1.])}
LAW 6:
>>> tape = sandy.get_endf6_file("endfb_71", 'xs', 10020) >>> test = read_mf6(tape, 128, 16) >>> test["NK"][10]['APSX'] = round (test["NK"][10]['APSX'],5) >>> test["NK"][10] {'AWP': 1.0, 'LAW': 6, 'NR': [2], 'NP': [2], 'E': array([3.339002e+06, 1.500000e+08]), 'Y': array([2., 2.]), 'APSX': 2.99862, 'NPSX': 3}
LAW 7:
>>> tape = sandy.get_endf6_file("endfb_71", 'xs', 40090) >>> test = read_mf6(tape, 425, 16) >>> test["NK"][10]["EGROUPS"][1748830.0]['COSGROUPS'][-1.0] {'NRP': [15], 'NEP': [2], 'EP_INT': array([ 1092.99, 1093. , 3278.9 , 7650.8 , 12023. , 20766. , 29510. , 55741. , 71043. , 81973. , 90716. , 95088. , 99460. , 101650. , 101651. ]), 'E_p': array([0.00000e+00, 1.16614e-06, 1.58588e-06, 1.54624e-06, 7.09710e-07, 1.79581e-07, 2.86776e-08, 0.00000e+00]), 'E_distr': array([7.40674e-07, 1.46654e-06, 1.61094e-06, 1.07195e-06, 4.02172e-07, 9.52648e-08, 4.69275e-09])}
- sandy.sections.mf6.write_mf6(sec)
Given the content of a MF6 section as nested dictionaries, write it to string.
- Parameters:
- sec‘dict’
Multiline string reproducing the content of a ENDF-6 section.
- Returns:
- str
Multiline string reproducing the content of a ENDF-6 section.
Notes
Note
The end-of-line records MAT, MF, MT and line number are added at the end of each line.
Note
MF6 LAW5 writing is not tested because not found in existing major nuclear data libraries.
Important
The string does not endf with a newline symbol.
Examples
As we have a law-dependent structure, I will develop a test for each law. LAW 1: >>> tape = sandy.get_endf6_file(“endfb_71”, ‘xs’, 70140) >>> sec = read_mf6(tape, 725, 5) >>> text = write_mf6(sec) >>> print(text[:1000])
7014.00000 13.8828000 0 3 22 0 725 6 5 1 1.00000000 1.00000000 0 1 1 19 725 6 5 2
19 2 725 6 5 3
1.000000-5 7.880151-1 20000000.0 7.880151-1 20000010.0 7.880151-1 725 6 5 4 23000000.0 8.736206-1 27000000.0 1.04544100 30000000.0 1.09352800 725 6 5 5 35000000.0 1.15156600 40000000.0 1.20729400 50000000.0 1.29613300 725 6 5 6 60000000.0 1.36702400 70000000.0 1.42382400 80000000.0 1.51414400 725 6 5 7 90000000.0 1.61200000 100000000 1.70471900 110000000 1.93624400 725 6 5 8
120000000 2.02639000 130000000 2.09783300 140000000 2.17252600 725 6 5 9 150000000 2.23843500 725 6 5 10
- 0.00000000 0.00000000 2 1 1 1 725 6 5 11
19 2 725 6 5 12
0.00000000 1.000000-5
LAW 2: >>> tape = sandy.get_endf6_file(“endfb_71”, ‘xs’, 10010) >>> sec = read_mf6(tape, 125, 102) >>> text = write_mf6(sec) >>> print(text[:1000])
1001.00000 9.991673-1 0 2 2 0 125 6102 1 0.00000000 2223300.00 0 2 1 2 125 6102 2
2 2 125 6102 3
1.000000-5 1.00000000 20000000.0 1.00000000 125 6102 4 0.00000000 0.00000000 0 0 1 96 125 6102 5
96 2 125 6102 6
0.00000000 1.000000-5 0 0 2 2 125 6102 7
- -6.160950-8-8.86237-13 125 6102 8
0.00000000 2.000000-5 0 0 2 2 125 6102 9
- -8.712894-8-1.77244-12 125 6102 10
0.00000000 5.000000-5 0 0 2 2 125 6102 11
- -1.377628-7-4.43100-12 125 6102 12
0.00000000 1.000000-4
LAW 6: >>> tape = sandy.get_endf6_file(“endfb_71”, ‘xs’, 10020) >>> sec = read_mf6(tape, 128, 16) >>> text = write_mf6(sec) >>> print (text)
1002.00000 1.99680000 0 1 2 0 128 6 16 1 1.00000000 1.00000000 0 6 1 2 128 6 16 2
2 2 128 6 16 3
3339002.00 2.00000000 150000000 2.00000000 128 6 16 4 2.99862000 0.00000000 0 0 0 3 128 6 16 5 1001.00000 9.986200-1 0 6 1 2 128 6 16 6
2 2 128 6 16 7
3339002.00 1.00000000 150000000 1.00000000 128 6 16 8 2.99862000 0.00000000 0 0 0 3 128 6 16 9
LAW 7: >>> tape = sandy.get_endf6_file(“endfb_71”, ‘xs’, 40090) >>> sec = read_mf6(tape, 425, 16) >>> text = write_mf6(sec) >>> print(text[:1000])
4009.00000 8.93478000 0 1 2 0 425 6 16 1 1.00000000 1.00000000 0 7 1 17 425 6 16 2
17 1 425 6 16 3
1748830.00 2.00000000 2700000.00 2.00000000 3250000.00 2.00000000 425 6 16 4 3900000.00 2.00000000 4500000.00 2.00000000 5900000.00 2.00000000 425 6 16 5 6400000.00 2.00000000 7050000.00 2.00000000 8400000.00 2.00000000 425 6 16 6 10100000.0 2.00000000 11000000.0 2.00000000 12000000.0 2.00000000 425 6 16 7 13000000.0 2.00000000 14200000.0 2.00000000 15400000.0 2.00000000 425 6 16 8 17000000.0 2.00000000 20000000.0 2.00000000 425 6 16 9 0.00000000 0.00000000 0 0 1 18 425 6 16 10
18 2 425 6 16 11
- 0.00000000 1748830.00 0 0 1 21 425 6 16 12
21 2