|
@@ 441-453 (lines=13) @@
|
| 438 |
|
for i, oo in enumerate(self.out): |
| 439 |
|
np.testing.assert_allclose(oo, self.ref[i], rtol=self.rtol) |
| 440 |
|
|
| 441 |
|
def test_get_aacgm_coord_arr_arr_single(self): |
| 442 |
|
"""Test array AACGMV2 calculation for array with a single value""" |
| 443 |
|
self.out = aacgmv2.get_aacgm_coord_arr(np.array([self.lat_in[0]]), |
| 444 |
|
np.array([self.lon_in[0]]), |
| 445 |
|
np.array([self.alt_in[0]]), |
| 446 |
|
self.dtime, self.method) |
| 447 |
|
|
| 448 |
|
|
| 449 |
|
assert len(self.out) == len(self.ref) |
| 450 |
|
assert [isinstance(oo, np.ndarray) and len(oo) == 1 for oo in self.out] |
| 451 |
|
|
| 452 |
|
for i, oo in enumerate(self.out): |
| 453 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 454 |
|
|
| 455 |
|
def test_get_aacgm_coord_arr_arr(self): |
| 456 |
|
"""Test array AACGMV2 calculation for an array""" |
|
@@ 415-426 (lines=12) @@
|
| 412 |
|
for i, oo in enumerate(self.out): |
| 413 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 414 |
|
|
| 415 |
|
def test_get_aacgm_coord_arr_list_single(self): |
| 416 |
|
"""Test array AACGMV2 calculation for list input of single values""" |
| 417 |
|
self.out = aacgmv2.get_aacgm_coord_arr([self.lat_in[0]], |
| 418 |
|
[self.lon_in[0]], |
| 419 |
|
[self.alt_in[0]], self.dtime, |
| 420 |
|
self.method) |
| 421 |
|
|
| 422 |
|
assert len(self.out) == len(self.ref) |
| 423 |
|
assert [isinstance(oo, np.ndarray) and len(oo) == 1 for oo in self.out] |
| 424 |
|
|
| 425 |
|
for i, oo in enumerate(self.out): |
| 426 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 427 |
|
|
| 428 |
|
def test_get_aacgm_coord_arr_list(self): |
| 429 |
|
"""Test array AACGMV2 calculation for list input""" |
|
@@ 201-212 (lines=12) @@
|
| 198 |
|
for i, oo in enumerate(self.out): |
| 199 |
|
np.testing.assert_allclose(oo, self.ref[i], rtol=self.rtol) |
| 200 |
|
|
| 201 |
|
def test_convert_latlon_arr_arr_single(self): |
| 202 |
|
"""Test array latlon conversion for array input of shape (1,)""" |
| 203 |
|
self.out = aacgmv2.convert_latlon_arr(np.array([self.lat_in[0]]), |
| 204 |
|
np.array([self.lon_in[0]]), |
| 205 |
|
np.array([self.alt_in[0]]), |
| 206 |
|
self.dtime, self.method) |
| 207 |
|
|
| 208 |
|
assert len(self.out) == len(self.ref) |
| 209 |
|
assert [isinstance(oo, np.ndarray) and len(oo) == 1 for oo in self.out] |
| 210 |
|
|
| 211 |
|
for i, oo in enumerate(self.out): |
| 212 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 213 |
|
|
| 214 |
|
def test_convert_latlon_arr_arr(self): |
| 215 |
|
"""Test array latlon conversion for array input""" |
|
@@ 175-186 (lines=12) @@
|
| 172 |
|
for i, oo in enumerate(self.out): |
| 173 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 174 |
|
|
| 175 |
|
def test_convert_latlon_arr_list_single(self): |
| 176 |
|
"""Test array latlon conversion for list input of single values""" |
| 177 |
|
self.out = aacgmv2.convert_latlon_arr([self.lat_in[0]], |
| 178 |
|
[self.lon_in[0]], |
| 179 |
|
[self.alt_in[0]], self.dtime, |
| 180 |
|
self.method) |
| 181 |
|
|
| 182 |
|
assert len(self.out) == len(self.ref) |
| 183 |
|
assert [isinstance(oo, np.ndarray) and len(oo) == 1 for oo in self.out] |
| 184 |
|
|
| 185 |
|
for i, oo in enumerate(self.out): |
| 186 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 187 |
|
|
| 188 |
|
def test_convert_latlon_arr_list(self): |
| 189 |
|
"""Test array latlon conversion for list input""" |