@@ -196,6 +196,7 @@ def _handle_detections(
196
196
self ,
197
197
new_party : Party ,
198
198
trig_int : float ,
199
+ hypocentral_separation : float ,
199
200
endtime : UTCDateTime ,
200
201
detect_directory : str ,
201
202
save_waveforms : bool ,
@@ -211,6 +212,9 @@ def _handle_detections(
211
212
The party of new detections
212
213
trig_int
213
214
Minimum inter-detection time in seconds.
215
+ hypocentral_separation
216
+ Maximum inter-event distance in km to consider detections as being
217
+ duplicates.
214
218
endtime
215
219
Last detection-time to be kept.
216
220
detect_directory
@@ -231,11 +235,10 @@ def _handle_detections(
231
235
d ._calculate_event (template = family .template )
232
236
self .party += family
233
237
Logger .info ("Removing duplicate detections" )
234
- # TODO: Decluster on pick time? Find matching picks and calc median
235
- # pick time difference.
236
238
if len (self .party ) > 0 :
237
239
self .party .decluster (
238
- trig_int = trig_int , timing = "origin" , metric = "cor_sum" )
240
+ trig_int = trig_int , timing = "origin" , metric = "cor_sum" ,
241
+ hypocentral_separation = hypocentral_separation )
239
242
Logger .info ("Completed decluster" )
240
243
Logger .info ("Writing detections to disk" )
241
244
for family in self .party :
@@ -321,6 +324,7 @@ def run(
321
324
threshold : float ,
322
325
threshold_type : str ,
323
326
trig_int : float ,
327
+ hypocentral_separation : float = None ,
324
328
min_stations : int = None ,
325
329
keep_detections : float = 86400 ,
326
330
detect_directory : str = "{name}/detections" ,
@@ -349,6 +353,9 @@ def run(
349
353
`eqcorrscan.core.match_filter.Tribe.detect` for options.
350
354
trig_int
351
355
Minimum inter-detection time in seconds.
356
+ hypocentral_separation
357
+ Maximum inter-event distance in km to consider detections as being
358
+ duplicates.
352
359
min_stations
353
360
Minimum number of stations required to make a detection.
354
361
keep_detections
@@ -478,10 +485,11 @@ def run(
478
485
for tr in self .rt_client .stream .merge ()])
479
486
detection_kwargs = dict (
480
487
threshold = threshold , threshold_type = threshold_type ,
481
- trig_int = trig_int , keep_detections = keep_detections ,
482
- detect_directory = detect_directory , plot_detections = plot_detections ,
483
- save_waveforms = save_waveforms , maximum_backfill = first_data ,
484
- endtime = None , min_stations = min_stations )
488
+ trig_int = trig_int , hypocentral_separation = hypocentral_separation ,
489
+ keep_detections = keep_detections , detect_directory = detect_directory ,
490
+ plot_detections = plot_detections , save_waveforms = save_waveforms ,
491
+ maximum_backfill = first_data , endtime = None ,
492
+ min_stations = min_stations )
485
493
try :
486
494
while self .busy :
487
495
self ._running = True # Lock tribe
@@ -543,6 +551,7 @@ def run(
543
551
if len (new_party ) > 0 :
544
552
self ._handle_detections (
545
553
new_party , trig_int = trig_int ,
554
+ hypocentral_separation = hypocentral_separation ,
546
555
endtime = last_data - keep_detections ,
547
556
detect_directory = detect_directory ,
548
557
save_waveforms = save_waveforms ,
@@ -727,6 +736,7 @@ def backfill(
727
736
threshold : float ,
728
737
threshold_type : str ,
729
738
trig_int : float ,
739
+ hypocentral_separation : float = None ,
730
740
keep_detections : float = 86400 ,
731
741
detect_directory : str = "{name}/detections" ,
732
742
plot_detections : bool = True ,
@@ -752,6 +762,9 @@ def backfill(
752
762
`eqcorrscan.core.match_filter.Tribe.detect` for options.
753
763
trig_int
754
764
Minimum inter-detection time in seconds.
765
+ hypocentral_separation
766
+ Maximum inter-event distance in km to consider detections as being
767
+ duplicates.
755
768
keep_detections
756
769
Duration to store detection in memory for in seconds.
757
770
detect_directory
@@ -775,8 +788,8 @@ def backfill(
775
788
backfill_process = Process (
776
789
target = self ._backfill ,
777
790
args = (templates , threshold , threshold_type , trig_int ,
778
- keep_detections , detect_directory , plot_detections ,
779
- save_waveforms , maximum_backfill , endtime ),
791
+ hypocentral_separation , keep_detections , detect_directory ,
792
+ plot_detections , save_waveforms , maximum_backfill , endtime ),
780
793
kwargs = kwargs , name = f"Backfiller_{ self ._number_of_backfillers } " )
781
794
backfill_process .start ()
782
795
self ._backfillers .append (backfill_process )
@@ -787,6 +800,7 @@ def _backfill(
787
800
threshold : float ,
788
801
threshold_type : str ,
789
802
trig_int : float ,
803
+ hypocentral_separation : float = None ,
790
804
keep_detections : float = 86400 ,
791
805
detect_directory : str = "{name}/detections" ,
792
806
plot_detections : bool = True ,
@@ -848,13 +862,14 @@ def _backfill(
848
862
Logger .info ("Backfill detection completed - handling detections" )
849
863
if len (new_party ) > 0 :
850
864
Logger .info (f"Lock status: { self .lock } " )
851
- with self .lock : # The only time the state of RealTimeTribe is altered
865
+ with self .lock : # The only time the state is altered
852
866
Logger .info (f"Lock status: { self .lock } " )
853
867
self ._handle_detections (
854
868
new_party = new_party , detect_directory = detect_directory ,
855
869
endtime = endtime - keep_detections ,
856
- plot_detections = plot_detections , save_waveforms = save_waveforms ,
857
- st = st , trig_int = trig_int )
870
+ plot_detections = plot_detections ,
871
+ save_waveforms = save_waveforms , st = st , trig_int = trig_int ,
872
+ hypocentral_separation = hypocentral_separation )
858
873
return
859
874
860
875
def stop (self , write_stopfile : bool = False ) -> None :
0 commit comments