|
@@ 580-594 (lines=15) @@
|
| 577 |
|
self.alt_in[0], self.dtime, |
| 578 |
|
self.method) |
| 579 |
|
|
| 580 |
|
def test_get_aacgm_coord_arr_datetime_date(self): |
| 581 |
|
"""Test array AACGMV2 calculation with date and datetime input""" |
| 582 |
|
self.out = aacgmv2.get_aacgm_coord_arr(self.lat_in, self.lon_in, |
| 583 |
|
self.alt_in, self.ddate, |
| 584 |
|
self.method) |
| 585 |
|
self.ref = aacgmv2.get_aacgm_coord_arr(self.lat_in, self.lon_in, |
| 586 |
|
self.alt_in, self.dtime, |
| 587 |
|
self.method) |
| 588 |
|
|
| 589 |
|
assert len(self.out) == len(self.ref) |
| 590 |
|
assert [isinstance(oo, np.ndarray) and len(oo) == len(self.lat_in) |
| 591 |
|
for oo in self.out] |
| 592 |
|
|
| 593 |
|
for i, oo in enumerate(self.out): |
| 594 |
|
np.testing.assert_allclose(oo, self.ref[i], rtol=self.rtol) |
| 595 |
|
|
| 596 |
|
def test_get_aacgm_coord_arr_maxalt_failure(self): |
| 597 |
|
"""test aacgm_coord_arr failure for an altitude too high for coeff""" |
|
@@ 491-503 (lines=13) @@
|
| 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""" |
| 493 |
|
self.out = aacgmv2.get_aacgm_coord_arr(np.array(self.lat_in), |
| 494 |
|
np.array(self.lon_in), |
| 495 |
|
np.array(self.alt_in), |
| 496 |
|
self.dtime, self.method) |
| 497 |
|
|
| 498 |
|
assert len(self.out) == len(self.ref) |
| 499 |
|
assert [isinstance(oo, np.ndarray) and len(oo) == len(self.lat_in) |
| 500 |
|
for oo in self.out] |
| 501 |
|
|
| 502 |
|
for i, oo in enumerate(self.out): |
| 503 |
|
np.testing.assert_allclose(oo, self.ref[i], rtol=self.rtol) |
| 504 |
|
|
| 505 |
|
def test_get_aacgm_coord_arr_list_mix(self): |
| 506 |
|
"""Test array AACGMV2 calculation for a list and floats""" |
|
@@ 226-238 (lines=13) @@
|
| 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""" |
| 228 |
|
self.out = aacgmv2.convert_latlon_arr(np.array(self.lat_in), |
| 229 |
|
np.array(self.lon_in), |
| 230 |
|
np.array(self.alt_in), |
| 231 |
|
self.dtime, self.method) |
| 232 |
|
|
| 233 |
|
assert len(self.out) == len(self.ref) |
| 234 |
|
assert [isinstance(oo, np.ndarray) and len(oo) == len(self.ref[i]) |
| 235 |
|
for i, oo in enumerate(self.out)] |
| 236 |
|
|
| 237 |
|
for i, oo in enumerate(self.out): |
| 238 |
|
np.testing.assert_allclose(oo, self.ref[i], rtol=self.rtol) |
| 239 |
|
|
| 240 |
|
def test_convert_latlon_arr_list_mix(self): |
| 241 |
|
"""Test array latlon conversion for mixed types with list""" |