aboutsummaryrefslogtreecommitdiff
path: root/utils/dc
diff options
context:
space:
mode:
Diffstat (limited to 'utils/dc')
-rwxr-xr-xutils/dc18
1 files changed, 1 insertions, 17 deletions
diff --git a/utils/dc b/utils/dc
index b551925..0c14053 100755
--- a/utils/dc
+++ b/utils/dc
@@ -26,7 +26,6 @@ import emcee
from scipy.optimize import brentq
from scipy.stats import truncnorm
from matplotlib.lines import Line2D
-from sddm.dc import get_proposal_func, estimate_errors, metropolis_hastings, EPSILON
from sddm.plot import despine
from sddm.dc import *
from sddm.plot_energy import *
@@ -372,28 +371,13 @@ if __name__ == '__main__':
# so we can tag retrigger events
ev['dt'] = ev.groupby(['run'],as_index=False)['gtr'].transform(lambda x: np.concatenate(([1e9],np.diff(x.values))))
- # This is a bit of a hack. It appears that many times the fit will
- # actually do much better by including a very low energy electron or
- # muon. I believe the reason for this is that of course my likelihood
- # function is not perfect (for example, I don't include the correct
- # angular distribution for Rayleigh scattered light), and so the fitter
- # often wants to add a very low energy electron or muon to fix things.
- #
- # Ideally I would fix the likelihood function, but for now we just
- # discard any fit results which have a very low energy electron or
- # muon.
- #
- # FIXME: Test this since query() is new to pandas
- fits = fits.query('not (n > 1 and ((id1 == 20 and energy1 < 20) or (id2 == 20 and energy2 < 20) or (id3 == 20 and energy3 < 20)))')
- fits = fits.query('not (n > 1 and ((id2 == 22 and energy1 < 200) or (id2 == 22 and energy2 < 200) or (id3 == 22 and energy3 < 200)))')
-
# Calculate the approximate Ockham factor.
# See Chapter 20 in "Probability Theory: The Logic of Science" by Jaynes
#
# Note: This is a really approximate form by assuming that the shape of
# the likelihood space is equal to the average uncertainty in the
# different parameters.
- fits['w'] = fits['n']*np.log(0.1*0.001) + np.log(fits['energy1']) + fits['n']*np.log(1e-4/(4*np.pi))
+ fits['w'] = fits['n']*np.log(0.05/10e3) + np.log(fits['energy1']) + fits['n']*np.log(1e-4/(4*np.pi))
fits['w'] -= fits['n']*100
# Note: we index on the left hand site with loc to avoid a copy error