[Bugfix]: Fix stationlist in TuneAutopicker dialog, partial fix of #266

Remove the channel from the station id
This commit is contained in:
Darius Arnold
2018-12-07 09:44:12 +01:00
parent 6a0c1dda9d
commit f1690edf71
2 changed files with 24 additions and 1 deletions
+15
View File
@@ -1219,6 +1219,21 @@ def check_event_folder(path):
return ev_type
def station_id_remove_channel(station_id):
"""
Remove the channel from a SEED station id and return Network.Station.Location.
>>> station_id_remove_channel("BW.MANZ..EHZ")
'BW.MANZ.'
>>> station_id_remove_channel("BW.MANZ.A.EHZ")
'BW.MANZ.A'
:param station_id:
:return: station id with channel removed
"""
# split at the last occuring dot and keep the left part
station_id = station_id.rpartition('.')[0]
return station_id
if __name__ == "__main__":
import doctest