aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2020-08-30 09:15:06 -0500
committertlatorre <tlatorre@uchicago.edu>2020-08-30 09:15:06 -0500
commitaf9dc4f29d548fe4a3c9b9ef68540d88c2a1fc9e (patch)
tree88f34da1a896dddc436f76e1e43b32865381aab9
parent5ee97c0d6c33c7e99f3875493e0ffda834a785c7 (diff)
downloadsddm-af9dc4f29d548fe4a3c9b9ef68540d88c2a1fc9e.tar.gz
sddm-af9dc4f29d548fe4a3c9b9ef68540d88c2a1fc9e.tar.bz2
sddm-af9dc4f29d548fe4a3c9b9ef68540d88c2a1fc9e.zip
small updates to chi2 script
-rwxr-xr-xutils/chi224
1 files changed, 23 insertions, 1 deletions
diff --git a/utils/chi2 b/utils/chi2
index 5ef97f5..960d87c 100755
--- a/utils/chi2
+++ b/utils/chi2
@@ -362,7 +362,7 @@ def do_fit(data,muon,data_mc,bins,steps):
pos = np.empty((20, len(x0)),dtype=np.double)
for i in range(pos.shape[0]):
- pos[i] = xopt + np.random.randn(len(x0))*0.1
+ pos[i] = xopt + np.random.randn(len(x0))*xopt*0.1
pos[i,:] = np.clip(pos[i,:],low,high)
nwalkers, ndim = pos.shape
@@ -597,29 +597,51 @@ if __name__ == '__main__':
plt.subplot(3,3,1)
plt.hist(samples[:,0],bins=100,histtype='step')
plt.xlabel("Atmospheric Flux Scale")
+ despine(ax=plt.gca(),left=True,trim=True)
+ plt.gca().get_yaxis().set_visible(False)
plt.subplot(3,3,2)
plt.hist(samples[:,1],bins=100,histtype='step')
plt.xlabel("Electron Energy Scale")
+ despine(ax=plt.gca(),left=True,trim=True)
+ plt.gca().get_yaxis().set_visible(False)
plt.subplot(3,3,3)
plt.hist(samples[:,2],bins=100,histtype='step')
plt.xlabel("Electron Energy Resolution")
+ despine(ax=plt.gca(),left=True,trim=True)
+ plt.gca().get_yaxis().set_visible(False)
plt.subplot(3,3,4)
plt.hist(samples[:,3],bins=100,histtype='step')
plt.xlabel("Muon Energy Scale")
+ despine(ax=plt.gca(),left=True,trim=True)
+ plt.gca().get_yaxis().set_visible(False)
plt.subplot(3,3,5)
plt.hist(samples[:,4],bins=100,histtype='step')
plt.xlabel("Muon Energy Resolution")
+ despine(ax=plt.gca(),left=True,trim=True)
+ plt.gca().get_yaxis().set_visible(False)
plt.subplot(3,3,6)
plt.hist(samples[:,5],bins=100,histtype='step')
plt.xlabel("Electron + Muon Energy Scale")
+ despine(ax=plt.gca(),left=True,trim=True)
+ plt.gca().get_yaxis().set_visible(False)
plt.subplot(3,3,7)
plt.hist(samples[:,6],bins=100,histtype='step')
plt.xlabel("Electron + Muon Energy Resolution")
+ despine(ax=plt.gca(),left=True,trim=True)
+ plt.gca().get_yaxis().set_visible(False)
plt.subplot(3,3,8)
plt.hist(samples[:,7],bins=100,histtype='step')
plt.xlabel("Muon Scale")
+ despine(ax=plt.gca(),left=True,trim=True)
+ plt.gca().get_yaxis().set_visible(False)
plt.tight_layout()
+ if args.save:
+ plt.savefig("chi2_fit_posterior.pdf")
+ plt.savefig("chi2_fit_posterior.eps")
+ else:
+ plt.suptitle("Fit Posteriors")
+
handles = [Line2D([0], [0], color='C0'),
Line2D([0], [0], color='C1'),
Line2D([0], [0], color='C2')]