Skip to content

Commit

Permalink
Fixed QUfit incompatibility with numpy>=1.26.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cameron-Van-Eck committed Nov 6, 2023
1 parent a52419a commit 11b32b8
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions RMutils/util_plotTk.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,20 +431,22 @@ def plot_pqu_vs_lamsq_ax(ax, lamSqArr_m2, qArr, uArr, pArr=None, dqArr=None,
errDict[name] = model_dict['posterior'][name][idx]
QUerrmodel.append(model_dict['model'](errDict, lamSqHirArr_m2))
QUerrmodel = np.array(QUerrmodel)
low, med, high = np.percentile(QUerrmodel, [16, 50, 84], axis=0)
low_re, med_re, high_re = np.percentile(np.real(QUerrmodel), [16, 50, 84], axis=0)
low_im, med_im, high_im = np.percentile(np.imag(QUerrmodel), [16, 50, 84], axis=0)
low_abs, med_abs, high_abs = np.percentile(np.abs(QUerrmodel), [16, 50, 84], axis=0)

ax.plot(lamSqHirArr_m2, np.real(med),
ax.plot(lamSqHirArr_m2, med_re,
'-', color='tab:blue', linewidth=0.1, alpha=1)
ax.fill_between(lamSqHirArr_m2, np.real(low), np.real(high),
ax.fill_between(lamSqHirArr_m2, low_re, high_re,
color='tab:blue', alpha=0.5)
ax.plot(lamSqHirArr_m2, np.imag(med),
ax.plot(lamSqHirArr_m2, med_im,
'-', color='tab:red', linewidth=0.1, alpha=1)
ax.fill_between(lamSqHirArr_m2, np.imag(low), np.imag(high),
ax.fill_between(lamSqHirArr_m2, low_im, high_im,
color='tab:red', alpha=0.5)
if qModArr is not None and uModArr is not None:
ax.plot(lamSqHirArr_m2, np.abs(med),
ax.plot(lamSqHirArr_m2, med_abs,
'-', color='k', linewidth=0.1, alpha=1)
ax.fill_between(lamSqHirArr_m2, np.abs(low), np.abs(high),
ax.fill_between(lamSqHirArr_m2, low_abs, high_abs,
color='k', alpha=0.5)

# Formatting
Expand Down

0 comments on commit 11b32b8

Please sign in to comment.