|
@@ 621-645 (lines=25) @@
|
| 618 |
|
np.testing.assert_almost_equal(self.mlon_out, 81.1761, decimal=4) |
| 619 |
|
np.testing.assert_almost_equal(self.mlt_out, 0.1889, decimal=4) |
| 620 |
|
|
| 621 |
|
def test_get_aacgm_coord_arr_arr(self): |
| 622 |
|
"""Test array AACGMV2 calculation for an array""" |
| 623 |
|
(self.mlat_out, self.mlon_out, |
| 624 |
|
self.mlt_out) = aacgmv2.get_aacgm_coord_arr(np.array([60, 61]), |
| 625 |
|
np.array([0, 0]), |
| 626 |
|
np.array([300, 300]), |
| 627 |
|
self.dtime) |
| 628 |
|
|
| 629 |
|
if not isinstance(self.mlat_out, np.ndarray): |
| 630 |
|
raise AssertionError() |
| 631 |
|
if not isinstance(self.mlon_out, np.ndarray): |
| 632 |
|
raise AssertionError() |
| 633 |
|
if not isinstance(self.mlt_out, np.ndarray): |
| 634 |
|
raise AssertionError() |
| 635 |
|
if not (self.mlt_out.shape == self.mlon_out.shape and |
| 636 |
|
self.mlat_out.shape == self.mlt_out.shape and |
| 637 |
|
self.mlt_out.shape == (2,)): |
| 638 |
|
raise AssertionError() |
| 639 |
|
|
| 640 |
|
np.testing.assert_allclose(self.mlat_out, |
| 641 |
|
[58.22474610, 59.31648007], rtol=1e-4) |
| 642 |
|
np.testing.assert_allclose(self.mlon_out, |
| 643 |
|
[81.17611033, 81.62281360], rtol=1e-4) |
| 644 |
|
np.testing.assert_allclose(self.mlt_out, |
| 645 |
|
[0.18891995, 0.21870017], rtol=1e-4) |
| 646 |
|
|
| 647 |
|
def test_get_aacgm_coord_arr_list_mix(self): |
| 648 |
|
"""Test array AACGMV2 calculation for a list and floats""" |
|
@@ 574-596 (lines=23) @@
|
| 571 |
|
np.testing.assert_allclose(self.mlon_out, [81.17611033], rtol=1e-4) |
| 572 |
|
np.testing.assert_allclose(self.mlt_out, [0.18891995], rtol=1e-4) |
| 573 |
|
|
| 574 |
|
def test_get_aacgm_coord_arr_list(self): |
| 575 |
|
"""Test array AACGMV2 calculation for list input""" |
| 576 |
|
(self.mlat_out, self.mlon_out, |
| 577 |
|
self.mlt_out) = aacgmv2.get_aacgm_coord_arr([60, 61], [0, 0], |
| 578 |
|
[300, 300], self.dtime) |
| 579 |
|
|
| 580 |
|
if not isinstance(self.mlat_out, np.ndarray): |
| 581 |
|
raise AssertionError() |
| 582 |
|
if not isinstance(self.mlon_out, np.ndarray): |
| 583 |
|
raise AssertionError() |
| 584 |
|
if not isinstance(self.mlt_out, np.ndarray): |
| 585 |
|
raise AssertionError() |
| 586 |
|
if not (self.mlt_out.shape == self.mlon_out.shape and |
| 587 |
|
self.mlat_out.shape == self.mlt_out.shape and |
| 588 |
|
self.mlt_out.shape == (2,)): |
| 589 |
|
raise AssertionError() |
| 590 |
|
|
| 591 |
|
np.testing.assert_allclose(self.mlat_out, |
| 592 |
|
[58.22474610, 59.31648007], rtol=1e-4) |
| 593 |
|
np.testing.assert_allclose(self.mlon_out, |
| 594 |
|
[81.17611033, 81.62281360], rtol=1e-4) |
| 595 |
|
np.testing.assert_allclose(self.mlt_out, |
| 596 |
|
[0.18891995, 0.21870017], rtol=1e-4) |
| 597 |
|
|
| 598 |
|
def test_get_aacgm_coord_arr_arr_single(self): |
| 599 |
|
"""Test array AACGMV2 calculation for array with a single value""" |
|
@@ 553-572 (lines=20) @@
|
| 550 |
|
np.testing.assert_allclose(self.mlon_out, [81.17611033], rtol=1e-4) |
| 551 |
|
np.testing.assert_allclose(self.mlt_out, [0.18891995], rtol=1e-4) |
| 552 |
|
|
| 553 |
|
def test_get_aacgm_coord_arr_list_single(self): |
| 554 |
|
"""Test array AACGMV2 calculation for list input of single values""" |
| 555 |
|
(self.mlat_out, self.mlon_out, |
| 556 |
|
self.mlt_out) = aacgmv2.get_aacgm_coord_arr([60], [0], [300], |
| 557 |
|
self.dtime) |
| 558 |
|
|
| 559 |
|
if not isinstance(self.mlat_out, np.ndarray): |
| 560 |
|
raise AssertionError() |
| 561 |
|
if not isinstance(self.mlon_out, np.ndarray): |
| 562 |
|
raise AssertionError() |
| 563 |
|
if not isinstance(self.mlt_out, np.ndarray): |
| 564 |
|
raise AssertionError() |
| 565 |
|
if not (self.mlt_out.shape == self.mlon_out.shape and |
| 566 |
|
self.mlat_out.shape == self.mlt_out.shape and |
| 567 |
|
self.mlt_out.shape == (1,)): |
| 568 |
|
raise AssertionError() |
| 569 |
|
|
| 570 |
|
np.testing.assert_allclose(self.mlat_out, [58.22474610], rtol=1e-4) |
| 571 |
|
np.testing.assert_allclose(self.mlon_out, [81.17611033], rtol=1e-4) |
| 572 |
|
np.testing.assert_allclose(self.mlt_out, [0.18891995], rtol=1e-4) |
| 573 |
|
|
| 574 |
|
def test_get_aacgm_coord_arr_list(self): |
| 575 |
|
"""Test array AACGMV2 calculation for list input""" |