[BUG] ph5tostationxml generates xml with incorrect response information for ph5 with multiple instrument gains
https://github.com/PIC-IRIS/PH5/issues/528
BUG: When requesting a response-level stationXML across multiple arrays from a ph5 with SmartSolos using two different gains, ph5tostationxml will generate a stationXML with identical response information for all instruments, regardless of gain setting.
The response information in the output stationXML is consistent with the gain settings for the instruments in the lowest numbered array requested, regardless of the order they are requested within the command line, ie ph5tostationxml -n master.ph5 -a 001,002 --level=response ... and ph5tostationxml -n master.ph5 -a 002,003 --level=response ... Will produce identical stationXMLs with response information from array 001 applied to all channels in the in the file.
Similarly, ph5tostationxml -n master.ph5 -a 002,003 --level=response ... will generate a stationXML with response information from array 002 applied to all stations/channels in arrays 002 and 003, regardless of the true gain settings of each station/channel.
Requesting stationXMLs for each array individually (assuming--as is the SoP for PIC ph5 archives--that all station/channels within each array are set to the same gain setting) produces stationXMLs with correct responses.
Desired Behaviour: At a minimum, ph5tostationxml should be able to generate a response-level stationXML with correct response information across multiple arrays for archives with consistent sensor-types, but different gain settings in cases where gains are consistent within arrays, but not across the entire archive.
Ideally, a requested stationXML should be able handle mixed gain settings within a single array, however since splitting stations with distinct gains in to different arrays is SoP for PIC projects at current time, ability to return correct responses for mixed-gains within a single array is a lower-priority goal.
Archives with mixed-gain arrays (and stations/id_s) exist in archive at current. So fix should be able to handle this.
To Reproduce: Commands are listed above. This bug was generated from the ph5 for 24-004 in which arrays 001,003,005,006 are smartsolos set to 36db and arrays 002,004 are smartsolos set to 18db
Other: Not tested or addressed here, but this should also be tested for archives with varied sample rates between channels/arrays.