From 4fab9678443eb4a2b1ec5bed988e982a5d10c125 Mon Sep 17 00:00:00 2001
From: pcain <pcain@usgs.gov>
Date: Wed, 1 Sep 2021 12:02:13 -0600
Subject: [PATCH] custom locations, no mapping for custom locations

---
 geomagio/edge/LegacySNCL.py | 2 +-
 geomagio/edge/SNCL.py       | 4 ++--
 test/edge_test/SNCL_test.py | 8 ++++----
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/geomagio/edge/LegacySNCL.py b/geomagio/edge/LegacySNCL.py
index 69527bd26..f80b438a6 100644
--- a/geomagio/edge/LegacySNCL.py
+++ b/geomagio/edge/LegacySNCL.py
@@ -62,7 +62,7 @@ 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"]:
+    if len(data_type) == 2:
         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 e5aec17d5..003dcc7fc 100644
--- a/geomagio/edge/SNCL.py
+++ b/geomagio/edge/SNCL.py
@@ -95,7 +95,7 @@ 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"]:
+    if len(data_type) == 2:
         return data_type
     return _get_location_start(data_type=data_type) + _get_location_end(element=element)
 
@@ -168,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 in ["variation", "R0", "R1", "RD", "RQ", "RV"]:
+    if data_type in "variation":
         if channel_end == "H":
             channel_end = "U"
         elif channel_end == "E":
diff --git a/test/edge_test/SNCL_test.py b/test/edge_test/SNCL_test.py
index 1f963526b..0ce923683 100644
--- a/test/edge_test/SNCL_test.py
+++ b/test/edge_test/SNCL_test.py
@@ -121,11 +121,11 @@ def test_get_channel():
     assert get_channel(element="V", interval="hour", data_type="variation") == "RFV"
     assert get_channel(element="W", interval="hour", data_type="variation") == "RFW"
     assert get_channel(element="H", interval="hour", data_type="variation") == "RFU"
-    assert get_channel(element="H", interval="hour", data_type="R0") == "RFU"
+    assert get_channel(element="H", interval="hour", data_type="R0") == "RFH"
     assert get_channel(element="E", interval="hour", data_type="variation") == "RFV"
-    assert get_channel(element="E", interval="hour", data_type="R0") == "RFV"
+    assert get_channel(element="E", interval="hour", data_type="R0") == "RFE"
     assert get_channel(element="Z", interval="hour", data_type="variation") == "RFW"
-    assert get_channel(element="Z", interval="hour", data_type="R0") == "RFW"
+    assert get_channel(element="Z", interval="hour", data_type="R0") == "RFZ"
     # not variation data_type, test that H,Z is not converted to U,V
     assert get_channel(element="H", interval="hour", data_type="adjusted") == "RFH"
     assert get_channel(element="H", interval="hour", data_type="A0") == "RFH"
@@ -193,7 +193,7 @@ def test_get_sncl():
     ) == SNCL(station="BOU", network="NT", channel="LFU", location="R0")
     assert SNCL.get_sncl(
         station="BOU", data_type="R0", interval="second", element="H"
-    ) == SNCL(station="BOU", network="NT", channel="LFU", location="R0")
+    ) == SNCL(station="BOU", network="NT", channel="LFH", location="R0")
     assert SNCL.get_sncl(
         station="BOU", data_type="A0", interval="second", element="H"
     ) == SNCL(station="BOU", network="NT", channel="LFH", location="A0")
-- 
GitLab