diff --git a/flamedisx/lxe_blocks/raw_signals.py b/flamedisx/lxe_blocks/raw_signals.py index 265e99e4c..caa40f2bf 100644 --- a/flamedisx/lxe_blocks/raw_signals.py +++ b/flamedisx/lxe_blocks/raw_signals.py @@ -70,8 +70,9 @@ def _compute(self, # add offset to std to avoid NaNs from norm.pdf if std = 0 if self.quanta_name == 'electron': + s_observed = np.clip(s_observed, 1e-15, tf.float32.max) result = tfp.distributions.Poisson( - rate = mean).prob(s_observed) + rate = mean + 1e-10 ).prob(s_observed) else: result = tfp.distributions.Normal( loc=mean, scale=std + 1e-10