Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 1 addition & 27 deletions openmc/data/endf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from .data import gnds_name
from .function import Tabulated1D
from endf.material import _LIBRARY, _SUBLIBRARY
from endf.material import _LIBRARY, _SUBLIBRARY, get_materials as get_evaluations
from endf.incident_neutron import SUM_RULES
from endf.records import (
float_endf,
Expand All @@ -39,32 +39,6 @@ def get_tab1_record(file_obj):
return params, Tabulated1D(tab.x, tab.y, tab.breakpoints, tab.interpolation)


def get_evaluations(filename):
"""Return a list of all evaluations within an ENDF file.

Parameters
----------
filename : str
Path to ENDF-6 formatted file

Returns
-------
list
A list of :class:`openmc.data.endf.Evaluation` instances.

"""
evaluations = []
with open(str(filename), 'r') as fh:
while True:
pos = fh.tell()
line = fh.readline()
if line[66:70] == ' -1':
break
fh.seek(pos)
evaluations.append(Evaluation(fh))
return evaluations


class Evaluation:
"""ENDF material evaluation with multiple files/sections

Expand Down
4 changes: 1 addition & 3 deletions openmc/data/neutron.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,9 +805,7 @@ def from_njoy(cls, filename, temperatures=None, evaluation=None, **kwargs):
# Helper function to get a cross section from an ENDF file on a
# given energy grid
def get_file3_xs(ev, mt, E):
file_obj = StringIO(ev.section[3, mt])
get_head_record(file_obj)
_, xs = get_tab1_record(file_obj)
xs = ev.section_data[3, mt]['sigma']
return xs(E)

heating_local = Reaction(901)
Expand Down
Loading