Fix S(a,b) ZAID bugs in NNDC data when converting

This commit is contained in:
Paul Romano 2016-12-30 15:29:13 -06:00
parent 22e7113d26
commit b1957d4785

View file

@ -114,15 +114,21 @@ for filename in glob.glob('nndc/293.6K/ENDF-B-VII.1-neutron-293.6K/*'):
shutil.move(filename, 'nndc/293.6K/')
# ==============================================================================
# EDIT GRAPHITE ZAID (6012 to 6000)
# FIX ZAID ASSIGNMENTS FOR VARIOUS S(A,B) TABLES
print('Changing graphite ZAID from 6012 to 6000')
graphite = os.path.join('nndc', 'tsl', 'graphite.acer')
with open(graphite) as fh:
text = fh.read()
text = text.replace('6012', '6000', 1)
with open(graphite, 'w') as fh:
fh.write(text)
def fix_zaid(table, old, new):
filename = os.path.join('nndc', 'tsl', table)
with open(filename, 'r') as fh:
text = fh.read()
text = text.replace(old, new, 1)
with open(filename, 'w') as fh:
fh.write(text)
print('Fixing ZAIDs for S(a,b) tables')
fix_zaid('graphite.acer', '6012', '6000')
fix_zaid('benzine.acer', '6012', '6000')
fix_zaid('bebeo.acer', '8016', ' 0')
fix_zaid('obeo.acer', '4009', ' 0')
# ==============================================================================
# PROMPT USER TO DELETE .TAR.GZ FILES