Skip to content
Open
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
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ FROM continuumio/miniconda3:4.9.2 as h5_base

RUN conda install -c conda-forge openmc

RUN pip install openmc_data_downloader>=0.5.4

RUN pip install openmc_data_to_json

RUN pip install openmc_data_downloader

# needed for hdf5 writting of the index file
RUN pip install tables

Expand Down
32 changes: 21 additions & 11 deletions convert.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import pandas as pd
import json
import os
Expand All @@ -9,22 +7,34 @@


odj.cross_section_h5_files_to_json_files(
filenames = list(pathlib.Path('TENDL-2019').glob('*.h5')),
output_dir = 'TENDL-2019_json',
library='TENDL-2019',
index_filename='TENDL-2019_index.json',
indent=None
filenames=list(pathlib.Path("TENDL-2019").glob("*.h5")),
output_dir="TENDL-2019_json",
library="TENDL-2019",
index_filename="TENDL-2019_index.json",
indent=None,
)
odj.cross_section_h5_files_to_json_files(
filenames=list(pathlib.Path("ENDFB-8.0-NNDC").glob("*.h5")),
output_dir="ENDFB-8.0-NNDC_json",
library="ENDFB-8.0-NNDC",
index_filename="ENDFB-8.0-NNDC_index.json",
indent=None,
)

with open("TENDL-2019_json/TENDL-2019_index.json") as f:
data_tendl_2019 = json.load(f)

f = open('TENDL-2019_json/TENDL-2019_index.json')
data = json.load(f)
df = pd.json_normalize(data)
with open("ENDFB-8.0-NNDC_json/ENDFB-8.0-NNDC_index.json") as f:
data_endf_8_nndc = json.load(f)

data = data_tendl_2019 + data_endf_8_nndc

df = pd.json_normalize(data)
for col in df.columns:
df[col] = df[col].astype(str)

h5File = "all_indexes.h5"
df.to_hdf(h5File, "/data/d1")

os.system('rm -rf TENDL-2019')
os.system("rm -rf TENDL-2019")
os.system("rm -rf ENDFB-8.0-NNDC")
18 changes: 13 additions & 5 deletions download.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@

import openmc
import openmc_data_downloader as odd


odd.just_in_time_library_generator(
libraries='TENDL-2019',
elements='all',
destination='TENDL-2019'
mat = openmc.Material()
for isotope in odd.ALL_ISOTOPE_OPTIONS:
mat.add_nuclide(isotope, 1)
mats = openmc.Materials([mat])

mats.download_cross_section_data(
libraries=["ENDFB-8.0-NNDC"],
destination="ENDFB-8.0-NNDC",
)

mats.download_cross_section_data(
libraries=["TENDL-2019"],
destination="TENDL-2019"
)