Graceful handling when refstrm in data but not parfile
Example: cf card dir has data from refstrm 1 and 9 as well as the usual SOH data, but maybe refstrm 9 was recorded in error (e.g., sensor does not have mass positions but RT130 was programmed to record them anyway). I run exploratory mode and then update the parfile to look like this:
das; refchan; refstrm; netcode; station; channel; samplerate; gain; implement_time
92BB; 1; 1; XX; TOMZ; HHZ; 100; 1; 2022-03-15T22:31:04.000000Z
92BB; 2; 1; XX; TOMZ; HH1; 100; 1; 2022-03-15T22:31:04.000000Z
92BB; 3; 1; XX; TOMZ; HH2; 100; 1; 2022-03-15T22:31:04.000000Z
(This is actually a station with a sensor that has mass position channels, but it's a recent cf card dir that I know will process.)
This processes as normal, but after it's done with refstrm 1, it looks like it still tries to process refstrm 9, with the following output:
2022-06-15 09:05:50 - INFO - Processing datastream number: 9
2022-06-15 09:05:50 - INFO - Processing data recorded in year 2022 and day 074
Traceback (most recent call last):
File "/home/ph51/anaconda3/envs/passoft3/bin/rt2ms", line 8, in <module>
sys.exit(main())
File "/home/ph51/anaconda3/envs/passoft3/lib/python3.8/site-packages/rt2ms_py3/rt2ms_py3.py", line 239, in main
rt130s.write_mseed(output_dir, unit_id, datastream,
File "/home/ph51/anaconda3/envs/passoft3/lib/python3.8/site-packages/rt2ms_py3/rt130_files.py", line 246, in write_mseed
parameters.get_params(rt130_file.unit_id,
File "/home/ph51/anaconda3/envs/passoft3/lib/python3.8/site-packages/rt2ms_py3/parameter_file.py", line 235, in get_params
params_time = implement_times[0]
IndexError: list index out of range
If a datastream is in the data but not the parfile, could rt2ms skip over it and say something like:
Processing datastream 9
ERROR (or WARNING) datastream 9 not in parfile, skipping. Please check the parfile is correct!
Then, rt2ms would continue processing any other RT130 data specified in the parfile.
Theoretically this scenario could happen with any refstrm, but I think it's most likely to happen with 9.
Known experiments affected: none, doesn't actually affect processing as far as I know, but current exit may be confusing to average user.
Requested tags: feature request, low priority. I am also OK with this issue being closed until a user reports a problem, and then reopened when the cycles are available.