From dbc5ca1fecf5bb8f1413d16646b121b4aa58afe4 Mon Sep 17 00:00:00 2001 From: "Karl N. Kappler" Date: Fri, 28 Jul 2023 17:26:10 -0700 Subject: [PATCH] Modify FDSN logic to acknowledge multiple channels There was a hardcoded assumption in get_inventory_from_df that only one valid value of channel instance should be added to the list of returned channels from a station. This is not only false in the case of wildcards (e.g. *F*, *Q*), it is also false when a channel has been broken into multiple runs. CAS04 is a good example of this. See mth5 issue #157, and aurora 277 for more details. --- mth5/clients/fdsn.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mth5/clients/fdsn.py b/mth5/clients/fdsn.py index 240ba185..a871528b 100644 --- a/mth5/clients/fdsn.py +++ b/mth5/clients/fdsn.py @@ -460,8 +460,12 @@ def get_inventory_from_df(self, df, client=None, data=True): channel=ch_row.channel, level="response", ) - returned_chan = cha_inv.networks[0].stations[0].channels[0] - returned_sta.channels.append(returned_chan) + # 2023-07-28: Try acknowledge multiple channel runs + # See issue mth5 issue #157 and aurora #277 + for returned_chan in cha_inv.networks[0].stations[0].channels: + returned_sta.channels.append(returned_chan) + #returned_chan = cha_inv.networks[0].stations[0].channels[0] + #returned_sta.channels.append(returned_chan) # ----------------------------- # get data if desired