|
@@ 510-524 (lines=15) @@
|
| 507 |
|
self.alt_in[0], self.dtime, |
| 508 |
|
self.method) |
| 509 |
|
|
| 510 |
|
def test_get_aacgm_coord_arr_datetime_date(self): |
| 511 |
|
"""Test array AACGMV2 calculation with date and datetime input""" |
| 512 |
|
self.out = aacgmv2.get_aacgm_coord_arr(self.lat_in, self.lon_in, |
| 513 |
|
self.alt_in, self.ddate, |
| 514 |
|
self.method) |
| 515 |
|
self.ref = aacgmv2.get_aacgm_coord_arr(self.lat_in, self.lon_in, |
| 516 |
|
self.alt_in, self.dtime, |
| 517 |
|
self.method) |
| 518 |
|
|
| 519 |
|
assert len(self.out) == len(self.ref) |
| 520 |
|
assert [isinstance(oo, list) and len(oo) == len(self.lat_in) |
| 521 |
|
for oo in self.out] |
| 522 |
|
|
| 523 |
|
for i, oo in enumerate(self.out): |
| 524 |
|
np.testing.assert_allclose(oo, self.ref[i], rtol=self.rtol) |
| 525 |
|
|
| 526 |
|
def test_get_aacgm_coord_arr_maxalt_failure(self): |
| 527 |
|
"""test aacgm_coord_arr failure for an altitude too high for coeff""" |
|
@@ 421-433 (lines=13) @@
|
| 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""" |
| 423 |
|
self.out = aacgmv2.get_aacgm_coord_arr(np.array(self.lat_in), |
| 424 |
|
np.array(self.lon_in), |
| 425 |
|
np.array(self.alt_in), |
| 426 |
|
self.dtime, self.method) |
| 427 |
|
|
| 428 |
|
assert len(self.out) == len(self.ref) |
| 429 |
|
assert [isinstance(oo, list) and len(oo) == len(self.lat_in) |
| 430 |
|
for oo in self.out] |
| 431 |
|
|
| 432 |
|
for i, oo in enumerate(self.out): |
| 433 |
|
np.testing.assert_allclose(oo, self.ref[i], rtol=self.rtol) |
| 434 |
|
|
| 435 |
|
def test_get_aacgm_coord_arr_list_mix(self): |
| 436 |
|
"""Test array AACGMV2 calculation for a list and floats""" |