diff --git a/rt_eqcorrscan/reactor/reactor.py b/rt_eqcorrscan/reactor/reactor.py index 294ee2b..32e59a3 100644 --- a/rt_eqcorrscan/reactor/reactor.py +++ b/rt_eqcorrscan/reactor/reactor.py @@ -7,6 +7,7 @@ import signal import subprocess import platform +import pickle from copy import deepcopy from typing import Callable, Union, List @@ -349,7 +350,9 @@ def spin_up(self, triggering_event: Event) -> None: return working_dir = _get_triggered_working_dir( triggering_event_id, exist_ok=True) - tribe.write(os.path.join(working_dir, "tribe.tgz")) + with open(os.path.join(working_dir, "tribe.pkl"), "wb") as f: + pickle.dump(tribe, f) + # tribe.write(os.path.join(working_dir, "tribe.tgz")) self.config.write( os.path.join(working_dir, 'rt_eqcorrscan_config.yml')) triggering_event.write( diff --git a/rt_eqcorrscan/reactor/spin_up.py b/rt_eqcorrscan/reactor/spin_up.py index 1c611c5..3f9b325 100644 --- a/rt_eqcorrscan/reactor/spin_up.py +++ b/rt_eqcorrscan/reactor/spin_up.py @@ -5,6 +5,7 @@ import os import logging +import pickle from collections import Counter from typing import List, Union @@ -14,8 +15,6 @@ from obspy.clients.fdsn.client import FDSNNoDataException from obspy.geodetics import locations2degrees, kilometer2degrees -from obsplus import WaveBank - from eqcorrscan import Tribe from rt_eqcorrscan import read_config, RealTimeTribe @@ -54,7 +53,9 @@ def run( Logger.debug(f"Triggered by {triggering_event}") min_stations = config.rt_match_filter.get("min_stations", None) Logger.info("Reading the Tribe") - tribe = Tribe().read("tribe.tgz") + with open("tribe.pkl", "rb") as f: + tribe = pickle.load(f) + # tribe = Tribe().read("tribe.tgz") # Remove file to avoid re-reading it os.remove("tribe.tgz")