Skip to content
Snippets Groups Projects
Commit bb055bf2 authored by Lan Dam's avatar Lan Dam
Browse files

unittest for reading 2 mseed folders

parent c5b654bc
No related branches found
No related tags found
1 merge request!122allow to select multi folder to load
Pipeline #2770 passed with stage
in 3 minutes and 3 seconds
...@@ -229,6 +229,32 @@ class TestMSeed(TestCase): ...@@ -229,6 +229,32 @@ class TestMSeed(TestCase):
self.assertEqual(len(obj.waveform_data['3203']['EL2']['tracesInfo']), self.assertEqual(len(obj.waveform_data['3203']['EL2']['tracesInfo']),
1) 1)
def test_select_2_folders(self):
# is_multiplex = True => the selected channel will be read
args = {
'data_type': 'Q330',
'is_multiplex': True,
'list_of_dir': [multiplex_data, blockettes_data],
'req_soh_chans': [],
'req_wf_chans': ['EL2'],
'gap_minimum': 60
}
obj = MSeed(**args)
self.assertEqual(list(obj.waveform_data.keys()), ['3203'])
self.assertEqual(list(obj.waveform_data['3203'].keys()), ['EL2'])
self.assertEqual(obj.waveform_data['3203']['EL2']['samplerate'], 200)
self.assertEqual(obj.waveform_data['3203']['EL2']['startTmEpoch'],
1671730004.3100293)
self.assertEqual(obj.waveform_data['3203']['EL2']['endTmEpoch'],
1671735657.9148998)
self.assertEqual(obj.waveform_data['3203']['EL2']['size'], 268576)
self.assertEqual(obj.waveform_data['3203']['EL2']['gaps'],
[[1671730720.5549, 1671735031.2799978]])
self.assertEqual(len(obj.waveform_data['3203']['EL2']['tracesInfo']),
1)
self.assertEqual(obj.gaps['3203'],
[[1671730720.5549, 1671735031.2799978]])
def test_existing_time_range(self): def test_existing_time_range(self):
# check if data_time is from the given range, end time may get # check if data_time is from the given range, end time may get
# a little greater than read_end according to record's end time # a little greater than read_end according to record's end time
......
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