diff options
Diffstat (limited to 'utils/sddm/plot_energy.py')
-rwxr-xr-x | utils/sddm/plot_energy.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/sddm/plot_energy.py b/utils/sddm/plot_energy.py index b4882d9..5bb464e 100755 --- a/utils/sddm/plot_energy.py +++ b/utils/sddm/plot_energy.py @@ -598,7 +598,11 @@ def get_events(filenames, merge_fits=False): ev = ev.groupby('run',group_keys=False).apply(tag_michels) if merge_fits: - ev = pd.merge(fits,ev,how='inner',on=['run','gtid']) + ev = pd.merge(ev,fits,how='left',on=['run','gtid']) + # Reset n, id1, id2, and id3 columns to integers + for column in ['n','id1','id2','id3']: + ev[column] = ev[column].fillna(0) + ev[column] = ev[column].astype(np.int32) # Set the index to (run, gtid) so we can set columns from the single particle results ev = ev.set_index(['run','gtid']) ev_single_particle = ev[(ev.id2 == 0) & (ev.id3 == 0)] |