Skip to content

Commit

Permalink
_add further test for a multidim f_GHz xr.DataArray
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmargraf committed Nov 9, 2023
1 parent 1680ef7 commit 187acb3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions pycomlink/tests/test_k_R_relation.py
Expand Up @@ -120,6 +120,29 @@ def test_with_f_GHz_pol_xarray(self):
expected_b,
calculated_b,
)
def test_with_f_GHz_mulidim_xarray(self):
A = 5
L_km = 5
A, Z = np.array(["A", "Z"]).view("int32")
cml_ids = np.random.randint(low=A, high=Z, size=198 * 4,
dtype="int32").view(f"U{4}")
f_GHz = xr.DataArray(
data=[np.arange(1, 100, 0.5)],
dims=['sublin_id', 'cml_id'],
coords=dict(
sublink_id='sublink_1',
cml_id=cml_ids, ))
pol = "H"
expected_a, expected_b = k_R_relation.a_b(f_GHz, pol, approx_type="ITU_2005")

assert_almost_equal(
expected_a.sum(),
128.67885799,
)
assert_almost_equal(
expected_b.sum(),
175.58906864,
)

def test_interpolation(self):
f_GHz = np.array([1.7, 28.9, 82.1])
Expand Down

0 comments on commit 187acb3

Please sign in to comment.