|
@@ 501-515 (lines=15) @@
|
| 498 |
|
self.alt_in[0], self.dtime, |
| 499 |
|
self.method) |
| 500 |
|
|
| 501 |
|
def test_get_aacgm_coord_arr_datetime_date(self): |
| 502 |
|
"""Test array AACGMV2 calculation with date and datetime input""" |
| 503 |
|
self.out = aacgmv2.get_aacgm_coord_arr(self.lat_in, self.lon_in, |
| 504 |
|
self.alt_in, self.ddate, |
| 505 |
|
self.method) |
| 506 |
|
self.ref = aacgmv2.get_aacgm_coord_arr(self.lat_in, self.lon_in, |
| 507 |
|
self.alt_in, self.dtime, |
| 508 |
|
self.method) |
| 509 |
|
|
| 510 |
|
assert len(self.out) == len(self.ref) |
| 511 |
|
assert [isinstance(oo, list) and len(oo) == len(self.lat_in) |
| 512 |
|
for oo in self.out] |
| 513 |
|
|
| 514 |
|
for i, oo in enumerate(self.out): |
| 515 |
|
np.testing.assert_allclose(oo, self.ref[i], rtol=self.rtol) |
| 516 |
|
|
| 517 |
|
def test_get_aacgm_coord_arr_maxalt_failure(self): |
| 518 |
|
"""test aacgm_coord_arr failure for an altitude too high for coeff""" |
|
@@ 414-426 (lines=13) @@
|
| 411 |
|
for i, oo in enumerate(self.out): |
| 412 |
|
np.testing.assert_allclose(oo, [self.ref[i][0]], rtol=self.rtol) |
| 413 |
|
|
| 414 |
|
def test_get_aacgm_coord_arr_arr(self): |
| 415 |
|
"""Test array AACGMV2 calculation for an array""" |
| 416 |
|
self.out = aacgmv2.get_aacgm_coord_arr(np.array(self.lat_in), |
| 417 |
|
np.array(self.lon_in), |
| 418 |
|
np.array(self.alt_in), |
| 419 |
|
self.dtime, self.method) |
| 420 |
|
|
| 421 |
|
assert len(self.out) == len(self.ref) |
| 422 |
|
assert [isinstance(oo, list) and len(oo) == len(self.lat_in) |
| 423 |
|
for oo in self.out] |
| 424 |
|
|
| 425 |
|
for i, oo in enumerate(self.out): |
| 426 |
|
np.testing.assert_allclose(oo, self.ref[i], rtol=self.rtol) |
| 427 |
|
|
| 428 |
|
def test_get_aacgm_coord_arr_list_mix(self): |
| 429 |
|
"""Test array AACGMV2 calculation for a list and floats""" |