Skip to content

Commit

Permalink
Merge pull request #323 from carlocamilloni/main
Browse files Browse the repository at this point in the history
small fix for make_mat.py
  • Loading branch information
carlocamilloni authored Jan 12, 2024
2 parents 76c806e + cc73e5a commit 25ecdef
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tools/make_mat/make_mat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 25ecdef

Please sign in to comment.