Skip to main content

A tool for selectively downloading h5 files for specified isotopes / elements from your libraries of choice

Project description

CI - Main Upload Python Package PyPI

OpenMC data downloader

A Python package for downloading preprocessed cross section data in the h5 file format for use with OpenMC.

This package allows you to download a fully reproducable composite nuclear data library with one command.

There are several methods of obtaining complete data libraries for use with OpenMC, for example:

  • OpenMC.org has entrie libraries downloadable as compressed files
  • OpenMC data repository scripts has scripts for automatically downloading ACE and ENDF files and generating h5 files from these inputs.

History

The package was originally conceived by Jonathan Shimwell as a means of downloading a minimal selection of data for use on continious intergration platforms. The package can also used to produce traceable and reproducable nuclear data distributions.

System Installation

To install the openmc_data_downloader you need to have Python3 installed, OpenMC is also advisable if you want to run simulations using the h5 data files but not actually madatory if you just want to download the cross sections.

pip install openmc_data_downloader

Features

The OpenMC data downloader is able to download corss section files for isotopes from nuclear data libraries.The user specifies the nuclear data libraries in order of their preference. When an isotope is found in multiple libraries it will be downloaded from the highest preference library. This avoid duplication of isotopes and provides a reproductible nuclear data enviroment.

The nuclear data h5 file are downloaded from the OpenMC-data-storage repository. Prior to being added to the repository they have been automatically processed using scripts from OpenMC data repository, these scripts convert ACE and ENDF file to h5 files.

The resulting h5 files are then used in and automated test suite of simulations to help ensure they are suitable for their intended purpose.

Isotopes for downloading can be found in a varity of ways as demonstrated below. When downloading a cross_section.xml file is automatically created and h5 files are named with their nuclear data library and the isotope. This helps avoid redownloading files that already exist locally.

Usage - command line usage

Getting a description of the input options

openmc_data_downloader --help

Downloading a single isotope from the TENDL 2019 nuclear library

openmc_data_downloader -l TENDL_2019 -i Li6

Downloading a multiple isotopes from the TENDL 2019 nuclear library

openmc_data_downloader -l TENDL_2019 -i Li6 Li7

Downloading a single element from the TENDL 2019 nuclear library

openmc_data_downloader -l TENDL_2019 -e Li

Downloading a multiple element from the TENDL 2019 nuclear library

openmc_data_downloader -l TENDL_2019 -e Li Si Na

Downloading h5 files from the ENDF/B 7.1 NNDC library to a specific folder (destination)

openmc_data_downloader -l ENDFB_71_NNDC -i Be9 -d my_h5_files

Downloading a combination of isotopes and element from the TENDL 2019 nuclear library

openmc_data_downloader -l TENDL_2019 -e Li Si Na -i Fe56 U235

Downloading all the isotopes in a materials.xml file from the TENDL 2019 nuclear library

openmc_data_downloader -l TENDL_2019 -m materials.xml

Downloading 3 isotopes from ENDF/B 7.1 NNDC (first choice) and TENDL 2019 (second choice) nuclear library

openmc_data_downloader -l TENDL_2019 ENDFB_71_NNDC -i Li6 Li7 Be9

Downloading an isotopes from ENDF/B 7.1 NNDC and setting the OPENMC_CROSS_SECTION enviromental varible to

openmc_data_downloader -l TENDL_2019 ENDFB_71_NNDC -i Li6 Li7 Be9

Usage - within a Python enviroment

When using the Python API the just_in_time_library_generator() function provides similar capabilities to the openmc_data_downloader terminal command. With one key difference being that just_in_time_library_generator() sets the OPENMC_CROSS_SECTIONS enviromental varible to point to the newly created cross_sections.xml by default.

Downloading the isotopes present in an OpenMC material

import openmc
import openmc_data_downloader as odd

mat1 = openmc.Material()
mat1.add_element('Fe', 0.95)
mat1.add_element('C', 0.05)

odd.just_in_time_library_generator(
    libraries='TENDL_2019',
    materials=mat1
)

Downloading the isotopes present in an OpenMC material from two libraries but with a preference for ENDF/B 7.1 NNDC library over TENDL 2019

import openmc
import openmc_data_downloader as odd

mat1 = openmc.Material()
mat1.add_element('Fe', 0.95)
mat1.add_element('C', 0.05)

odd.just_in_time_library_generator(
    libraries=['ENDFB_71_NNDC', 'TENDL_2019'],
    materials=mat1
)

Downloading the isotopes in several OpenMC materials

import openmc
import openmc_data_downloader as odd

mat1 = openmc.Material()
mat1.add_element('Fe', 0.95)
mat1.add_element('C', 0.05)

mat2 = openmc.Material()
mat2.add_element('H', 0.66)
mat2.add_element('0', 0.33)

odd.just_in_time_library_generator(
    libraries='ENDFB_71_NNDC',
    materials=[mat1, mat2]
)

Downloading some isotopes and elements from the TENDL 2019 library

import openmc
import openmc_data_downloader as odd

odd.just_in_time_library_generator(
    libraries='TENDL_2019',
    elements=['Li', 'Be'],
    isotopes=['Fe56', 'U235'],
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openmc_data_downloader-0.0.7.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

openmc_data_downloader-0.0.7-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file openmc_data_downloader-0.0.7.tar.gz.

File metadata

  • Download URL: openmc_data_downloader-0.0.7.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for openmc_data_downloader-0.0.7.tar.gz
Algorithm Hash digest
SHA256 99b72d1e2f13fc50b560fe2349f9eb71c3c28fbcd1c9fdb21c08a6fbcd4e3baa
MD5 a93afda6cb8f6bced581c3b8d9d0f7c9
BLAKE2b-256 50a5e77cdb776ab4722973ee51ba0606b85279de033b8cec76e0c2f572cd53fb

See more details on using hashes here.

File details

Details for the file openmc_data_downloader-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: openmc_data_downloader-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for openmc_data_downloader-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 84ea035ac109f9530a1baf226d863b6438ef91aa74b68925af3973390fe26586
MD5 113f32c7e81508f7e5fb7411040e8997
BLAKE2b-256 22a3d791c0cb6f64427ae6265aa0a62e8490a27ea27d8e6fadde581eef36feac

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page