openmc_data_downloader

A Python package for downloading h5 cross section files for use in OpenMC.

https://github.com/openmc-data-storage/openmc_data_downloader

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.7%) to scientific vocabulary

Keywords

cross data h5 openmc section xml

Keywords from Contributors

neutron photon serpent mcnp fispact dagmc units normalization convert conversion
Last synced: 6 months ago · JSON representation ·

Repository

A Python package for downloading h5 cross section files for use in OpenMC.

Basic Info
  • Host: GitHub
  • Owner: openmc-data-storage
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 238 KB
Statistics
  • Stars: 13
  • Watchers: 1
  • Forks: 3
  • Open Issues: 6
  • Releases: 11
Topics
cross data h5 openmc section xml
Created almost 5 years ago · Last pushed about 1 year ago
Metadata Files
Readme License Citation

README.md

CI - Main Upload Python Package PyPI codecov

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 reproducible 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 entire 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 continuous integration platforms. The package can also used to produce traceable and reproducible nuclear data distributions.

System Installation

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

bash pip install openmc_data_downloader

Features

The OpenMC data downloader is able to download cross 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 reproducible nuclear data environment.

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 variety 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 downloading files that already exist locally and the overwrite argument can be used to control if these files are downloaded again.

Usage - command line usage

Getting a description of the input options

bash openmc_data_downloader --help

Downloading a single isotope from the FENDL 3.1d nuclear library

bash openmc_data_downloader -l FENDL-3.1d -i Li6

Downloading a multiple isotopes from the TENDL 2019 nuclear library

bash openmc_data_downloader -l TENDL-2019 -i Li6 Li7

Downloading a single element from the TENDL 2019 nuclear library

bash openmc_data_downloader -l TENDL-2019 -e Li

Downloading a multiple element from the TENDL 2019 nuclear library

bash 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)

bash openmc_data_downloader -l ENDFB-7.1-NNDC -i Be9 -d my_h5_files

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

bash openmc_data_downloader -l TENDL-2019 -e Li Si Na -i Fe56 U235

Downloading all the isotopes from the TENDL 2019 nuclear library

bash openmc_data_downloader -l TENDL-2019 -i all

Downloading all the stable isotopes from the TENDL 2019 nuclear library

bash openmc_data_downloader -l TENDL-2019 -i stable

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

bash 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

bash openmc_data_downloader -l ENDFB-7.1-NNDC TENDL-2019 -i Li6 Li7 Be9

Downloading the photon only cross section for an element ENDF/B 7.1 NNDC

bash openmc_data_downloader -l ENDFB-7.1-NNDC -e Li -p photon

Downloading the neutron and photon cross section for an element ENDF/B 7.1 NNDC

bash openmc_data_downloader -l ENDFB-7.1-NNDC -e Li -p neutron photon

Downloading the neutron cross section for elements and an SaB cross sections

bash openmc_data_downloader -l ENDFB-7.1-NNDC -e Be O -s c_Be_in_BeO

Usage - within a Python environment

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 environmental variable to point to the newly created cross_sections.xml by default.

Downloading the isotopes present in an OpenMC material

```python import openmc import openmcdatadownloader as odd

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

mats = openmc.Materials([mat1])

odd.downloadcrosssectiondata( mats, libraries=["FENDL-3.1d"], setOPENMCCROSSSECTIONS=True, particles=["neutron"], ) ```

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

```python import openmc import openmcdatadownloader as odd

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

mats = openmc.Materials([mat1])

odd.downloadcrosssectiondata( mats, libraries=['ENDFB-7.1-NNDC', 'TENDL-2019'], setOPENMCCROSSSECTIONS=True, particles=["neutron"], ) ```

Downloading neutron cross sections for a material with an SaB

```python import openmc import openmcdatadownloader as odd

mymat = openmc.Material() mymat.addelement('Be', 0.5) mymat.addelement('O', 0.5) mymat.addsalphabeta('Bein_BeO')

mats = openmc.Materials([my_mat])

odd.downloadcrosssectiondata( mats, libraries=['ENDFB-7.1-NNDC', 'TENDL-2019'], setOPENMCCROSSSECTIONS=True, particles=["neutron"], ) ```

Downloading photon and neutron cross sections for isotopes and elements from the TENDL 2019 library

```python import openmc import openmcdatadownloader as odd

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

mats = openmc.Materials([mat1])

odd.downloadcrosssectiondata( mats, libraries=['ENDFB-7.1-NNDC', 'TENDL-2019'], setOPENMCCROSSSECTIONS=True, particles=["neutron", "photon"], ) ```

Owner

  • Name: openmc-data-storage
  • Login: openmc-data-storage
  • Kind: organization

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Shimwell"
  given-names: "Jonathan"
  orcid: "https://orcid.org/0000-0001-6909-0946"
title: "openmc-data-downloader. A Python package for downloading h5 cross section files for use in OpenMC."
version: 0.4.1
date-released: 2021-11-11
url: "https://github.com/openmc-data-storage/openmc_data_downloader"

GitHub Events

Total
  • Watch event: 4
  • Issue comment event: 1
  • Pull request event: 1
  • Fork event: 1
Last Year
  • Watch event: 4
  • Issue comment event: 1
  • Pull request event: 1
  • Fork event: 1

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 190
  • Total Committers: 5
  • Avg Commits per committer: 38.0
  • Development Distribution Score (DDS): 0.395
Top Committers
Name Email Commits
Jonathan Shimwell j****l@u****k 115
Jonathan Shimwell m****l@j****m 46
autopep8 a****8@u****m 19
shimwell s****l@u****m 7
Jonathan Shimwell d****l@g****m 3
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 7
  • Total pull requests: 34
  • Average time to close issues: 13 days
  • Average time to close pull requests: 5 days
  • Total issue authors: 2
  • Total pull request authors: 2
  • Average comments per issue: 1.29
  • Average comments per pull request: 0.38
  • Merged pull requests: 33
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • shimwell (6)
  • AI-Pranto (1)
Pull Request Authors
  • shimwell (33)
  • RemDelaporteMathurin (1)
Top Labels
Issue Labels
documentation (1) enhancement (1) good first issue (1)
Pull Request Labels

Dependencies

requirements.txt pypi
  • pandas *
  • retry *
.github/workflows/anaconda-publish.yml actions
  • actions/checkout v2 composite
.github/workflows/black.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • stefanzweifel/git-auto-commit-action v4 composite
.github/workflows/conda-build-test.yml actions
  • actions/checkout v2 composite
.github/workflows/docker_ci_main.yml actions
  • actions/checkout v2 composite
.github/workflows/python-publish.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
pyproject.toml pypi
  • pandas *
  • retry *