Skip to content

Commit

Permalink
clipping to avoid neg s_detected
Browse files Browse the repository at this point in the history
  • Loading branch information
cecilia-ferrari committed Jan 9, 2024
1 parent 8d45e43 commit 51b6b89
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flamedisx/lxe_blocks/raw_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 51b6b89

Please sign in to comment.