endf-userpy 0.1.0a1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- endf_userpy-0.1.0a1/LICENSE +21 -0
- endf_userpy-0.1.0a1/MANIFEST.in +43 -0
- endf_userpy-0.1.0a1/PKG-INFO +168 -0
- endf_userpy-0.1.0a1/README.md +125 -0
- endf_userpy-0.1.0a1/docs/Makefile +20 -0
- endf_userpy-0.1.0a1/docs/make.bat +35 -0
- endf_userpy-0.1.0a1/docs/source/conf.py +27 -0
- endf_userpy-0.1.0a1/docs/source/index.rst +13 -0
- endf_userpy-0.1.0a1/docs/source/quantities.rst +0 -0
- endf_userpy-0.1.0a1/endf_userpy/__init__.py +10 -0
- endf_userpy-0.1.0a1/endf_userpy/discrete_quantities.py +0 -0
- endf_userpy-0.1.0a1/endf_userpy/fortran/__init__.py +0 -0
- endf_userpy-0.1.0a1/endf_userpy/fortran/endf6-f2pywrappers.f +535 -0
- endf_userpy-0.1.0a1/endf_userpy/fortran/endf6.f90 +3670 -0
- endf_userpy-0.1.0a1/endf_userpy/fortran/endf6module.c +13881 -0
- endf_userpy-0.1.0a1/endf_userpy/mfsec_interpretation/__init__.py +0 -0
- endf_userpy-0.1.0a1/endf_userpy/mfsec_interpretation/mf10_interpretation.py +44 -0
- endf_userpy-0.1.0a1/endf_userpy/mfsec_interpretation/mf12_interpretation.py +111 -0
- endf_userpy-0.1.0a1/endf_userpy/mfsec_interpretation/mf12_interpretation_helpers.py +104 -0
- endf_userpy-0.1.0a1/endf_userpy/mfsec_interpretation/mf13_interpretation.py +68 -0
- endf_userpy-0.1.0a1/endf_userpy/mfsec_interpretation/mf14_interpretation.py +99 -0
- endf_userpy-0.1.0a1/endf_userpy/mfsec_interpretation/mf15_interpretation.py +62 -0
- endf_userpy-0.1.0a1/endf_userpy/mfsec_interpretation/mf1_interpretation.py +76 -0
- endf_userpy-0.1.0a1/endf_userpy/mfsec_interpretation/mf3_interpretation.py +49 -0
- endf_userpy-0.1.0a1/endf_userpy/mfsec_interpretation/mf4_interpretation.py +172 -0
- endf_userpy-0.1.0a1/endf_userpy/mfsec_interpretation/mf4_interpretation_fort.py +302 -0
- endf_userpy-0.1.0a1/endf_userpy/mfsec_interpretation/mf4_interpretation_helpers.py +26 -0
- endf_userpy-0.1.0a1/endf_userpy/mfsec_interpretation/mf5_interpretation.py +135 -0
- endf_userpy-0.1.0a1/endf_userpy/mfsec_interpretation/mf6_interpretation.py +152 -0
- endf_userpy-0.1.0a1/endf_userpy/mfsec_interpretation/mf6_interpretation_helpers.py +185 -0
- endf_userpy-0.1.0a1/endf_userpy/mfsec_interpretation/mf6_interpretation_integrals.py +198 -0
- endf_userpy-0.1.0a1/endf_userpy/mfsec_interpretation/mf6_interpretation_subsecs.py +405 -0
- endf_userpy-0.1.0a1/endf_userpy/mfsec_interpretation/mf8_interpretation.py +74 -0
- endf_userpy-0.1.0a1/endf_userpy/mfsec_interpretation/mf9_interpretation.py +44 -0
- endf_userpy-0.1.0a1/endf_userpy/primitives/__init__.py +0 -0
- endf_userpy-0.1.0a1/endf_userpy/primitives/conversion.py +49 -0
- endf_userpy-0.1.0a1/endf_userpy/primitives/conversion_relativistic.py +175 -0
- endf_userpy-0.1.0a1/endf_userpy/primitives/helpers.py +212 -0
- endf_userpy-0.1.0a1/endf_userpy/primitives/interpolation.py +253 -0
- endf_userpy-0.1.0a1/endf_userpy/primitives/physical_constants.py +126 -0
- endf_userpy-0.1.0a1/endf_userpy/primitives/properties.py +146 -0
- endf_userpy-0.1.0a1/endf_userpy/primitives/reactions.py +341 -0
- endf_userpy-0.1.0a1/endf_userpy/quantities.py +175 -0
- endf_userpy-0.1.0a1/endf_userpy/quantities_mt_zap/__init__.py +0 -0
- endf_userpy-0.1.0a1/endf_userpy/quantities_mt_zap/discrete_distribution1d.py +91 -0
- endf_userpy-0.1.0a1/endf_userpy/quantities_mt_zap/discrete_quantities.py +49 -0
- endf_userpy-0.1.0a1/endf_userpy/quantities_mt_zap/distribution1d.py +118 -0
- endf_userpy-0.1.0a1/endf_userpy/quantities_mt_zap/distribution1d_helpers.py +134 -0
- endf_userpy-0.1.0a1/endf_userpy/quantities_mt_zap/distribution2d.py +59 -0
- endf_userpy-0.1.0a1/endf_userpy/quantities_mt_zap/quantities.py +237 -0
- endf_userpy-0.1.0a1/endf_userpy/quantities_mt_zap/selectors.py +168 -0
- endf_userpy-0.1.0a1/endf_userpy/translation.py +14 -0
- endf_userpy-0.1.0a1/endf_userpy.egg-info/SOURCES.txt +71 -0
- endf_userpy-0.1.0a1/examples/01_inspect_file.py +46 -0
- endf_userpy-0.1.0a1/examples/02_reaction_xs.py +57 -0
- endf_userpy-0.1.0a1/examples/03_particle_production_xs.py +66 -0
- endf_userpy-0.1.0a1/examples/04_residual_production_isomers.py +93 -0
- endf_userpy-0.1.0a1/examples/05_emission_spectra_14mev.py +80 -0
- endf_userpy-0.1.0a1/examples/06_ddx_uranium_14mev.py +81 -0
- endf_userpy-0.1.0a1/examples/07_photonuclear_residuals.py +78 -0
- endf_userpy-0.1.0a1/pyproject.toml +3 -0
- endf_userpy-0.1.0a1/setup.cfg +4 -0
- endf_userpy-0.1.0a1/setup.py +133 -0
- endf_userpy-0.1.0a1/tests/conftest.py +43 -0
- endf_userpy-0.1.0a1/tests/data/jeff33_1-H-2g_mf4_mt2.endf +1141 -0
- endf_userpy-0.1.0a1/tests/data/jeff33_13-Al-27g_mf4_mt2.endf +2949 -0
- endf_userpy-0.1.0a1/tests/data/jeff33_63-Eu-152m_mf4_mt2.endf +1250 -0
- endf_userpy-0.1.0a1/tests/data/n-001_H_001.endf +8832 -0
- endf_userpy-0.1.0a1/tests/data/n-001_H_002.endf +1831 -0
- endf_userpy-0.1.0a1/tests/data/n-004_Be_009.endf +17953 -0
- endf_userpy-0.1.0a1/tests/test_mf4_interpretation.py +72 -0
- endf_userpy-0.1.0a1/tests/test_mf5_interpretation.py +39 -0
- endf_userpy-0.1.0a1/tests/test_mf6_interpretation.py +175 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 International Atomic Energy Agency
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
include LICENSE
|
|
2
|
+
include README.md
|
|
3
|
+
include pyproject.toml
|
|
4
|
+
|
|
5
|
+
# Fortran and C sources required to build the extension from sdist.
|
|
6
|
+
include endf_userpy/fortran/endf6.f90
|
|
7
|
+
include endf_userpy/fortran/endf6-f2pywrappers.f
|
|
8
|
+
include endf_userpy/fortran/endf6module.c
|
|
9
|
+
|
|
10
|
+
# Test data, so the test suite is runnable from a sdist checkout.
|
|
11
|
+
recursive-include tests *.py
|
|
12
|
+
recursive-include tests/data *
|
|
13
|
+
include tests/conftest.py
|
|
14
|
+
|
|
15
|
+
# Numbered example scripts at the top level of examples/.
|
|
16
|
+
include examples/[0-9][0-9]_*.py
|
|
17
|
+
|
|
18
|
+
# Sphinx sources (not the rendered build).
|
|
19
|
+
recursive-include docs/source *
|
|
20
|
+
include docs/Makefile docs/make.bat
|
|
21
|
+
|
|
22
|
+
# Build artifacts and scratch files that must never ship.
|
|
23
|
+
global-exclude *.o
|
|
24
|
+
global-exclude *.so
|
|
25
|
+
global-exclude *.pyd
|
|
26
|
+
global-exclude *.pyf
|
|
27
|
+
global-exclude endf6module_active.c
|
|
28
|
+
global-exclude __pycache__
|
|
29
|
+
global-exclude *.py[cod]
|
|
30
|
+
global-exclude .DS_Store
|
|
31
|
+
prune build
|
|
32
|
+
prune dist
|
|
33
|
+
prune testenv
|
|
34
|
+
prune tests_fortran
|
|
35
|
+
prune docs/build
|
|
36
|
+
prune .pytest_cache
|
|
37
|
+
prune .github
|
|
38
|
+
prune endf_userpy.egg-info
|
|
39
|
+
exclude setup.py.bkup
|
|
40
|
+
exclude endf_userpy/daniel_notes.txt
|
|
41
|
+
exclude tests/tmp.py
|
|
42
|
+
exclude tests/manual_test_*.py
|
|
43
|
+
exclude tests/adhoc_test_*.py
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: endf-userpy
|
|
3
|
+
Version: 0.1.0a1
|
|
4
|
+
Summary: High-level interpretation of ENDF-6 data
|
|
5
|
+
Home-page: https://github.com/IAEA-NDS/endf-userpy
|
|
6
|
+
Author: Georg Schnabel, Daniel Lopez Aldama
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Repository, https://github.com/IAEA-NDS/endf-userpy
|
|
9
|
+
Project-URL: Issues, https://github.com/IAEA-NDS/endf-userpy/issues
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Science/Research
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
15
|
+
Classifier: Operating System :: MacOS :: MacOS X
|
|
16
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Programming Language :: Fortran
|
|
24
|
+
Classifier: Programming Language :: C
|
|
25
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
26
|
+
Requires-Python: >=3.9
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
Requires-Dist: numpy>=2.0
|
|
30
|
+
Requires-Dist: scipy
|
|
31
|
+
Requires-Dist: endf_parserpy
|
|
32
|
+
Dynamic: author
|
|
33
|
+
Dynamic: classifier
|
|
34
|
+
Dynamic: description
|
|
35
|
+
Dynamic: description-content-type
|
|
36
|
+
Dynamic: home-page
|
|
37
|
+
Dynamic: license
|
|
38
|
+
Dynamic: license-file
|
|
39
|
+
Dynamic: project-url
|
|
40
|
+
Dynamic: requires-dist
|
|
41
|
+
Dynamic: requires-python
|
|
42
|
+
Dynamic: summary
|
|
43
|
+
|
|
44
|
+
# endf-userpy
|
|
45
|
+
|
|
46
|
+
High-level interpretation of ENDF-6 nuclear data files.
|
|
47
|
+
|
|
48
|
+
`endf-userpy` is a Python library that answers user-friendly questions
|
|
49
|
+
about ENDF-6 nuclear data evaluations: "what is the cross section of
|
|
50
|
+
the (n,2n) reaction on Fe-56?", "what is the energy spectrum of
|
|
51
|
+
neutrons emitted from U-238 at 14 MeV?", "how much Co-60m is produced
|
|
52
|
+
per (n,gamma) reaction on Co-59?".
|
|
53
|
+
|
|
54
|
+
The library does not parse ENDF-6 itself. It builds on
|
|
55
|
+
[endf_parserpy](https://github.com/IAEA-NDS/endf-parserpy), which
|
|
56
|
+
turns an ENDF-6 file into a nested Python dict (`endf_dict`).
|
|
57
|
+
endf-userpy then walks that dict to reconstruct cross sections,
|
|
58
|
+
yields, and differential distributions, hiding which MF section a
|
|
59
|
+
piece of data lives in.
|
|
60
|
+
|
|
61
|
+
> **Status.** This is an early alpha release. The public API is
|
|
62
|
+
> stabilising but may still change. See "Known limitations" below.
|
|
63
|
+
> Feedback by creating issues is appreciated.
|
|
64
|
+
|
|
65
|
+
## Installation
|
|
66
|
+
|
|
67
|
+
Building requires a Fortran compiler (`gfortran` on Linux/macOS,
|
|
68
|
+
`ifx` on Windows) because part of the numerical work is done by a
|
|
69
|
+
f2py extension.
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
pip install -e .
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Runtime dependencies: `numpy`, `scipy`, `endf_parserpy`,
|
|
76
|
+
`matplotlib` (only for the examples).
|
|
77
|
+
|
|
78
|
+
## Quick start
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
import numpy as np
|
|
82
|
+
from endf_parserpy import EndfParserFactory
|
|
83
|
+
from endf_userpy.quantities import (
|
|
84
|
+
get_available_reactions,
|
|
85
|
+
get_reaction_xs,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
parser = EndfParserFactory.create()
|
|
89
|
+
endf_dict = parser.parsefile("tests/data/n-004_Be_009.endf")
|
|
90
|
+
|
|
91
|
+
print(get_available_reactions(endf_dict))
|
|
92
|
+
# ['(n,total)', '(n,n_0)', '(n,nonelas)', '(n,2n)', '(n,g)', ...]
|
|
93
|
+
|
|
94
|
+
eincs = np.array([0.0253, 1e3, 1e6, 1.4e7]) # eV
|
|
95
|
+
print(get_reaction_xs(endf_dict, "(n,total)", eincs))
|
|
96
|
+
# [6.154 6.144 3.341 1.528] barn
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Public API
|
|
100
|
+
|
|
101
|
+
All user-facing functions live in `endf_userpy.quantities` and take
|
|
102
|
+
an `endf_dict` (already parsed) plus user-friendly string identifiers.
|
|
103
|
+
|
|
104
|
+
| Function | Returns | What it does |
|
|
105
|
+
| --- | --- | --- |
|
|
106
|
+
| `get_available_reactions(endf_dict)` | list of reaction strings | introspect a file |
|
|
107
|
+
| `get_incident_energies(endf_dict, reaction)` | array | tabulated Einc mesh for a channel |
|
|
108
|
+
| `get_emission_energies(endf_dict, reaction, particle)` | array | tabulated Eout mesh |
|
|
109
|
+
| `get_reaction_xs(endf_dict, reaction, eincs)` | array | cross section of a named channel |
|
|
110
|
+
| `get_residual_production_xs(endf_dict, residual, eincs)` | array | production of a specific residual nucleus, isomer-resolved |
|
|
111
|
+
| `get_particle_production_xs(endf_dict, reaction, particle, eincs)` | array | ejectile production cross section |
|
|
112
|
+
| `get_particle_production_dxs_dE(endf_dict, reaction, particle, eincs, eouts)` | array | dσ/dE energy spectrum of emitted particle |
|
|
113
|
+
| `get_particle_production_dxs_dmu(endf_dict, reaction, particle, eincs, mus)` | array | dσ/dΩ angular distribution |
|
|
114
|
+
| `get_particle_production_ddxs(endf_dict, reaction, particle, eincs, eouts, mus)` | array | d²σ/dE/dΩ double-differential |
|
|
115
|
+
|
|
116
|
+
Reaction strings: `"(n,total)"`, `"(n,n_0)"` (elastic), `"(n,2n)"`,
|
|
117
|
+
`"(n,g)"` (capture), `"(n,p)"`, `"(n,a)"`, etc.
|
|
118
|
+
Particles: `"n"`, `"p"`, `"d"`, `"t"`, `"h"` (helium-3),
|
|
119
|
+
`"a"` (alpha), `"g"` (gamma).
|
|
120
|
+
Residual nuclei: `"Z-Sym-A"` (e.g. `"27-Co-60"`) or `"Sym-A"`
|
|
121
|
+
(e.g. `"Co-60"`), with optional isomer suffix `g`, `m`, `m1`, `m2`,
|
|
122
|
+
... (`"Co-60m"` = first metastable).
|
|
123
|
+
|
|
124
|
+
## Examples
|
|
125
|
+
|
|
126
|
+
Seven runnable examples in `examples/`:
|
|
127
|
+
|
|
128
|
+
| File | What it shows |
|
|
129
|
+
| --- | --- |
|
|
130
|
+
| `01_inspect_file.py` | discover what is in a file |
|
|
131
|
+
| `02_reaction_xs.py` | cross sections of named channels with consistency check |
|
|
132
|
+
| `03_particle_production_xs.py` | secondary-particle production from Fe-56 |
|
|
133
|
+
| `04_residual_production_isomers.py` | Co-58g/m and Co-60g/m via (n,2n) and (n,gamma) |
|
|
134
|
+
| `05_emission_spectra_14mev.py` | classic 14 MeV neutron emission spectrum from U-238 |
|
|
135
|
+
| `06_ddx_uranium_14mev.py` | double-differential cross section heatmap |
|
|
136
|
+
| `07_photonuclear_residuals.py` | (g,Nn) cascade on Au-197 |
|
|
137
|
+
|
|
138
|
+
Examples 1-2 use a small file shipped under `tests/data/`. Examples 3-7
|
|
139
|
+
each include the `wget` command to fetch the JENDL-5 file they need.
|
|
140
|
+
|
|
141
|
+
## Known limitations
|
|
142
|
+
|
|
143
|
+
- **No resonance reconstruction.** MF2 (resolved/unresolved resonance
|
|
144
|
+
parameters) is not reconstructed. For evaluations whose MF3 is empty
|
|
145
|
+
in the resonance region, pre-process the file with
|
|
146
|
+
[NJOY RECONR](https://github.com/njoy/NJOY2016) and pass the PENDF
|
|
147
|
+
file in.
|
|
148
|
+
- **DDX drops kinematic-delta channels.** The double-differential API
|
|
149
|
+
silently skips elastic and discrete-level inelastic channels because
|
|
150
|
+
they cannot be represented on a continuous Eout grid. They appear in
|
|
151
|
+
the 1D dσ/dE spectrum as sharp peaks instead.
|
|
152
|
+
- **Stubs.** `endf_userpy/discrete_quantities.py` and
|
|
153
|
+
`endf_userpy/translation.py` are work-in-progress sketches; do not
|
|
154
|
+
rely on them.
|
|
155
|
+
|
|
156
|
+
## Filing issues
|
|
157
|
+
|
|
158
|
+
[github.com/IAEA-NDS/endf-userpy/issues](https://github.com/IAEA-NDS/endf-userpy/issues)
|
|
159
|
+
|
|
160
|
+
## License and copyright
|
|
161
|
+
|
|
162
|
+
`endf-userpy` is distributed under the MIT license,
|
|
163
|
+
see the `LICENSE` file for details.
|
|
164
|
+
|
|
165
|
+
Nothing in this license shall be construed as a waiver, either express or implied,
|
|
166
|
+
of any of the privileges and immunities accorded to the IAEA by its Member States.
|
|
167
|
+
|
|
168
|
+
Copyright (c) 2026 International Atomic Energy Agency
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# endf-userpy
|
|
2
|
+
|
|
3
|
+
High-level interpretation of ENDF-6 nuclear data files.
|
|
4
|
+
|
|
5
|
+
`endf-userpy` is a Python library that answers user-friendly questions
|
|
6
|
+
about ENDF-6 nuclear data evaluations: "what is the cross section of
|
|
7
|
+
the (n,2n) reaction on Fe-56?", "what is the energy spectrum of
|
|
8
|
+
neutrons emitted from U-238 at 14 MeV?", "how much Co-60m is produced
|
|
9
|
+
per (n,gamma) reaction on Co-59?".
|
|
10
|
+
|
|
11
|
+
The library does not parse ENDF-6 itself. It builds on
|
|
12
|
+
[endf_parserpy](https://github.com/IAEA-NDS/endf-parserpy), which
|
|
13
|
+
turns an ENDF-6 file into a nested Python dict (`endf_dict`).
|
|
14
|
+
endf-userpy then walks that dict to reconstruct cross sections,
|
|
15
|
+
yields, and differential distributions, hiding which MF section a
|
|
16
|
+
piece of data lives in.
|
|
17
|
+
|
|
18
|
+
> **Status.** This is an early alpha release. The public API is
|
|
19
|
+
> stabilising but may still change. See "Known limitations" below.
|
|
20
|
+
> Feedback by creating issues is appreciated.
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
Building requires a Fortran compiler (`gfortran` on Linux/macOS,
|
|
25
|
+
`ifx` on Windows) because part of the numerical work is done by a
|
|
26
|
+
f2py extension.
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install -e .
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Runtime dependencies: `numpy`, `scipy`, `endf_parserpy`,
|
|
33
|
+
`matplotlib` (only for the examples).
|
|
34
|
+
|
|
35
|
+
## Quick start
|
|
36
|
+
|
|
37
|
+
```python
|
|
38
|
+
import numpy as np
|
|
39
|
+
from endf_parserpy import EndfParserFactory
|
|
40
|
+
from endf_userpy.quantities import (
|
|
41
|
+
get_available_reactions,
|
|
42
|
+
get_reaction_xs,
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
parser = EndfParserFactory.create()
|
|
46
|
+
endf_dict = parser.parsefile("tests/data/n-004_Be_009.endf")
|
|
47
|
+
|
|
48
|
+
print(get_available_reactions(endf_dict))
|
|
49
|
+
# ['(n,total)', '(n,n_0)', '(n,nonelas)', '(n,2n)', '(n,g)', ...]
|
|
50
|
+
|
|
51
|
+
eincs = np.array([0.0253, 1e3, 1e6, 1.4e7]) # eV
|
|
52
|
+
print(get_reaction_xs(endf_dict, "(n,total)", eincs))
|
|
53
|
+
# [6.154 6.144 3.341 1.528] barn
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Public API
|
|
57
|
+
|
|
58
|
+
All user-facing functions live in `endf_userpy.quantities` and take
|
|
59
|
+
an `endf_dict` (already parsed) plus user-friendly string identifiers.
|
|
60
|
+
|
|
61
|
+
| Function | Returns | What it does |
|
|
62
|
+
| --- | --- | --- |
|
|
63
|
+
| `get_available_reactions(endf_dict)` | list of reaction strings | introspect a file |
|
|
64
|
+
| `get_incident_energies(endf_dict, reaction)` | array | tabulated Einc mesh for a channel |
|
|
65
|
+
| `get_emission_energies(endf_dict, reaction, particle)` | array | tabulated Eout mesh |
|
|
66
|
+
| `get_reaction_xs(endf_dict, reaction, eincs)` | array | cross section of a named channel |
|
|
67
|
+
| `get_residual_production_xs(endf_dict, residual, eincs)` | array | production of a specific residual nucleus, isomer-resolved |
|
|
68
|
+
| `get_particle_production_xs(endf_dict, reaction, particle, eincs)` | array | ejectile production cross section |
|
|
69
|
+
| `get_particle_production_dxs_dE(endf_dict, reaction, particle, eincs, eouts)` | array | dσ/dE energy spectrum of emitted particle |
|
|
70
|
+
| `get_particle_production_dxs_dmu(endf_dict, reaction, particle, eincs, mus)` | array | dσ/dΩ angular distribution |
|
|
71
|
+
| `get_particle_production_ddxs(endf_dict, reaction, particle, eincs, eouts, mus)` | array | d²σ/dE/dΩ double-differential |
|
|
72
|
+
|
|
73
|
+
Reaction strings: `"(n,total)"`, `"(n,n_0)"` (elastic), `"(n,2n)"`,
|
|
74
|
+
`"(n,g)"` (capture), `"(n,p)"`, `"(n,a)"`, etc.
|
|
75
|
+
Particles: `"n"`, `"p"`, `"d"`, `"t"`, `"h"` (helium-3),
|
|
76
|
+
`"a"` (alpha), `"g"` (gamma).
|
|
77
|
+
Residual nuclei: `"Z-Sym-A"` (e.g. `"27-Co-60"`) or `"Sym-A"`
|
|
78
|
+
(e.g. `"Co-60"`), with optional isomer suffix `g`, `m`, `m1`, `m2`,
|
|
79
|
+
... (`"Co-60m"` = first metastable).
|
|
80
|
+
|
|
81
|
+
## Examples
|
|
82
|
+
|
|
83
|
+
Seven runnable examples in `examples/`:
|
|
84
|
+
|
|
85
|
+
| File | What it shows |
|
|
86
|
+
| --- | --- |
|
|
87
|
+
| `01_inspect_file.py` | discover what is in a file |
|
|
88
|
+
| `02_reaction_xs.py` | cross sections of named channels with consistency check |
|
|
89
|
+
| `03_particle_production_xs.py` | secondary-particle production from Fe-56 |
|
|
90
|
+
| `04_residual_production_isomers.py` | Co-58g/m and Co-60g/m via (n,2n) and (n,gamma) |
|
|
91
|
+
| `05_emission_spectra_14mev.py` | classic 14 MeV neutron emission spectrum from U-238 |
|
|
92
|
+
| `06_ddx_uranium_14mev.py` | double-differential cross section heatmap |
|
|
93
|
+
| `07_photonuclear_residuals.py` | (g,Nn) cascade on Au-197 |
|
|
94
|
+
|
|
95
|
+
Examples 1-2 use a small file shipped under `tests/data/`. Examples 3-7
|
|
96
|
+
each include the `wget` command to fetch the JENDL-5 file they need.
|
|
97
|
+
|
|
98
|
+
## Known limitations
|
|
99
|
+
|
|
100
|
+
- **No resonance reconstruction.** MF2 (resolved/unresolved resonance
|
|
101
|
+
parameters) is not reconstructed. For evaluations whose MF3 is empty
|
|
102
|
+
in the resonance region, pre-process the file with
|
|
103
|
+
[NJOY RECONR](https://github.com/njoy/NJOY2016) and pass the PENDF
|
|
104
|
+
file in.
|
|
105
|
+
- **DDX drops kinematic-delta channels.** The double-differential API
|
|
106
|
+
silently skips elastic and discrete-level inelastic channels because
|
|
107
|
+
they cannot be represented on a continuous Eout grid. They appear in
|
|
108
|
+
the 1D dσ/dE spectrum as sharp peaks instead.
|
|
109
|
+
- **Stubs.** `endf_userpy/discrete_quantities.py` and
|
|
110
|
+
`endf_userpy/translation.py` are work-in-progress sketches; do not
|
|
111
|
+
rely on them.
|
|
112
|
+
|
|
113
|
+
## Filing issues
|
|
114
|
+
|
|
115
|
+
[github.com/IAEA-NDS/endf-userpy/issues](https://github.com/IAEA-NDS/endf-userpy/issues)
|
|
116
|
+
|
|
117
|
+
## License and copyright
|
|
118
|
+
|
|
119
|
+
`endf-userpy` is distributed under the MIT license,
|
|
120
|
+
see the `LICENSE` file for details.
|
|
121
|
+
|
|
122
|
+
Nothing in this license shall be construed as a waiver, either express or implied,
|
|
123
|
+
of any of the privileges and immunities accorded to the IAEA by its Member States.
|
|
124
|
+
|
|
125
|
+
Copyright (c) 2026 International Atomic Energy Agency
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Minimal makefile for Sphinx documentation
|
|
2
|
+
#
|
|
3
|
+
|
|
4
|
+
# You can set these variables from the command line, and also
|
|
5
|
+
# from the environment for the first two.
|
|
6
|
+
SPHINXOPTS ?=
|
|
7
|
+
SPHINXBUILD ?= sphinx-build
|
|
8
|
+
SOURCEDIR = source
|
|
9
|
+
BUILDDIR = build
|
|
10
|
+
|
|
11
|
+
# Put it first so that "make" without argument is like "make help".
|
|
12
|
+
help:
|
|
13
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
14
|
+
|
|
15
|
+
.PHONY: help Makefile
|
|
16
|
+
|
|
17
|
+
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
18
|
+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
19
|
+
%: Makefile
|
|
20
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@ECHO OFF
|
|
2
|
+
|
|
3
|
+
pushd %~dp0
|
|
4
|
+
|
|
5
|
+
REM Command file for Sphinx documentation
|
|
6
|
+
|
|
7
|
+
if "%SPHINXBUILD%" == "" (
|
|
8
|
+
set SPHINXBUILD=sphinx-build
|
|
9
|
+
)
|
|
10
|
+
set SOURCEDIR=source
|
|
11
|
+
set BUILDDIR=build
|
|
12
|
+
|
|
13
|
+
%SPHINXBUILD% >NUL 2>NUL
|
|
14
|
+
if errorlevel 9009 (
|
|
15
|
+
echo.
|
|
16
|
+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
|
17
|
+
echo.installed, then set the SPHINXBUILD environment variable to point
|
|
18
|
+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
|
19
|
+
echo.may add the Sphinx directory to PATH.
|
|
20
|
+
echo.
|
|
21
|
+
echo.If you don't have Sphinx installed, grab it from
|
|
22
|
+
echo.https://www.sphinx-doc.org/
|
|
23
|
+
exit /b 1
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
if "%1" == "" goto help
|
|
27
|
+
|
|
28
|
+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
|
29
|
+
goto end
|
|
30
|
+
|
|
31
|
+
:help
|
|
32
|
+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
|
33
|
+
|
|
34
|
+
:end
|
|
35
|
+
popd
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Configuration file for the Sphinx documentation builder.
|
|
2
|
+
#
|
|
3
|
+
# For the full list of built-in configuration values, see the documentation:
|
|
4
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
|
5
|
+
|
|
6
|
+
# -- Project information -----------------------------------------------------
|
|
7
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
|
8
|
+
|
|
9
|
+
project = 'endf-userpy'
|
|
10
|
+
copyright = '2025, International Atomic Energy Agency (IAEA)'
|
|
11
|
+
author = 'Georg Schnabel, Daniel Lopez Aldama'
|
|
12
|
+
|
|
13
|
+
# -- General configuration ---------------------------------------------------
|
|
14
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
|
15
|
+
|
|
16
|
+
extensions = []
|
|
17
|
+
|
|
18
|
+
templates_path = ['_templates']
|
|
19
|
+
exclude_patterns = []
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
# -- Options for HTML output -------------------------------------------------
|
|
24
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
|
25
|
+
|
|
26
|
+
html_theme = 'sphinx_rtd_theme'
|
|
27
|
+
html_static_path = ['_static']
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Welcome to endf-userpy documentation
|
|
2
|
+
====================================
|
|
3
|
+
|
|
4
|
+
Add your content using ``reStructuredText`` syntax. See the
|
|
5
|
+
`reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_
|
|
6
|
+
documentation for details.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
.. toctree::
|
|
10
|
+
:maxdepth: 1
|
|
11
|
+
:caption: Contents:
|
|
12
|
+
|
|
13
|
+
quantities
|
|
File without changes
|
|
File without changes
|
|
File without changes
|