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

Handle log files with no SOH data

parent 1275d236
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !200. Comments created here will be created in the context of that merge request.
......@@ -267,6 +267,9 @@ class LogFileReader:
# used to generate the file.
if split_packet_header[0] not in possible_programs:
self.station_code = split_packet_header[-1]
if self.station_code is None and eh_et_lines:
# Each event info line stores the station code as second word
self.station_code = eh_et_lines[0].split()[1]
if self.experiment_number is None and soh_lines:
found_experiment_number = get_experiment_number(soh_lines)
self.experiment_number = found_experiment_number
......@@ -277,6 +280,10 @@ class LogFileReader:
# separate the SOH lines blocks during processing.
self.soh_lines.append('\n')
self.masspos_lines.extend(masspos_lines)
# In cases where there is no SOH data, we are going to assume that the
# experiment number is 0.
if self.experiment_number is None:
self.experiment_number = '0'
def process_mass_poss_line(masspos_lines: List[str]
......
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