mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-29 06:35:48 -04:00
Fixed bug in Filter.get_bin_index(...) for energy bins with 0.0 as the lower energy
This commit is contained in:
parent
0965e20c08
commit
ff89950e9d
1 changed files with 3 additions and 3 deletions
|
|
@ -386,10 +386,10 @@ class Filter(object):
|
|||
|
||||
# Use lower energy bound to find index for energy Filters
|
||||
elif self.type in ['energy', 'energyout']:
|
||||
deltas = np.abs(self.bins - filter_bin[0]) / filter_bin[0]
|
||||
deltas = np.abs(self.bins - filter_bin[1]) / filter_bin[1]
|
||||
min_delta = np.min(deltas)
|
||||
if min_delta < 1E-5:
|
||||
filter_index = deltas.argmin()
|
||||
if min_delta < 1E-3:
|
||||
filter_index = deltas.argmin() - 1
|
||||
else:
|
||||
raise ValueError
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue