From eb2b689a02877ab17555c344e370b31448b18168 Mon Sep 17 00:00:00 2001 From: Jonah Miller Date: Mon, 23 Dec 2024 08:47:01 -0700 Subject: [PATCH] fix hdf5_to_dict --- script/analysis/hdf5_to_dict.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/analysis/hdf5_to_dict.py b/script/analysis/hdf5_to_dict.py index 1e7fe56..633efee 100644 --- a/script/analysis/hdf5_to_dict.py +++ b/script/analysis/hdf5_to_dict.py @@ -402,7 +402,8 @@ def load_dump(fname, geom=None, nulegacy=False): Ns = dump['local_Ns'][:] wb2N = Ns*wmean*wmean w2 = dump['local_wsqr'][:] - dump['local_stddev'] = np.sqrt(wb2N + N2*(w2 - wb2N)/(Ns - 1)) + ones = np.ones_like(Ns) + dump['local_stddev'] = np.sqrt(wb2N + Ns*(w2 - wb2N)/(np.minimum(ones, Ns - 1)) if hdr['NEUTRINO_OSCILLATIONS']: dump['local_osc_rate'] = dfile['local_osc_count'][:]