|
@@ 69-86 (lines=18) @@
|
| 66 |
|
|
| 67 |
|
del lat_comp, lon_comp, r_comp |
| 68 |
|
|
| 69 |
|
def test_convert_A2G_coeff(self): |
| 70 |
|
"""Test convert from magnetic to geodetic coordinates""" |
| 71 |
|
lat_comp = [30.7534, 50.3910] |
| 72 |
|
lon_comp = [-94.1806, -77.7919] |
| 73 |
|
r_comp = [1133.6241, 305.7138] |
| 74 |
|
|
| 75 |
|
for i,darg in enumerate(self.date_args): |
| 76 |
|
aacgmv2._aacgmv2.set_datetime(*darg) |
| 77 |
|
(self.mlat, self.mlon, |
| 78 |
|
self.rshell) = aacgmv2._aacgmv2.convert(self.lat_in[i], |
| 79 |
|
self.lon_in[i], |
| 80 |
|
self.alt_in[i], |
| 81 |
|
aacgmv2._aacgmv2.A2G) |
| 82 |
|
np.testing.assert_almost_equal(self.mlat, lat_comp[i], decimal=4) |
| 83 |
|
np.testing.assert_almost_equal(self.mlon, lon_comp[i], decimal=4) |
| 84 |
|
np.testing.assert_almost_equal(self.rshell, r_comp[i], decimal=4) |
| 85 |
|
|
| 86 |
|
del lat_comp, lon_comp, r_comp |
| 87 |
|
|
| 88 |
|
def test_convert_G2A_TRACE(self): |
| 89 |
|
"""Test convert from geodetic to magnetic coordinates using trace""" |
|
@@ 50-67 (lines=18) @@
|
| 47 |
|
with pytest.raises(RuntimeError): |
| 48 |
|
aacgmv2._aacgmv2.set_datetime(1013, 1, 1, 0, 0, 0) |
| 49 |
|
|
| 50 |
|
def test_convert_G2A_coeff(self): |
| 51 |
|
"""Test convert from geographic to magnetic coordinates""" |
| 52 |
|
lat_comp = [48.1896, 58.1633] |
| 53 |
|
lon_comp = [57.7635, 81.0719] |
| 54 |
|
r_comp = [1.1775, 1.0457] |
| 55 |
|
|
| 56 |
|
for i,darg in enumerate(self.date_args): |
| 57 |
|
aacgmv2._aacgmv2.set_datetime(*darg) |
| 58 |
|
(self.mlat, self.mlon, |
| 59 |
|
self.rshell) = aacgmv2._aacgmv2.convert(self.lat_in[i], |
| 60 |
|
self.lon_in[i], |
| 61 |
|
self.alt_in[i], |
| 62 |
|
aacgmv2._aacgmv2.G2A) |
| 63 |
|
np.testing.assert_almost_equal(self.mlat, lat_comp[i], decimal=4) |
| 64 |
|
np.testing.assert_almost_equal(self.mlon, lon_comp[i], decimal=4) |
| 65 |
|
np.testing.assert_almost_equal(self.rshell, r_comp[i], decimal=4) |
| 66 |
|
|
| 67 |
|
del lat_comp, lon_comp, r_comp |
| 68 |
|
|
| 69 |
|
def test_convert_A2G_coeff(self): |
| 70 |
|
"""Test convert from magnetic to geodetic coordinates""" |