|
@@ 397-409 (lines=13) @@
|
| 394 |
|
for i, oo in enumerate(self.out): |
| 395 |
|
np.testing.assert_allclose(oo, self.ref[i], rtol=self.rtol) |
| 396 |
|
|
| 397 |
|
def test_get_aacgm_coord_arr_arr_single(self): |
| 398 |
|
"""Test array AACGMV2 calculation for array with a single value""" |
| 399 |
|
self.out = aacgmv2.get_aacgm_coord_arr(np.array([self.lat_in[0]]), |
| 400 |
|
np.array([self.lon_in[0]]), |
| 401 |
|
np.array([self.alt_in[0]]), |
| 402 |
|
self.dtime, self.method) |
| 403 |
|
|
| 404 |
|
assert len(self.out) == len(self.ref) |
| 405 |
|
assert [isinstance(oo, np.ndarray) and len(oo) == 1 for oo in self.out] |
| 406 |
|
|
| 407 |
|
for i, oo in enumerate(self.out): |
| 408 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 409 |
|
|
| 410 |
|
def test_get_aacgm_coord_arr_arr(self): |
| 411 |
|
"""Test array AACGMV2 calculation for an array""" |
| 412 |
|
self.out = aacgmv2.get_aacgm_coord_arr(np.array(self.lat_in), |
|
@@ 371-382 (lines=12) @@
|
| 368 |
|
for i, oo in enumerate(self.out): |
| 369 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 370 |
|
|
| 371 |
|
def test_get_aacgm_coord_arr_list_single(self): |
| 372 |
|
"""Test array AACGMV2 calculation for list input of single values""" |
| 373 |
|
self.out = aacgmv2.get_aacgm_coord_arr([self.lat_in[0]], |
| 374 |
|
[self.lon_in[0]], |
| 375 |
|
[self.alt_in[0]], self.dtime, |
| 376 |
|
self.method) |
| 377 |
|
|
| 378 |
|
assert len(self.out) == len(self.ref) |
| 379 |
|
assert [isinstance(oo, np.ndarray) and len(oo) == 1 for oo in self.out] |
| 380 |
|
|
| 381 |
|
for i, oo in enumerate(self.out): |
| 382 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 383 |
|
|
| 384 |
|
def test_get_aacgm_coord_arr_list(self): |
| 385 |
|
"""Test array AACGMV2 calculation for list input""" |
|
@@ 139-150 (lines=12) @@
|
| 136 |
|
for i, oo in enumerate(self.out): |
| 137 |
|
np.testing.assert_allclose(oo, self.ref[i], rtol=self.rtol) |
| 138 |
|
|
| 139 |
|
def test_convert_latlon_arr_arr_single(self): |
| 140 |
|
"""Test array latlon conversion for array input of shape (1,)""" |
| 141 |
|
self.out = aacgmv2.convert_latlon_arr(np.array([self.lat_in[0]]), |
| 142 |
|
np.array([self.lon_in[0]]), |
| 143 |
|
np.array([self.alt_in[0]]), |
| 144 |
|
self.dtime, self.method) |
| 145 |
|
|
| 146 |
|
assert len(self.out) == len(self.ref) |
| 147 |
|
assert [isinstance(oo, np.ndarray) and len(oo) == 1 for oo in self.out] |
| 148 |
|
|
| 149 |
|
for i, oo in enumerate(self.out): |
| 150 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 151 |
|
|
| 152 |
|
def test_convert_latlon_arr_arr(self): |
| 153 |
|
"""Test array latlon conversion for array input""" |
|
@@ 113-124 (lines=12) @@
|
| 110 |
|
for i, oo in enumerate(self.out): |
| 111 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 112 |
|
|
| 113 |
|
def test_convert_latlon_arr_list_single(self): |
| 114 |
|
"""Test array latlon conversion for list input of single values""" |
| 115 |
|
self.out = aacgmv2.convert_latlon_arr([self.lat_in[0]], |
| 116 |
|
[self.lon_in[0]], |
| 117 |
|
[self.alt_in[0]], self.dtime, |
| 118 |
|
self.method) |
| 119 |
|
|
| 120 |
|
assert len(self.out) == len(self.ref) |
| 121 |
|
assert [isinstance(oo, np.ndarray) and len(oo) == 1 for oo in self.out] |
| 122 |
|
|
| 123 |
|
for i, oo in enumerate(self.out): |
| 124 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 125 |
|
|
| 126 |
|
def test_convert_latlon_arr_list(self): |
| 127 |
|
"""Test array latlon conversion for list input""" |