IAEA-NDS / endf-parserpy

Python package for reading, writing, verifying and translating ENDF-6 formatted files
Other
9 stars 4 forks source link

Issue reading JENDL-5 's MF8 #2

Closed jonathanc-git closed 5 months ago

jonathanc-git commented 5 months ago

When trying to parse JENDL-5 decay library, there is an error with one of the template reading :

endf_parserpy.custom_exceptions.NumberMismatchError: 
Here is the parser record log until failure:

-------- Line 0 -----------
Template:  [ MAT , 8 , 457 / ZA , AWR , LIS , LISO , NST , NSP ] HEAD
Line:     " 1.002400+4 2.378749+1          0          0          0          2 127 8457    1"

.
.
.
-------- Line 7 -----------
Template:  [ MAT , 8 , 457 / 0.0 , STYP , LCON , LCOV , 6 , NER / 
 FD , dFD , ERAV , dERAV , FC , dFC ] LIST
Line:     " 8.744100+5 0.000000+0          0          0          4          0 127 8457    8"

Error message: Expected 6 in the ENDF file but got 4. The value was encountered in a source field named N1

There is the same issue for stable, where the evaluator choose to set the so called N1 value here to 0 and not have a following line.

Best regards,

gschnabel commented 5 months ago

Thank you for reporting. I have a few requests to help me solving the issue:

  1. For better testing, can you provide the link on the JENDL website to the specific ENDF-6 file that yields this error message. It helps me in debugging, even if the issue affects all files in the JENDL decay library in the same way.
  2. I did not find any mentioning of the option to put 4 into the N1 field in the latest version of the ENDF-6 manual (page 184). If I've missed the explanation, can you point me to the correct page in the manual? If it is a specific JENDL ENDF-6 convention, is there any document explaining it? If not, that's also fine. If it is not in the official ENDF-6 manual but a JENDL convention, I will create alternative recipe specifications for JENDL to incorporate these conventions.
jonathanc-git commented 5 months ago

Thank you for your time !

  1. So from the website JENDL main page, we can retrieve either : JENDL-2015DD or JENDL5-DD For exemple, with JENDL5, 24Ne is problematic, and with a stable 27Al. If we do a try and except on the entire JENDL5 MF8, we cannot read 2004 files on the 4072 nuclides.

  2. I believe the problematic section is the reading of LIST record for discrete energy ER. Then the N1 would be corresponding to NT on the same page. In the example of 24Ne file, they do not explicitly give the remaining RICCi,∆RICCi, RICKi,∆RICKi, RICLi,∆RICLi and jump to a new spectra entry. But we get the exact template following section 8.4.1.

gschnabel commented 5 months ago

Update 29 April 2024

The implemented solution was pre-mature and did not solve the problem. The commit id mentioned (182f86) does not exist anymore due to a rebase/rewrite operation on the dev branch.

Original post

I think I've fixed the issue but it will take a bit until the fix will go into the master branch and on PyPI. In the meantime, you could try to see if it works now as expected by installing directly from this repository, i.e.

git clone https://github.com/iaea-nds/endf-parserpy
cd endf-parserpy
git checkout 182f86
pip install ./

When you instantiate the EndfParser class, you can provide the endf_format="jendl" argument to support parsing of JENDL decay files:

from endf_parserpy import EndfParser
parser = EndfParser(endf_format="jendl")

I will leave the issue open until I've had time to test the fix more comprehensively and to give you time to report back.

jonathanc-git commented 5 months ago

I switched to the dev branch and checkout the version you mentioned. Indeed there is improvement !

But it seems that this NER can also take value 10 in addition to 4 in jendl format. For example Tc-94m or Bi-205, I get an error like :

[  ERROR  ]:root:Record specification: [ MAT , 8 , 457 / 0.0 , STYP , LCON , LCOV , 6 , NER / 
 FD , dFD , ERAV , dERAV , FC , dFC ] LIST
[  ERROR  ]:root:Offending line:  1.501400+6 1.000000+2          0          0         10          03356 8457  276
Traceback (most recent call last):
gschnabel commented 5 months ago

The solution did only partially address the problem. The development branch at current commit id 621d397f43447e9cc159c42b21bcd659927cd1d2 solves the problem and the entire JENDL-5 decay library can now be parsed. I am planning to update the PyPI package very soon with these fixes.