From 3f53ab4aa78e3ceaa4c0407be415025825efa857 Mon Sep 17 00:00:00 2001 From: pcain <pcain@usgs.gov> Date: Wed, 1 Sep 2021 10:19:48 -0600 Subject: [PATCH] Support location as data type for SNCL's --- geomagio/edge/LegacySNCL.py | 2 ++ geomagio/edge/SNCL.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/geomagio/edge/LegacySNCL.py b/geomagio/edge/LegacySNCL.py index 1b8cd2169..69527bd26 100644 --- a/geomagio/edge/LegacySNCL.py +++ b/geomagio/edge/LegacySNCL.py @@ -62,6 +62,8 @@ def get_channel(element: str, interval: str) -> str: def get_location(element: str, data_type: str) -> str: + if len(data_type) == 2 and data_type[0] in ["R", "A", "Q", "D"]: + return data_type return _get_location_start(data_type=data_type) + _get_location_end(element=element) diff --git a/geomagio/edge/SNCL.py b/geomagio/edge/SNCL.py index 8dc8a8e25..e5aec17d5 100644 --- a/geomagio/edge/SNCL.py +++ b/geomagio/edge/SNCL.py @@ -95,6 +95,8 @@ def get_channel(element: str, interval: str, data_type: str) -> str: def get_location(element: str, data_type: str) -> str: + if len(data_type) == 2 and data_type[0] in ["R", "A", "Q", "D"]: + return data_type return _get_location_start(data_type=data_type) + _get_location_end(element=element) @@ -166,7 +168,7 @@ def _get_channel_end(element: str, data_type: str) -> str: elif "_Temp" in element: channel_middle = "K" channel_end = element.split("_")[0] - if data_type == "variation": + if data_type in ["variation", "R0", "R1", "RD", "RQ", "RV"]: if channel_end == "H": channel_end = "U" elif channel_end == "E": -- GitLab