Skip to content

Commit

Permalink
Disabling greedy channel-code matching
Browse files Browse the repository at this point in the history
  • Loading branch information
geojunky committed Jun 21, 2024
1 parent fc5ad3d commit de8d11a
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 4 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions seismic/ASDFdatabase/_FederatedASDFDataSetImpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand All @@ -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()
Expand Down
1 change: 1 addition & 0 deletions seismic/extract_event_traces.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit de8d11a

Please sign in to comment.