import numpy as np, json, matplotlib; matplotlib.use('Agg'); import matplotlib.pyplot as plt lo=np.load('zp_pairs.npy'); hi=np.load('zp_pairs_1e12.npy')[:,:4] def zn(a): s,z1,z2,t=a.T; return s,np.sqrt(z1*z2)/np.log(t/(2*np.pi)),t groups={'t<1e5':lo[lo[:,3]<1e5],'1e5-5e5':lo[(lo[:,3]>=1e5)&(lo[:,3]<5e5)],'5e5-1.13e6':lo[lo[:,3]>=5e5],'~2.7e11 (#1e12)':hi} def fit(a,smax=0.3): s,z,t=zn(a); m=s