|
@@ 82-100 (lines=19) @@
|
| 79 |
|
|
| 80 |
|
del lat_comp, lon_comp, r_comp |
| 81 |
|
|
| 82 |
|
def test_convert_A2G_coeff(self): |
| 83 |
|
"""Test convert from magnetic to geodetic coordinates""" |
| 84 |
|
lat_comp = [30.7534, 50.3910] |
| 85 |
|
lon_comp = [-94.1806, -77.7919] |
| 86 |
|
r_comp = [1133.6241, 305.7138] |
| 87 |
|
|
| 88 |
|
for i,darg in enumerate(self.date_args): |
| 89 |
|
aacgmv2._aacgmv2.set_datetime(*darg) |
| 90 |
|
(self.mlat, self.mlon, |
| 91 |
|
self.rshell) = aacgmv2._aacgmv2.convert(self.lat_in[i], |
| 92 |
|
self.lon_in[i], |
| 93 |
|
self.alt_in[i], |
| 94 |
|
aacgmv2._aacgmv2.A2G, |
| 95 |
|
aacgmv2.IGRF_12_COEFFS) |
| 96 |
|
np.testing.assert_almost_equal(self.mlat, lat_comp[i], decimal=4) |
| 97 |
|
np.testing.assert_almost_equal(self.mlon, lon_comp[i], decimal=4) |
| 98 |
|
np.testing.assert_almost_equal(self.rshell, r_comp[i], decimal=4) |
| 99 |
|
|
| 100 |
|
del lat_comp, lon_comp, r_comp |
| 101 |
|
|
| 102 |
|
def test_convert_G2A_TRACE(self): |
| 103 |
|
"""Test convert from geodetic to magnetic coordinates using trace""" |
|
@@ 62-80 (lines=19) @@
|
| 59 |
|
aacgmv2._aacgmv2.set_datetime(1013, 1, 1, 0, 0, 0, |
| 60 |
|
aacgmv2.AACGM_V2_DAT_PREFIX) |
| 61 |
|
|
| 62 |
|
def test_convert_G2A_coeff(self): |
| 63 |
|
"""Test convert from geographic to magnetic coordinates""" |
| 64 |
|
lat_comp = [48.1896, 58.1633] |
| 65 |
|
lon_comp = [57.7635, 81.0719] |
| 66 |
|
r_comp = [1.1775, 1.0457] |
| 67 |
|
|
| 68 |
|
for i,darg in enumerate(self.date_args): |
| 69 |
|
aacgmv2._aacgmv2.set_datetime(*darg) |
| 70 |
|
(self.mlat, self.mlon, |
| 71 |
|
self.rshell) = aacgmv2._aacgmv2.convert(self.lat_in[i], |
| 72 |
|
self.lon_in[i], |
| 73 |
|
self.alt_in[i], |
| 74 |
|
aacgmv2._aacgmv2.G2A, |
| 75 |
|
aacgmv2.IGRF_12_COEFFS) |
| 76 |
|
np.testing.assert_almost_equal(self.mlat, lat_comp[i], decimal=4) |
| 77 |
|
np.testing.assert_almost_equal(self.mlon, lon_comp[i], decimal=4) |
| 78 |
|
np.testing.assert_almost_equal(self.rshell, r_comp[i], decimal=4) |
| 79 |
|
|
| 80 |
|
del lat_comp, lon_comp, r_comp |
| 81 |
|
|
| 82 |
|
def test_convert_A2G_coeff(self): |
| 83 |
|
"""Test convert from magnetic to geodetic coordinates""" |