aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2021-01-04 13:00:20 -0600
committertlatorre <tlatorre@uchicago.edu>2021-01-04 13:00:20 -0600
commit64e5d47398a428ae7eca9e3c1251b9d9a35a823d (patch)
treed4b8dedeba4a141931dff04391b4863dee5aeb34
parentff964bf4eecd34691cd097e5aa3ed6b67680a577 (diff)
downloadsddm-64e5d47398a428ae7eca9e3c1251b9d9a35a823d.tar.gz
sddm-64e5d47398a428ae7eca9e3c1251b9d9a35a823d.tar.bz2
sddm-64e5d47398a428ae7eca9e3c1251b9d9a35a823d.zip
update radius cut in dc
-rwxr-xr-xutils/dc12
1 files changed, 9 insertions, 3 deletions
diff --git a/utils/dc b/utils/dc
index 82e9418..23aae1e 100755
--- a/utils/dc
+++ b/utils/dc
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# Copyright (c) 2019, Anthony Latorre <tlatorre at uchicago>
#
# This program is free software: you can redistribute it and/or modify it
@@ -37,7 +37,7 @@ except ImportError:
sys.exit(1)
def radius_cut(ev):
- ev['radius_cut'] = np.digitize((ev.r/PSUP_RADIUS)**3,(0.9,))
+ ev['radius_cut'] = np.digitize(ev.r,(AV_RADIUS,))
return ev
def udotr_cut(ev):
@@ -264,15 +264,21 @@ if __name__ == '__main__':
parser.add_argument("--save", action="store_true", default=False, help="save plots")
parser.add_argument("--mc", nargs='+', required=True, help="atmospheric MC files")
parser.add_argument("--nhit-thresh", type=int, default=None, help="nhit threshold to apply to events before processing (should only be used for testing to speed things up)")
+ parser.add_argument("--run-list", default=None, help="run list")
args = parser.parse_args()
setup_matplotlib(args.save)
import matplotlib.pyplot as plt
+ rhdr = pd.concat([read_hdf(filename, "rhdr").assign(filename=filename) for filename in args.filenames],ignore_index=True)
+
+ if args.run_list is not None:
+ run_list = np.genfromtxt(args.run_list)
+ rhdr = rhdr[rhdr.run.isin(run_list)]
+
# Loop over runs to prevent using too much memory
evs = []
- rhdr = pd.concat([read_hdf(filename, "rhdr").assign(filename=filename) for filename in args.filenames],ignore_index=True)
for run, df in rhdr.groupby('run'):
evs.append(get_events(df.filename.values, merge_fits=True, nhit_thresh=args.nhit_thresh))
ev = pd.concat(evs)