From b9ad56a038005aaf56f2a18d92fc40fcae50af48 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Mon, 28 Nov 2016 18:32:46 -0500 Subject: [PATCH] Added low and high filter bounds to Pandas DataFrames for Azimuthal and Polar filters --- openmc/filter.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/openmc/filter.py b/openmc/filter.py index 0320cdeca8..9da77c18e3 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -1323,11 +1323,14 @@ class PolarFilter(Filter): # Extract the lower and upper angle bounds, then repeat and tile # them as necessary to account for other filters. lo_bins = np.repeat(self.bins[:-1], self.stride) + hi_bins = np.repeast(self.bins[1:], self.stride) tile_factor = data_size / len(lo_bins) lo_bins = np.tile(lo_bins, tile_factor) + hi_bins = np.tile(hi_bins, tile_factor) # Add the new angle columns to the DataFrame. df.loc[:, 'polar low'] = lo_bins + df.loc[:, 'polar high'] = hi_bins return df @@ -1399,11 +1402,14 @@ class AzimuthalFilter(Filter): # Extract the lower and upper angle bounds, then repeat and tile # them as necessary to account for other filters. lo_bins = np.repeat(self.bins[:-1], self.stride) + hi_bins = np.repeat(self.bins[1:], self.stride) tile_factor = data_size / len(lo_bins) lo_bins = np.tile(lo_bins, tile_factor) + hi_bins = np.tile(hi_bins, tile_factor) # Add the new angle columns to the DataFrame. df.loc[:, 'azimuthal low'] = lo_bins + df.loc[:, 'azimuthal high'] = hi_bins return df