From 62a67e3023508381605bf8fc0233d1da331d776a Mon Sep 17 00:00:00 2001 From: sniedbalski <77023264+sniedbalski@users.noreply.github.com> Date: Tue, 23 Apr 2024 12:13:38 -0400 Subject: [PATCH] Update run_socket_grex.py Make min_dm, max_ibox, min_snr, and min_snr_t2out settable through command line arguments for run_socket_grex. Main goal is that these values can be set in a .env file in grex/pipeline. Will submit PR for grex.sh soon that will make this possible --- scripts/run_socket_grex.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/run_socket_grex.py b/scripts/run_socket_grex.py index 80bd3ca..c58fc81 100644 --- a/scripts/run_socket_grex.py +++ b/scripts/run_socket_grex.py @@ -9,7 +9,14 @@ HOST = "127.0.0.1" PORT = 12345 -def main(trigger=True): +def main(trigger=True, args=sys.argv): + min_dm = float(args[1]) + max_ibox = float(args[2]) + min_snr = float(args[3]) + min_snr_t2out = float(args[4]) + + print(f'min_dm: {min_dm}, max_ibox: {max_ibox}, min_snr: {min_snr}, min_snr_t2out: {min_snr_t2out}') + # Use roughly 8 seconds as a gulp size gulpsize = 16384 * 8 @@ -50,9 +57,8 @@ def main(trigger=True): print("Number of candidates %d" % cand_count) if cand_count > 0: - print("Filtering", "last trig was ", last_trigger_time - last_trigger_time = socket_grex.filter_candidates(candstr_list, trigger=trigger, - last_trigger_time=last_trigger_time) + print("Filtering", "last trig was ", last_trigger_time) + last_trigger_time = socket_grex.filter_candidates(candstr_list, trigger=trigger, last_trigger_time=last_trigger_time, min_dm=min_dm, max_ibox=max_ibox, min_snr=min_snr, min_snr_t2out=min_snr_t2out) print("Finished filtering") continue