From 64e5d47398a428ae7eca9e3c1251b9d9a35a823d Mon Sep 17 00:00:00 2001 From: tlatorre Date: Mon, 4 Jan 2021 13:00:20 -0600 Subject: update radius cut in dc --- utils/dc | 12 +++++++++--- 1 file 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 # # 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) -- cgit