From de8d11a049fed6f9a06747e2072120ea6e81a2aa Mon Sep 17 00:00:00 2001 From: Rakib Hassan Date: Fri, 21 Jun 2024 16:05:23 +1000 Subject: [PATCH] Disabling greedy channel-code matching --- {tutorial => legacy/tutorial}/ASDF_Federated_ASDF.ipynb | 0 {tutorial => legacy/tutorial}/__init__.py | 0 .../tutorial}/get_waveforms_from_fedasdf.py | 0 {tutorial => legacy/tutorial}/inspect_fasdf.py | 0 {tutorial => legacy/tutorial}/pbs_inspect_fasdf.sh | 0 seismic/ASDFdatabase/_FederatedASDFDataSetImpl.py | 8 ++++---- seismic/extract_event_traces.py | 1 + 7 files changed, 5 insertions(+), 4 deletions(-) rename {tutorial => legacy/tutorial}/ASDF_Federated_ASDF.ipynb (100%) rename {tutorial => legacy/tutorial}/__init__.py (100%) rename {tutorial => legacy/tutorial}/get_waveforms_from_fedasdf.py (100%) rename {tutorial => legacy/tutorial}/inspect_fasdf.py (100%) rename {tutorial => legacy/tutorial}/pbs_inspect_fasdf.sh (100%) diff --git a/tutorial/ASDF_Federated_ASDF.ipynb b/legacy/tutorial/ASDF_Federated_ASDF.ipynb similarity index 100% rename from tutorial/ASDF_Federated_ASDF.ipynb rename to legacy/tutorial/ASDF_Federated_ASDF.ipynb diff --git a/tutorial/__init__.py b/legacy/tutorial/__init__.py similarity index 100% rename from tutorial/__init__.py rename to legacy/tutorial/__init__.py diff --git a/tutorial/get_waveforms_from_fedasdf.py b/legacy/tutorial/get_waveforms_from_fedasdf.py similarity index 100% rename from tutorial/get_waveforms_from_fedasdf.py rename to legacy/tutorial/get_waveforms_from_fedasdf.py diff --git a/tutorial/inspect_fasdf.py b/legacy/tutorial/inspect_fasdf.py similarity index 100% rename from tutorial/inspect_fasdf.py rename to legacy/tutorial/inspect_fasdf.py diff --git a/tutorial/pbs_inspect_fasdf.sh b/legacy/tutorial/pbs_inspect_fasdf.sh similarity index 100% rename from tutorial/pbs_inspect_fasdf.sh rename to legacy/tutorial/pbs_inspect_fasdf.sh diff --git a/seismic/ASDFdatabase/_FederatedASDFDataSetImpl.py b/seismic/ASDFdatabase/_FederatedASDFDataSetImpl.py index bb02441e..fa6394ad 100644 --- a/seismic/ASDFdatabase/_FederatedASDFDataSetImpl.py +++ b/seismic/ASDFdatabase/_FederatedASDFDataSetImpl.py @@ -334,7 +334,7 @@ def decode_tag(tag, type='raw_recording'): self.comm.Barrier() if(dbFound): - print(('Found database: %s'%(self.db_fn))) + print('Found database: %s'%(self.db_fn)) self.conn = sqlite3.connect(self.db_fn, check_same_thread=self.single_threaded_access) else: @@ -393,7 +393,7 @@ def decode_tag(tag, type='raw_recording'): tagsCount = 0 for ids, ds in enumerate(self.asdf_datasets): - if(self.rank==0): print(('Indexing %s..' % (os.path.basename(self.asdf_file_names[ids])))) + if(self.rank==0): print('Indexing %s..' % (os.path.basename(self.asdf_file_names[ids]))) keys = list(ds.get_all_coordinates().keys()) keys = split_list(keys, self.nproc) @@ -420,8 +420,8 @@ def decode_tag(tag, type='raw_recording'): check_same_thread=self.single_threaded_access) self.conn.executemany('insert into wdb(ds_id, net, sta, loc, cha, st, et, tag) values ' '(?, ?, ?, ?, ?, ?, ?, ?)', data) - print(('\tInserted %d entries on rank %d'%(len(data), - self.rank))) + print('\tInserted %d entries on rank %d'%(len(data), + self.rank)) tagsCount += len(data) self.conn.commit() self.conn.close() diff --git a/seismic/extract_event_traces.py b/seismic/extract_event_traces.py index 9e596fc6..b29254eb 100644 --- a/seismic/extract_event_traces.py +++ b/seismic/extract_event_traces.py @@ -167,6 +167,7 @@ def asdf_get_waveforms(asdf_dataset, network, station, location, channel, startt matching_stations = asdf_dataset.get_stations(starttime, endtime, network=network, station=station, location=location) if matching_stations: + channel = channel.replace('?', '.') # replace greedy matching by single-character matching ch_matcher = re.compile(channel) for net, sta, loc, cha, _, _, _ in matching_stations: if ch_matcher.match(cha):