From 965d3089737f723293c372d169224ab19dc72f7a Mon Sep 17 00:00:00 2001 From: Ramzy Date: Wed, 4 Mar 2026 11:57:53 -0500 Subject: [PATCH] =?UTF-8?q?Fixing=20MF7/MT2=20key=20name:=20LHTR=20?= =?UTF-8?q?=E2=86=92=20LTHR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The parsed dictionary key for the thermal elastic scattering law flag in MF7/MT2 is currently stored as LHTR in the endf-python package. The correct ENDF-6 variable name is LTHR (Law for THermal elastic Reaction), as defined in the ENDF-6 Formats Manual (ENDF-102, Section 7.2) and used consistently in NJOY2016, PREPRO, and other processing codes. This typo causes downstream code that looks up sec['LTHR'] to silently get a default of 0 (of course depending on how the code is setup), making it appear that no elastic data is present even when the file correctly contains LTHR data. --- src/endf/mf7.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/endf/mf7.py b/src/endf/mf7.py index 7c80e42..6164747 100644 --- a/src/endf/mf7.py +++ b/src/endf/mf7.py @@ -43,16 +43,16 @@ def get_incoherent_elastic(file_obj): params, W = get_tab1_record(file_obj) return {'SB': params[0], 'W': W} - ZA, AWR, LHTR, *_ = get_head_record(file_obj) - data = {'ZA': ZA, 'AWR': AWR, 'LHTR': LHTR} + ZA, AWR, LTHR, *_ = get_head_record(file_obj) + data = {'ZA': ZA, 'AWR': AWR, 'LTHR': LTHR} - if LHTR == 1: + if LTHR == 1: # coherent elastic data['coherent'] = get_coherent_elastic(file_obj) - elif LHTR == 2: + elif LTHR == 2: # incoherent elastic data['incoherent'] = get_incoherent_elastic(file_obj) - elif LHTR == 3: + elif LTHR == 3: # mixed coherent / incoherent elastic data['coherent'] = get_coherent_elastic(file_obj) data['incoherent'] = get_incoherent_elastic(file_obj)