make it possible to not compute the lower or upper threshold
@@ -150,7 +150,7 @@ class SpectrumObservation(object):
if self.off_vector is not None:
self.off_vector.reset_thresholds()
- def compute_energy_threshold(self, method_lo='area_max', method_hi='area_max', reset=False, **kwargs):
+ def compute_energy_threshold(self, method_lo=None, method_hi=None, reset=False, **kwargs):
"""Compute and set the safe energy threshold.
Set the high and low energy threshold for each observation based on a
@@ -192,6 +192,7 @@ class SpectrumObservation(object):
# vector, otherwise Sherpa will not understand the files
# Low threshold
+ if method_lo is not None:
if method_lo == 'area_max':
aeff_thres = kwargs['area_percent_lo'] / 100 * self.aeff.max_area
thres_lo = self.aeff.find_energy(aeff_thres)
@@ -206,6 +207,7 @@ class SpectrumObservation(object):
self.off_vector.lo_threshold = thres_lo
# High threshold
+ if method_hi is not None:
if method_hi == 'area_max':
aeff_thres = kwargs['area_percent_hi'] / 100 * self.aeff.max_area
thres_hi = self.aeff.find_energy(aeff_thres, reverse=True)
