catch another zero division error
@@ -51,7 +51,12 @@ class ObservationStats(Stats):
self.obs_id = obs_id
self.livetime = livetime
- self.alpha_obs = alpha or a_on / a_off
+ if alpha is not None:
+ self.alpha_obs = alpha
+ elif a_off > 0:
+ self.alpha_obs = a_on / a_off
+ else:
+ self.alpha_obs = 0
self.gamma_rate = gamma_rate or n_on / livetime
self.bg_rate = bg_rate or self.alpha_obs * n_off / livetime
