|
@@ 620-638 (lines=19) @@
|
| 617 |
|
np.testing.assert_allclose(self.mlt_out, |
| 618 |
|
[0.18891995, 0.21870017], rtol=1e-4) |
| 619 |
|
|
| 620 |
|
def test_get_aacgm_coord_arr_arr_mix(self): |
| 621 |
|
"""Test array AACGMV2 calculation for an array and floats""" |
| 622 |
|
(self.mlat_out, self.mlon_out, |
| 623 |
|
self.mlt_out) = aacgmv2.get_aacgm_coord_arr(np.array([60, 61]), 0, |
| 624 |
|
300, self.dtime) |
| 625 |
|
|
| 626 |
|
assert isinstance(self.mlat_out, np.ndarray) |
| 627 |
|
assert isinstance(self.mlon_out, np.ndarray) |
| 628 |
|
assert isinstance(self.mlt_out, np.ndarray) |
| 629 |
|
assert (self.mlt_out.shape == self.mlon_out.shape and |
| 630 |
|
self.mlat_out.shape == self.mlt_out.shape and |
| 631 |
|
self.mlt_out.shape == (2,)) |
| 632 |
|
|
| 633 |
|
np.testing.assert_allclose(self.mlat_out, |
| 634 |
|
[58.22474610, 59.31648007], rtol=1e-4) |
| 635 |
|
np.testing.assert_allclose(self.mlon_out, |
| 636 |
|
[81.17611033, 81.62281360], rtol=1e-4) |
| 637 |
|
np.testing.assert_allclose(self.mlt_out, |
| 638 |
|
[0.18891995, 0.21870017], rtol=1e-4) |
| 639 |
|
|
| 640 |
|
def test_get_aacgm_coord_arr_mult_arr_mix(self): |
| 641 |
|
"""Test array AACGMV2 calculation for a multi-dim array and |
|
@@ 559-576 (lines=18) @@
|
| 556 |
|
np.testing.assert_allclose(self.mlt_out, |
| 557 |
|
[0.18891995, 0.21870017], rtol=1e-4) |
| 558 |
|
|
| 559 |
|
def test_get_aacgm_coord_arr_arr_single(self): |
| 560 |
|
"""Test array AACGMV2 calculation for array with a single value""" |
| 561 |
|
(self.mlat_out, self.mlon_out, |
| 562 |
|
self.mlt_out) = aacgmv2.get_aacgm_coord_arr(np.array([60]), |
| 563 |
|
np.array([0]), |
| 564 |
|
np.array([300]), |
| 565 |
|
self.dtime) |
| 566 |
|
|
| 567 |
|
assert isinstance(self.mlat_out, np.ndarray) |
| 568 |
|
assert isinstance(self.mlon_out, np.ndarray) |
| 569 |
|
assert isinstance(self.mlt_out, np.ndarray) |
| 570 |
|
assert (self.mlt_out.shape == self.mlon_out.shape and |
| 571 |
|
self.mlat_out.shape == self.mlt_out.shape and |
| 572 |
|
self.mlt_out.shape == (1,)) |
| 573 |
|
|
| 574 |
|
np.testing.assert_almost_equal(self.mlat_out, 58.2247, decimal=4) |
| 575 |
|
np.testing.assert_almost_equal(self.mlon_out, 81.1761, decimal=4) |
| 576 |
|
np.testing.assert_almost_equal(self.mlt_out, 0.1889, decimal=4) |
| 577 |
|
|
| 578 |
|
def test_get_aacgm_coord_arr_arr(self): |
| 579 |
|
"""Test array AACGMV2 calculation for an array""" |