From fb9b942d6060ed3afb7d64f1a57238edf81ec469 Mon Sep 17 00:00:00 2001 From: calum-chamberlain Date: Thu, 14 Dec 2023 14:01:52 +1300 Subject: [PATCH] Start streaming immediately on run --- rt_eqcorrscan/rt_match_filter.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rt_eqcorrscan/rt_match_filter.py b/rt_eqcorrscan/rt_match_filter.py index b547b30..7d6f538 100644 --- a/rt_eqcorrscan/rt_match_filter.py +++ b/rt_eqcorrscan/rt_match_filter.py @@ -679,6 +679,12 @@ def run( The party created - will not contain detections expired by `keep_detections` threshold. """ + # First: start collecting data NOW + # Get this locally before streaming starts + buffer_capacity = self.rt_client.buffer_capacity + # Start the streamer + self._start_streaming() + # Update backfill start time self._last_backfill_start = UTCDateTime.now() restart_interval = 600.0 @@ -720,10 +726,6 @@ def run( detect_directory = detect_directory.format(name=self.name) if not os.path.isdir(detect_directory): os.makedirs(detect_directory) - # Get this locally before streaming starts - buffer_capacity = self.rt_client.buffer_capacity - # Start the streamer - self._start_streaming() Logger.info("Detection will use the following data: {0}".format( self.expected_seed_ids))