Use atoms/b-cm, atoms/cm3 in ResultsList.get_atoms

Co-Authored-By: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
Andrew Johnson 2020-03-23 13:43:36 -04:00 committed by GitHub
parent 4677714866
commit a2691a32d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -57,7 +57,7 @@ class ResultsList(list):
Material name to evaluate
nuc : str
Nuclide name to evaluate
nuc_units : {"atoms", "atoms/b/cm", "atoms/cm^3"}, optional
nuc_units : {"atoms", "atom/b-cm", "atom/cm3"}, optional
Units for the returned concentration. Default is ``"atoms"``
time_units : {"s", "d"}, optional
Units for the returned time array. Default is ``"s"`` to
@ -73,7 +73,7 @@ class ResultsList(list):
"""
check_value("time_units", time_units, {"s", "d"})
check_value("nuc_units", nuc_units,
{"atoms", "atoms/b/cm", "atoms/cm^3"})
{"atoms", "atom/b-cm", "atom/cm3"})
time = np.empty_like(self, dtype=float)
concentration = np.empty_like(self, dtype=float)
@ -90,7 +90,7 @@ class ResultsList(list):
if nuc_units != "atoms":
# Divide by volume to get density
concentration /= self[0].volume[mat]
if nuc_units == "atoms/b/cm":
if nuc_units == "atom/b-cm":
# 1 barn = 1e-24 cm^2
concentration *= 1e-24

View file

@ -29,12 +29,12 @@ def test_get_atoms(res):
# Check alternate units
volume = res[0].volume["1"]
t_days, n_cm3 = res.get_atoms("1", "Xe135", nuc_units="atoms/cm^3", time_units="d")
t_days, n_cm3 = res.get_atoms("1", "Xe135", nuc_units="atom/cm3", time_units="d")
assert t_days == pytest.approx(t_ref / (60 * 60 * 24))
assert n_cm3 == pytest.approx(n_ref / volume)
_t, n_bcm = res.get_atoms("1", "Xe135", nuc_units="atoms/b/cm")
_t, n_bcm = res.get_atoms("1", "Xe135", nuc_units="atom/b-cm")
assert n_bcm == pytest.approx(n_cm3 * 1e-24)