Skip to content

Commit 1f6e60e

Browse files
authored
Fix lethargy normalization in spectrum plots (#530)
Use upper boundary of energy groups not middle boundary Closes #529
1 parent 16f2748 commit 1f6e60e

File tree

3 files changed

+2
-1
lines changed

3 files changed

+2
-1
lines changed

src/serpentTools/detectors.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,10 +567,11 @@ def spectrumPlot(
567567
elif len(slicedTallies.shape) == 1:
568568
slicedTallies = slicedTallies.reshape(slicedTallies.size, 1)
569569

570+
# (n_groups, 3) where columns are lower, upper, and middle energy
570571
lowerE = self.grids['E'][:, 0]
571572
if normalize:
572573
lethBins = log(
573-
divide(self.grids['E'][:, -1], lowerE))
574+
divide(self.grids['E'][:, 1], lowerE))
574575
# Need to scale up the dimension of the energy grids to support
575576
# broadcasting -> (E, N) / (E, )
576577
slicedTallies /= lethBins[:, newaxis]
2.25 KB
Loading
-262 Bytes
Loading

0 commit comments

Comments
 (0)