cta-observatory / pyirf

Python IRF builder
https://pyirf.readthedocs.io/en/stable/
MIT License
15 stars 25 forks source link

li_ma_significance needs float64 for large numbers #205

Closed moralejo closed 1 year ago

moralejo commented 1 year ago
noff = 1e7
nexcess = 1e4

print(li_ma_significance(np.float64(noff+nexcess), np.float64(noff / 0.2), 0.2))
print(li_ma_significance(np.float32(noff+nexcess), np.float32(noff / 0.2), 0.2))

2.8861902631323018
3.7806044

May be this is unavoidable, I don't know... or perhaps it can be fixed just by using float64 internally in the calculation?