From 2094974ef3c0c070583a89eec063b4168a470e4b Mon Sep 17 00:00:00 2001 From: tlatorre Date: Mon, 27 Jul 2020 10:59:13 -0500 Subject: only merge fit info for events with at least 10 fits This commit updates get_events() to only merge fit info for events with at least 10 events. The reason for this is that when analyzing recent data where not all the fits have completed we don't want to plot the data for events which haven't completely finished being fit. --- utils/sddm/plot_energy.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'utils') diff --git a/utils/sddm/plot_energy.py b/utils/sddm/plot_energy.py index cf59bc6..192b8b9 100755 --- a/utils/sddm/plot_energy.py +++ b/utils/sddm/plot_energy.py @@ -570,8 +570,12 @@ def get_events(filenames, merge_fits=False, nhit_thresh=None): # Require at least 1 NHIT trigger to fire ev = ev[(ev.trg_type & (TRIG_NHIT_100_LO | TRIG_NHIT_100_MED | TRIG_NHIT_100_HI | TRIG_NHIT_20 | TRIG_NHIT_20_LB)) != 0] + # Require all 10 fits + fits = fits.groupby(['run','gtid']).filter(lambda x: len(x) >= 10).reset_index() + if merge_fits: ev = pd.merge(ev,fits,how='left',on=['run','gtid']) + # Reset n, id1, id2, and id3 columns to integers for column in ['n','id','id1','id2','id3']: ev[column] = ev[column].fillna(0) -- cgit