From cc73e5a111d93988c807ef7ff8b92a4b62b97659 Mon Sep 17 00:00:00 2001 From: Carlo Camilloni Date: Fri, 12 Jan 2024 21:48:05 +0100 Subject: [PATCH] small fix for make_mat.py --- tools/make_mat/make_mat.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/make_mat/make_mat.py b/tools/make_mat/make_mat.py index 177ec183..97a7e386 100644 --- a/tools/make_mat/make_mat.py +++ b/tools/make_mat/make_mat.py @@ -353,8 +353,8 @@ def c12_avg(values, weights, callback=allfunction): if np.sum(w) == 0: return 0 r = np.where(w > 0.0) - v = v[r[0][0] : v.size] - w = w[r[0][0] : w.size] + v = v[r[0][0]:v.size] + w = w[r[0][0]:w.size] res = np.maximum(cutoff / 4.5, 0.1) exp_aver = (1.0 / res) / np.log(np.sum(w * np.exp(1.0 / v / res)) / norm) @@ -505,8 +505,9 @@ def calculate_intra_probabilities(args): for ai, aj, c12 in user_pairs: ai = int(ai) aj = int(aj) - c12_cutoff[ai][aj] = CUTOFF_FACTOR * np.power(c12, 1.0 / 12.0) - c12_cutoff[aj][ai] = CUTOFF_FACTOR * np.power(c12, 1.0 / 12.0) + if c12 > 0.0: + c12_cutoff[ai][aj] = CUTOFF_FACTOR * np.power(c12, 1.0 / 12.0) + c12_cutoff[aj][ai] = CUTOFF_FACTOR * np.power(c12, 1.0 / 12.0) if np.any(c12_cutoff > args.cutoff): warning_cutoff_histo(args.cutoff, np.max(c12_cutoff))