From 726fcefabce3f4302854ccf4d5739592427e858d Mon Sep 17 00:00:00 2001 From: JunhaoSong <42725077+JunhaoSong@users.noreply.github.com> Date: Tue, 26 Aug 2025 23:06:06 -0700 Subject: [PATCH] Add timestamp calculation to events catalog --- scripts/run_event_association.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/run_event_association.py b/scripts/run_event_association.py index e788f88..86970f0 100644 --- a/scripts/run_event_association.py +++ b/scripts/run_event_association.py @@ -408,11 +408,13 @@ def associate( "latitude": "median", "longitude": "median", "magnitude": "median", + "station_id": lambda x: ','.join(x) } ) .reset_index() ) events_catalog.rename(columns={"event_time": "time"}, inplace=True) + events_catalog["timestamp"] = events_catalog["time"].apply(lambda x: (x - timestamp0).total_seconds()) # drop event index -1 events_catalog = events_catalog[events_catalog['event_index'] != -1] events_catalog = events_catalog[events_catalog['event_score'] >= MIN_STATION//2]