|
@@ 407-419 (lines=13) @@
|
| 404 |
|
for i, oo in enumerate(self.out): |
| 405 |
|
np.testing.assert_allclose(oo, self.ref[i], rtol=self.rtol) |
| 406 |
|
|
| 407 |
|
def test_get_aacgm_coord_arr_arr_single(self): |
| 408 |
|
"""Test array AACGMV2 calculation for array with a single value""" |
| 409 |
|
self.out = aacgmv2.get_aacgm_coord_arr(np.array([self.lat_in[0]]), |
| 410 |
|
np.array([self.lon_in[0]]), |
| 411 |
|
np.array([self.alt_in[0]]), |
| 412 |
|
self.dtime, self.method) |
| 413 |
|
|
| 414 |
|
|
| 415 |
|
assert len(self.out) == len(self.ref) |
| 416 |
|
assert [isinstance(oo, np.ndarray) and len(oo) == 1 for oo in self.out] |
| 417 |
|
|
| 418 |
|
for i, oo in enumerate(self.out): |
| 419 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 420 |
|
|
| 421 |
|
def test_get_aacgm_coord_arr_arr(self): |
| 422 |
|
"""Test array AACGMV2 calculation for an array""" |
|
@@ 381-392 (lines=12) @@
|
| 378 |
|
for i, oo in enumerate(self.out): |
| 379 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 380 |
|
|
| 381 |
|
def test_get_aacgm_coord_arr_list_single(self): |
| 382 |
|
"""Test array AACGMV2 calculation for list input of single values""" |
| 383 |
|
self.out = aacgmv2.get_aacgm_coord_arr([self.lat_in[0]], |
| 384 |
|
[self.lon_in[0]], |
| 385 |
|
[self.alt_in[0]], self.dtime, |
| 386 |
|
self.method) |
| 387 |
|
|
| 388 |
|
assert len(self.out) == len(self.ref) |
| 389 |
|
assert [isinstance(oo, np.ndarray) and len(oo) == 1 for oo in self.out] |
| 390 |
|
|
| 391 |
|
for i, oo in enumerate(self.out): |
| 392 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 393 |
|
|
| 394 |
|
def test_get_aacgm_coord_arr_list(self): |
| 395 |
|
"""Test array AACGMV2 calculation for list input""" |
|
@@ 143-154 (lines=12) @@
|
| 140 |
|
for i, oo in enumerate(self.out): |
| 141 |
|
np.testing.assert_allclose(oo, self.ref[i], rtol=self.rtol) |
| 142 |
|
|
| 143 |
|
def test_convert_latlon_arr_arr_single(self): |
| 144 |
|
"""Test array latlon conversion for array input of shape (1,)""" |
| 145 |
|
self.out = aacgmv2.convert_latlon_arr(np.array([self.lat_in[0]]), |
| 146 |
|
np.array([self.lon_in[0]]), |
| 147 |
|
np.array([self.alt_in[0]]), |
| 148 |
|
self.dtime, self.method) |
| 149 |
|
|
| 150 |
|
assert len(self.out) == len(self.ref) |
| 151 |
|
assert [isinstance(oo, np.ndarray) and len(oo) == 1 for oo in self.out] |
| 152 |
|
|
| 153 |
|
for i, oo in enumerate(self.out): |
| 154 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 155 |
|
|
| 156 |
|
def test_convert_latlon_arr_arr(self): |
| 157 |
|
"""Test array latlon conversion for array input""" |
|
@@ 117-128 (lines=12) @@
|
| 114 |
|
for i, oo in enumerate(self.out): |
| 115 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 116 |
|
|
| 117 |
|
def test_convert_latlon_arr_list_single(self): |
| 118 |
|
"""Test array latlon conversion for list input of single values""" |
| 119 |
|
self.out = aacgmv2.convert_latlon_arr([self.lat_in[0]], |
| 120 |
|
[self.lon_in[0]], |
| 121 |
|
[self.alt_in[0]], self.dtime, |
| 122 |
|
self.method) |
| 123 |
|
|
| 124 |
|
assert len(self.out) == len(self.ref) |
| 125 |
|
assert [isinstance(oo, np.ndarray) and len(oo) == 1 for oo in self.out] |
| 126 |
|
|
| 127 |
|
for i, oo in enumerate(self.out): |
| 128 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 129 |
|
|
| 130 |
|
def test_convert_latlon_arr_list(self): |
| 131 |
|
"""Test array latlon conversion for list input""" |