Skip to content
Snippets Groups Projects
Commit 6f4a491e authored by Kien Le's avatar Kien Le
Browse files

Fix problem with detecting data type

We are currently skipping waveform files by inspecting the name of the
file. However, for some Centaur and Pegasus data sets whose station name
match a pattern used to filter waveform files, all their files are
skipped. We fix this problem by moving the check for waveform files.

(cherry picked from commit 41a9988b)
parent aff962db
No related branches found
No related tags found
1 merge request!172Fix problem with detecting data type
Pipeline #2958 passed with stage
in 3 minutes and 17 seconds
...@@ -268,10 +268,6 @@ def get_data_type_from_file( ...@@ -268,10 +268,6 @@ def get_data_type_from_file(
'VP', 'VL', 'VL', 'VH', 'VP', 'VL', 'VL', 'VH',
'UN', 'UP', 'UL', 'UH'] 'UN', 'UP', 'UL', 'UH']
if any(x in path2file.name for x in wf_chan_posibilities):
# Skip checking waveform files which aren't signature channels
return None, False
file = open(path2file, 'rb') file = open(path2file, 'rb')
chans_in_stream = set() chans_in_stream = set()
data_type = None data_type = None
...@@ -290,6 +286,9 @@ def get_data_type_from_file( ...@@ -290,6 +286,9 @@ def get_data_type_from_file(
return return
chan = record.record_metadata.channel chan = record.record_metadata.channel
if any([wf_pattern in chan for wf_pattern in wf_chan_posibilities]):
# Skip checking waveform files which aren't signature channels
return None, False
if is_multiplex is None: if is_multiplex is None:
chans_in_stream.add(chan) chans_in_stream.add(chan)
if len(chans_in_stream) > 1: if len(chans_in_stream) > 1:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment