diff --git a/seismostats/analysis/bvalue/base.py b/seismostats/analysis/bvalue/base.py index 8409f4b..4e9792a 100644 --- a/seismostats/analysis/bvalue/base.py +++ b/seismostats/analysis/bvalue/base.py @@ -93,10 +93,11 @@ def _filtering(self): ''' Filter out magnitudes below the completeness magnitude. ''' - self.magnitudes = self.magnitudes[self.magnitudes - >= self.mc - self.delta_m / 2] - self.weights = self.weights[self.magnitudes - >= self.mc - self.delta_m / 2] + idx = self.magnitudes >= self.mc - self.delta_m / 2 + self.magnitudes = self.magnitudes[idx] + + if self.weights is not None: + self.weights = self.weights[idx] def _sanity_checks(self): '''