In [1]:
%pylab inline
from scipy.optimize import curve_fit
from scipy import stats
from fid_v_dephase_helpers import *
In [2]:
rootdir = '../out/2013-08-06/fid_v_bg/'
dat = get_data(rootdir, 'bg_emission_rate')
plot_deg_of_corr(dat)
plt.gca().invert_xaxis()
plt.xlabel('Background emission rate')
Out[2]:
In [5]:
hold_param = dat[0].astype(np.float)
grect = dat[1][0]
gdiag = dat[1][1]
gcirc = dat[1][2]
slope1, intercept1, a, b, c= stats.linregress(hold_param, gdiag/grect)
slope2, intercept2, a, b, c= stats.linregress(hold_param, - gcirc/grect)
plt.figure(figsize = (16/1.5, 9/1.5))
plt.gca().invert_xaxis()
plt.xlabel('Background emission rate.') ;
plt.legend(['gdiag/grect', 'fit', '-gcirc/grect', 'fit'])
plt.ylim([0, 0.5])
plt.plot(hold_param, gdiag/ grect, 'r--', hold_param, intercept1 + slope1*hold_param, 'r-')
plt.plot(hold_param, - gcirc/ grect, 'b--', hold_param, intercept2 + slope2*hold_param, 'b-')
Out[5]:
In the reasonably realistic background range of 0 -> 0.3 the ratios of grect to gdiag and gcirc looks fairly constant.
In [ ]: