Skip to content

Commit

Permalink
fixed names and import
Browse files Browse the repository at this point in the history
  • Loading branch information
SteSeg committed Dec 9, 2024
1 parent c693621 commit 287ee47
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libra_toolbox/neutronics/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from . import neutron_source
from .neutron_source import *
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# building the MIT-VaultLab neutron generator
# angular and energy distribution

from pathlib import Path
import numpy as np
import h5py
import openmc


def mvng_source_diamond(center=(0, 0, 0), reference_uvw=(0, 0, 1)):
def neutron_source_diamond(center=(0, 0, 0), reference_uvw=(0, 0, 1)):
'''method for building the MIT-VaultLab neutron generator in OpenMC
with data tabulated from John Ball and Shon Mackie characterization
via diamond detectors
Expand All @@ -23,7 +24,10 @@ def mvng_source_diamond(center=(0, 0, 0), reference_uvw=(0, 0, 1)):

angles = ["0", "15", "30", "45", "60", "75", "90", "105", "120", "135", "150"]

with h5py.File('mvng_source_diamond.h5', 'r') as mvng_source:
filename = 'neutron_source_diamond.h5'
filename = str(Path(__file__).parent) / Path(filename)

with h5py.File(filename, 'r') as mvng_source:
# energy values
energies = mvng_source['values/table']['Energy (MeV)'] * 1e6
# angular bins in [0, pi)
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ tests = ["pytest>=5.4.3", "pytest-cov", "nbconvert", "ipykernel"]
write_to = "libra_toolbox/_version.py"

[tool.setuptools.package-data]
mvng_source = ["libra_toolbox/neutronics/neutron_source/mvng_source_diamond.h5"]
mvng_source = ["libra_toolbox/neutronics/neutron_source_diamond.h5"]

0 comments on commit 287ee47

Please sign in to comment.