diff options
author | tlatorre <tlatorre@uchicago.edu> | 2020-05-25 09:29:24 -0500 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2020-05-25 09:29:24 -0500 |
commit | 08774113d0a5f3f58bd6dbe6996c871b12495309 (patch) | |
tree | 9e5548f4e1a8d6479dd670e71f52ed490a870285 /utils/dc | |
parent | c91d11cd1c712639c9639ba6878cdd18d008a2f6 (diff) | |
download | sddm-08774113d0a5f3f58bd6dbe6996c871b12495309.tar.gz sddm-08774113d0a5f3f58bd6dbe6996c871b12495309.tar.bz2 sddm-08774113d0a5f3f58bd6dbe6996c871b12495309.zip |
update contamination analysis stuff
- fix Constraint.renormalize_no_fix() which could enter an infinite loop if the
fixed parameter was greater than 1 - EPSILON
- don't divide by psi twice in get_events()
- only use prompt events and cut on nhit_cal < 100
Diffstat (limited to 'utils/dc')
-rwxr-xr-x | utils/dc | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -280,6 +280,8 @@ if __name__ == '__main__': import matplotlib.pyplot as plt ev = get_events(args.filenames,merge_fits=True) + ev = ev[ev.prompt] + ev = ev[ev.nhit_cal > 100] # figure out bins for high level variables ev = radius_cut(ev) @@ -451,7 +453,7 @@ if __name__ == '__main__': #samples = metropolis_hastings(nll,xopt,stepsizes,100000) #print("nll(xopt) = %.2g" % nll(xopt)) - pos = np.empty((10, len(x0)),dtype=np.double) + pos = np.empty((100, len(x0)),dtype=np.double) for i in range(pos.shape[0]): pos[i] = xopt + np.random.randn(len(x0))*stepsizes pos[i,:6] = np.clip(pos[i,:6],EPSILON,1e9) @@ -463,7 +465,7 @@ if __name__ == '__main__': nwalkers, ndim = pos.shape - proposal = get_proposal_func(stepsizes*0.1,low,high) + proposal = get_proposal_func(stepsizes,low,high) sampler = emcee.EnsembleSampler(nwalkers, ndim, lambda x, grad, fill_value: -nll(x,grad,fill_value), moves=emcee.moves.MHMove(proposal),args=[None,np.inf]) with np.errstate(invalid='ignore'): sampler.run_mcmc(pos, args.steps) |