Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ghsc/geomag/geomag-algorithms
1 result
Show changes
Commits on Source (3)
......@@ -9,6 +9,11 @@ ELEMENT_CONVERSIONS = {
# derived indicies
"Dst3": "X3",
"Dst4": "X4",
# temperatures
"T1": "K1",
"T2": "K2",
"T3": "K3",
"T4": "K4",
}
CHANNEL_CONVERSIONS = {
......
......@@ -102,6 +102,38 @@ def test_element():
).element
== "U_Sat"
)
assert (
SNCL(
station="BOU",
channel="UK1",
location="R0",
).element
== "T1"
)
assert (
SNCL(
station="BOU",
channel="UK2",
location="R0",
).element
== "T2"
)
assert (
SNCL(
station="BOU",
channel="UK3",
location="R0",
).element
== "T3"
)
assert (
SNCL(
station="BOU",
channel="UK4",
location="R0",
).element
== "T4"
)
def test_get_channel():
......@@ -161,6 +193,10 @@ def test_get_channel():
assert (
get_channel(element="UK1.R0", interval="minute", data_type="variation") == "UK1"
)
assert get_channel(element="T1", interval="minute", data_type="variation") == "UK1"
assert get_channel(element="T2", interval="minute", data_type="variation") == "UK2"
assert get_channel(element="T3", interval="minute", data_type="variation") == "UK3"
assert get_channel(element="T4", interval="minute", data_type="variation") == "UK4"
def test_get_location():
......@@ -197,6 +233,9 @@ def test_get_sncl():
assert SNCL.get_sncl(
station="BOU", data_type="A0", interval="second", element="H"
) == SNCL(station="BOU", network="NT", channel="LFH", location="A0")
assert SNCL.get_sncl(
station="BOU", data_type="variation", interval="second", element="T1"
) == SNCL(station="BOU", network="NT", channel="LK1", location="R0")
def test_interval():
......@@ -241,6 +280,22 @@ def test_interval():
).interval
== "day"
)
assert (
SNCL(
station="BOU",
channel="UK1",
location="R0",
).interval
== "minute"
)
assert (
SNCL(
station="BOU",
channel="LK1",
location="R0",
).interval
== "second"
)
def test_parse_sncl():
......