openmc-data-downloader


Nameopenmc-data-downloader JSON
Version 0.6.1 PyPI version JSON
download
home_pageNone
SummaryA tool for selectively downloading h5 files for specified isotopes / elements from your libraries of choice
upload_time2025-01-09 21:21:52
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2021 openmc-data-storage Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords openmc nuclear data download process cross section
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
[![CI - Main](https://github.com/openmc-data-storage/openmc_data_downloader/actions/workflows/docker_ci_main.yml/badge.svg)](https://github.com/openmc-data-storage/openmc_data_downloader/actions/workflows/docker_ci_main.yml)
[![Upload Python Package](https://github.com/openmc-data-storage/openmc_data_downloader/actions/workflows/python-publish.yml/badge.svg)](https://github.com/openmc-data-storage/openmc_data_downloader/actions/workflows/python-publish.yml)
[![PyPI](https://img.shields.io/pypi/v/openmc_data_downloader?color=brightgreen&label=pypi&logo=grebrightgreenen&logoColor=green)](https://pypi.org/project/openmc_data_downloader/)
[![codecov](https://codecov.io/gh/openmc-data-storage/openmc_data_downloader/branch/main/graph/badge.svg)](https://codecov.io/gh/openmc-data-storage/openmc_data_downloader)

# 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](https://openmc.org/) has entire libraries downloadable as compressed files
- [OpenMC data repository scripts](https://github.com/openmc-dev/data/) 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 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 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 openmc_data_downloader as odd

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

mats = openmc.Materials([mat1])

odd.download_cross_section_data(
        mats,
        libraries=["FENDL-3.1d"],
        set_OPENMC_CROSS_SECTIONS=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 openmc_data_downloader as odd

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

mats = openmc.Materials([mat1])

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


### Downloading neutron cross sections for a material with an SaB

```python
import openmc
import openmc_data_downloader as odd

my_mat = openmc.Material()
my_mat.add_element('Be', 0.5)
my_mat.add_element('O', 0.5)
my_mat.add_s_alpha_beta('Be_in_BeO')

mats = openmc.Materials([my_mat])

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

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

```python
import openmc
import openmc_data_downloader as odd

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

mats = openmc.Materials([mat1])

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

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "openmc-data-downloader",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "openmc, nuclear, data, download, process, cross, section",
    "author": null,
    "author_email": "Jonathan Shimwell <mail@jshimwell.com>",
    "download_url": "https://files.pythonhosted.org/packages/e8/37/e8e303ed59fef24d1a337ee7488ab6a837e5afb5717273f5e5f00c1ead8c/openmc_data_downloader-0.6.1.tar.gz",
    "platform": null,
    "description": "\n[![CI - Main](https://github.com/openmc-data-storage/openmc_data_downloader/actions/workflows/docker_ci_main.yml/badge.svg)](https://github.com/openmc-data-storage/openmc_data_downloader/actions/workflows/docker_ci_main.yml)\n[![Upload Python Package](https://github.com/openmc-data-storage/openmc_data_downloader/actions/workflows/python-publish.yml/badge.svg)](https://github.com/openmc-data-storage/openmc_data_downloader/actions/workflows/python-publish.yml)\n[![PyPI](https://img.shields.io/pypi/v/openmc_data_downloader?color=brightgreen&label=pypi&logo=grebrightgreenen&logoColor=green)](https://pypi.org/project/openmc_data_downloader/)\n[![codecov](https://codecov.io/gh/openmc-data-storage/openmc_data_downloader/branch/main/graph/badge.svg)](https://codecov.io/gh/openmc-data-storage/openmc_data_downloader)\n\n# OpenMC data downloader\n\nA Python package for downloading preprocessed cross section data in the h5 file\nformat for use with OpenMC.\n\nThis package allows you to download a fully reproducible composite nuclear data\nlibrary with one command.\n\nThere are several methods of obtaining complete data libraries for use with\nOpenMC, for example:\n\n- [OpenMC.org](https://openmc.org/) has entire libraries downloadable as compressed files\n- [OpenMC data repository scripts](https://github.com/openmc-dev/data/) has scripts for automatically downloading ACE and ENDF files and generating h5 files from these inputs.\n\n## History\n\nThe package was originally conceived by Jonathan Shimwell as a means of\ndownloading a minimal selection of data for use on continuous integration\nplatforms.\nThe package can also used to produce traceable and reproducible\nnuclear data distributions.\n\n## System Installation\n\nTo install the openmc_data_downloader you need to have Python3 installed,\nOpenMC is also advisable if you want to run simulations using the h5 data files\nbut not actually mandatory if you just want to download the cross sections.\n\n```bash\npip install openmc_data_downloader\n```\n\n## Features\n\nThe OpenMC data downloader is able to download cross section files for isotopes\nfrom nuclear data libraries.The user specifies the nuclear data libraries in\norder of their preference. When an isotope is found in multiple libraries it\nwill be downloaded from the highest preference library. This avoid duplication\nof isotopes and provides a reproducible nuclear data environment.\n\nThe nuclear data h5 file are downloaded from the OpenMC-data-storage\nrepository. Prior to being added to the repository they have been automatically\nprocessed using scripts from OpenMC data repository, these scripts convert ACE\nand ENDF file to h5 files.\n\nThe resulting h5 files are then used in and automated test suite of simulations\nto help ensure they are suitable for their intended purpose.\n\nIsotopes for downloading can be found in a variety of ways as demonstrated below.\nWhen downloading a cross_section.xml file is automatically created and h5 files\nare named with their nuclear data library and the isotope. This helps avoid\ndownloading files that already exist locally and the ```overwrite``` argument\ncan be used to control if these files are downloaded again.\n\n## Usage - command line usage\n\n### Getting a description of the input options\n\n```bash\nopenmc_data_downloader --help\n```\n\n### Downloading a single isotope from the FENDL 3.1d nuclear library\n\n```bash\nopenmc_data_downloader -l FENDL-3.1d -i Li6\n```\n\n### Downloading a multiple isotopes from the TENDL 2019 nuclear library\n\n```bash\nopenmc_data_downloader -l TENDL-2019 -i Li6 Li7\n```\n\n### Downloading a single element from the TENDL 2019 nuclear library\n\n```bash\nopenmc_data_downloader -l TENDL-2019 -e Li\n```\n\n### Downloading a multiple element from the TENDL 2019 nuclear library\n\n```bash\nopenmc_data_downloader -l TENDL-2019 -e Li Si Na\n```\n\n### Downloading h5 files from the ENDF/B 7.1 NNDC library to a specific folder (destination)\n\n```bash\nopenmc_data_downloader -l ENDFB-7.1-NNDC -i Be9 -d my_h5_files\n```\n\n### Downloading a combination of isotopes and element from the TENDL 2019 nuclear library\n\n```bash\nopenmc_data_downloader -l TENDL-2019 -e Li Si Na -i Fe56 U235\n```\n### Downloading all the isotopes from the TENDL 2019 nuclear library\n\n```bash\nopenmc_data_downloader -l TENDL-2019 -i all\n```\n### Downloading all the stable isotopes from the TENDL 2019 nuclear library\n\n```bash\nopenmc_data_downloader -l TENDL-2019 -i stable\n```\n\n### Downloading all the isotopes in a materials.xml file from the TENDL 2019 nuclear library\n\n```bash\nopenmc_data_downloader -l TENDL-2019 -m materials.xml\n```\n\n### Downloading 3 isotopes from ENDF/B 7.1 NNDC (first choice) and TENDL 2019 (second choice) nuclear library\n\n```bash\nopenmc_data_downloader -l ENDFB-7.1-NNDC TENDL-2019 -i Li6 Li7 Be9\n```\n\n### Downloading the photon only cross section for an element ENDF/B 7.1 NNDC\n\n```bash\nopenmc_data_downloader -l ENDFB-7.1-NNDC -e Li -p photon \n```\n\n### Downloading the neutron and photon cross section for an element ENDF/B 7.1 NNDC\n\n```bash\nopenmc_data_downloader -l ENDFB-7.1-NNDC -e Li -p neutron photon\n```\n\n### Downloading the neutron cross section for elements and an SaB cross sections\n\n```bash\nopenmc_data_downloader -l ENDFB-7.1-NNDC -e Be O -s c_Be_in_BeO\n```\n\n## Usage - within a Python environment\n\nWhen using the Python API the ```just_in_time_library_generator()``` function\nprovides similar capabilities to the ```openmc_data_downloader``` terminal\ncommand. With one key difference being that ```just_in_time_library_generator()```\nsets the ```OPENMC_CROSS_SECTIONS``` environmental variable to point to the\nnewly created cross_sections.xml by default.\n\n### Downloading the isotopes present in an OpenMC material\n\n```python\nimport openmc\nimport openmc_data_downloader as odd\n\nmat1 = openmc.Material()\nmat1.add_element('Fe', 0.95)\nmat1.add_element('C', 0.05)\n\nmats = openmc.Materials([mat1])\n\nodd.download_cross_section_data(\n        mats,\n        libraries=[\"FENDL-3.1d\"],\n        set_OPENMC_CROSS_SECTIONS=True,\n        particles=[\"neutron\"],\n    )\n```\n\n### 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\n\n```python\nimport openmc\nimport openmc_data_downloader as odd\n\nmat1 = openmc.Material()\nmat1.add_element('Fe', 0.95)\nmat1.add_element('C', 0.05)\n\nmats = openmc.Materials([mat1])\n\nodd.download_cross_section_data(\n        mats,\n        libraries=['ENDFB-7.1-NNDC', 'TENDL-2019'],\n        set_OPENMC_CROSS_SECTIONS=True,\n        particles=[\"neutron\"],\n    )\n```\n\n\n### Downloading neutron cross sections for a material with an SaB\n\n```python\nimport openmc\nimport openmc_data_downloader as odd\n\nmy_mat = openmc.Material()\nmy_mat.add_element('Be', 0.5)\nmy_mat.add_element('O', 0.5)\nmy_mat.add_s_alpha_beta('Be_in_BeO')\n\nmats = openmc.Materials([my_mat])\n\nodd.download_cross_section_data(\n        mats,\n        libraries=['ENDFB-7.1-NNDC', 'TENDL-2019'],\n        set_OPENMC_CROSS_SECTIONS=True,\n        particles=[\"neutron\"],\n)\n```\n\n### Downloading photon and neutron cross sections for isotopes and elements from the TENDL 2019 library\n\n```python\nimport openmc\nimport openmc_data_downloader as odd\n\nmat1 = openmc.Material()\nmat1.add_element('Fe', 0.95)\nmat1.add_element('C', 0.05)\n\nmats = openmc.Materials([mat1])\n\nodd.download_cross_section_data(\n        mats,\n        libraries=['ENDFB-7.1-NNDC', 'TENDL-2019'],\n        set_OPENMC_CROSS_SECTIONS=True,\n        particles=[\"neutron\", \"photon\"],\n    )\n```\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2021 openmc-data-storage  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "A tool for selectively downloading h5 files for specified isotopes / elements from your libraries of choice",
    "version": "0.6.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/fusion-energy/openmc_data_downloader/issues",
        "Homepage": "https://github.com/fusion-energy/openmc_data_downloader"
    },
    "split_keywords": [
        "openmc",
        " nuclear",
        " data",
        " download",
        " process",
        " cross",
        " section"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ebfdd2824a7977d3634ffacea1c68ee54a1e364a21a7a8a38e4abb0dcee1503e",
                "md5": "66706214804409af6baced16c604cc94",
                "sha256": "c2e0ac6a7d4a8d5ebd5e57d010ba2c714ba764ce2843455f2bf60e6e11a68881"
            },
            "downloads": -1,
            "filename": "openmc_data_downloader-0.6.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "66706214804409af6baced16c604cc94",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 28747,
            "upload_time": "2025-01-09T21:21:50",
            "upload_time_iso_8601": "2025-01-09T21:21:50.470593Z",
            "url": "https://files.pythonhosted.org/packages/eb/fd/d2824a7977d3634ffacea1c68ee54a1e364a21a7a8a38e4abb0dcee1503e/openmc_data_downloader-0.6.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e837e8e303ed59fef24d1a337ee7488ab6a837e5afb5717273f5e5f00c1ead8c",
                "md5": "8d2ea852a87bb7f70c6338268658ac72",
                "sha256": "56326c539c1bd945fd84f25ced2bf92af7eaf31588127ac844bc237e88e58b21"
            },
            "downloads": -1,
            "filename": "openmc_data_downloader-0.6.1.tar.gz",
            "has_sig": false,
            "md5_digest": "8d2ea852a87bb7f70c6338268658ac72",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 35490,
            "upload_time": "2025-01-09T21:21:52",
            "upload_time_iso_8601": "2025-01-09T21:21:52.988773Z",
            "url": "https://files.pythonhosted.org/packages/e8/37/e8e303ed59fef24d1a337ee7488ab6a837e5afb5717273f5e5f00c1ead8c/openmc_data_downloader-0.6.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-09 21:21:52",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fusion-energy",
    "github_project": "openmc_data_downloader",
    "github_not_found": true,
    "lcname": "openmc-data-downloader"
}
        
Elapsed time: 1.20120s