From 75548aade800bcab72a865bcc2f1ca4f75fcec37 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Mon, 8 Aug 2022 13:34:20 +0100 Subject: [PATCH] added bin_log_width to energyfilter --- openmc/filter.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openmc/filter.py b/openmc/filter.py index be3d97679..7fe454865 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -1324,6 +1324,13 @@ class EnergyFilter(RealFilter): cv.check_greater_than('filter value', v0, 0., equality=True) cv.check_greater_than('filter value', v1, 0., equality=True) + def bin_log_width(self): + """Returns the base 10 log width of energy bins which is useful when + plotting the normalized flux""" + bin_edges = np.unique(self.bins) + log_width = np.log10(bin_edges[1:]/bin_edges[:-1]) + return log_width + @classmethod def from_group_structure(cls, group_structure): """Construct an EnergyFilter instance from a standard group structure.