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

Fix wrong station code extracted from log file

parent 9493f201
No related branches found
No related tags found
No related merge requests found
......@@ -253,8 +253,12 @@ class LogFileReader:
parser = PACKET_PARSERS[self.log_file_type]
eh_et_lines, soh_lines, masspos_lines = parser(packet)
if self.station_code is None and soh_lines:
# All header lines contain the station code at the end.
self.station_code = soh_lines[0].split(' ')[-1].strip()
split_packet_header = soh_lines[0].strip().split(' ')
possible_programs = ['logpeek:', 'SOHStationViewer:', 'rt2ms:']
# We want to skip the file header, which contains the program
# used to generate the file.
if split_packet_header[0] not in possible_programs:
self.station_code = split_packet_header[-1]
if self.experiment_number is None and soh_lines:
found_experiment_number = get_experiment_number(soh_lines)
self.experiment_number = found_experiment_number
......
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