|
@@ 197-206 (lines=10) @@
|
| 194 |
|
np.testing.assert_almost_equal(mlon, 57.7926, decimal=4) |
| 195 |
|
np.testing.assert_almost_equal(r, 1.1781, decimal=4) |
| 196 |
|
|
| 197 |
|
def test_convert_GEOCENTRIC_A2G_TRACE(self): |
| 198 |
|
"""Test convert from magnetic to geographic coordinates using trace""" |
| 199 |
|
code = aacgmv2._aacgmv2.A2G + aacgmv2._aacgmv2.TRACE + \ |
| 200 |
|
aacgmv2._aacgmv2.GEOCENTRIC |
| 201 |
|
aacgmv2._aacgmv2.set_datetime(*self.date1_args) |
| 202 |
|
mlat, mlon, r = aacgmv2._aacgmv2.convert(45.5, -23.5, 1135, code, |
| 203 |
|
aacgmv2.IGRF_12_COEFFS) |
| 204 |
|
np.testing.assert_almost_equal(mlat, 30.6211, decimal=4) |
| 205 |
|
np.testing.assert_almost_equal(mlon, -94.1809, decimal=4) |
| 206 |
|
np.testing.assert_almost_equal(r, 1135.0000, decimal=4) |
| 207 |
|
|
| 208 |
|
def test_forbidden(self): |
| 209 |
|
"""Test convert failure""" |
|
@@ 186-195 (lines=10) @@
|
| 183 |
|
np.testing.assert_almost_equal(mlon, -94.1806, decimal=4) |
| 184 |
|
np.testing.assert_almost_equal(r, 1135.0000, decimal=4) |
| 185 |
|
|
| 186 |
|
def test_convert_GEOCENTRIC_G2A_TRACE(self): |
| 187 |
|
"""Test convert from geographic to magnetic coordinates using trace""" |
| 188 |
|
code = aacgmv2._aacgmv2.G2A + aacgmv2._aacgmv2.TRACE + \ |
| 189 |
|
aacgmv2._aacgmv2.GEOCENTRIC |
| 190 |
|
aacgmv2._aacgmv2.set_datetime(*self.date1_args) |
| 191 |
|
mlat, mlon, r = aacgmv2._aacgmv2.convert(45.5, -23.5, 1135, code, |
| 192 |
|
aacgmv2.IGRF_12_COEFFS) |
| 193 |
|
np.testing.assert_almost_equal(mlat, 48.3830, decimal=4) |
| 194 |
|
np.testing.assert_almost_equal(mlon, 57.7926, decimal=4) |
| 195 |
|
np.testing.assert_almost_equal(r, 1.1781, decimal=4) |
| 196 |
|
|
| 197 |
|
def test_convert_GEOCENTRIC_A2G_TRACE(self): |
| 198 |
|
"""Test convert from magnetic to geographic coordinates using trace""" |