|
@@ 477-489 (lines=13) @@
|
| 474 |
|
for i, oo in enumerate(self.out): |
| 475 |
|
np.testing.assert_allclose(oo, self.ref[i], rtol=self.rtol) |
| 476 |
|
|
| 477 |
|
def test_get_aacgm_coord_arr_arr_single(self): |
| 478 |
|
"""Test array AACGMV2 calculation for array with a single value""" |
| 479 |
|
self.out = aacgmv2.get_aacgm_coord_arr(np.array([self.lat_in[0]]), |
| 480 |
|
np.array([self.lon_in[0]]), |
| 481 |
|
np.array([self.alt_in[0]]), |
| 482 |
|
self.dtime, self.method) |
| 483 |
|
|
| 484 |
|
|
| 485 |
|
assert len(self.out) == len(self.ref) |
| 486 |
|
assert [isinstance(oo, np.ndarray) and len(oo) == 1 for oo in self.out] |
| 487 |
|
|
| 488 |
|
for i, oo in enumerate(self.out): |
| 489 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 490 |
|
|
| 491 |
|
def test_get_aacgm_coord_arr_arr(self): |
| 492 |
|
"""Test array AACGMV2 calculation for an array""" |
|
@@ 451-462 (lines=12) @@
|
| 448 |
|
for i, oo in enumerate(self.out): |
| 449 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 450 |
|
|
| 451 |
|
def test_get_aacgm_coord_arr_list_single(self): |
| 452 |
|
"""Test array AACGMV2 calculation for list input of single values""" |
| 453 |
|
self.out = aacgmv2.get_aacgm_coord_arr([self.lat_in[0]], |
| 454 |
|
[self.lon_in[0]], |
| 455 |
|
[self.alt_in[0]], self.dtime, |
| 456 |
|
self.method) |
| 457 |
|
|
| 458 |
|
assert len(self.out) == len(self.ref) |
| 459 |
|
assert [isinstance(oo, np.ndarray) and len(oo) == 1 for oo in self.out] |
| 460 |
|
|
| 461 |
|
for i, oo in enumerate(self.out): |
| 462 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 463 |
|
|
| 464 |
|
def test_get_aacgm_coord_arr_list(self): |
| 465 |
|
"""Test array AACGMV2 calculation for list input""" |
|
@@ 213-224 (lines=12) @@
|
| 210 |
|
for i, oo in enumerate(self.out): |
| 211 |
|
np.testing.assert_allclose(oo, self.ref[i], rtol=self.rtol) |
| 212 |
|
|
| 213 |
|
def test_convert_latlon_arr_arr_single(self): |
| 214 |
|
"""Test array latlon conversion for array input of shape (1,)""" |
| 215 |
|
self.out = aacgmv2.convert_latlon_arr(np.array([self.lat_in[0]]), |
| 216 |
|
np.array([self.lon_in[0]]), |
| 217 |
|
np.array([self.alt_in[0]]), |
| 218 |
|
self.dtime, self.method) |
| 219 |
|
|
| 220 |
|
assert len(self.out) == len(self.ref) |
| 221 |
|
assert [isinstance(oo, np.ndarray) and len(oo) == 1 for oo in self.out] |
| 222 |
|
|
| 223 |
|
for i, oo in enumerate(self.out): |
| 224 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 225 |
|
|
| 226 |
|
def test_convert_latlon_arr_arr(self): |
| 227 |
|
"""Test array latlon conversion for array input""" |
|
@@ 187-198 (lines=12) @@
|
| 184 |
|
for i, oo in enumerate(self.out): |
| 185 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 186 |
|
|
| 187 |
|
def test_convert_latlon_arr_list_single(self): |
| 188 |
|
"""Test array latlon conversion for list input of single values""" |
| 189 |
|
self.out = aacgmv2.convert_latlon_arr([self.lat_in[0]], |
| 190 |
|
[self.lon_in[0]], |
| 191 |
|
[self.alt_in[0]], self.dtime, |
| 192 |
|
self.method) |
| 193 |
|
|
| 194 |
|
assert len(self.out) == len(self.ref) |
| 195 |
|
assert [isinstance(oo, np.ndarray) and len(oo) == 1 for oo in self.out] |
| 196 |
|
|
| 197 |
|
for i, oo in enumerate(self.out): |
| 198 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 199 |
|
|
| 200 |
|
def test_convert_latlon_arr_list(self): |
| 201 |
|
"""Test array latlon conversion for list input""" |