|
@@ 275-290 (lines=16) @@
|
| 272 |
|
del dtime, soy, mlt_args_1, mlt_args_2, mlt_args_3, mlon_1, mlon_2 |
| 273 |
|
del mlon_3 |
| 274 |
|
|
| 275 |
|
def test_mlt_convert(self): |
| 276 |
|
"""Test MLT calculation with different longitudes""" |
| 277 |
|
mlt_args = list(self.long_date) |
| 278 |
|
mlt_args.extend([270.0]) |
| 279 |
|
self.mlt = aacgmv2._aacgmv2.mlt_convert(*mlt_args) |
| 280 |
|
np.testing.assert_almost_equal(self.mlt, 16.2395, decimal=4) |
| 281 |
|
|
| 282 |
|
mlt_args[-1] = 80.0 |
| 283 |
|
self.mlt = aacgmv2._aacgmv2.mlt_convert(*mlt_args) |
| 284 |
|
np.testing.assert_almost_equal(self.mlt, 3.5729, decimal=4) |
| 285 |
|
|
| 286 |
|
mlt_args[-1] = -90.0 |
| 287 |
|
self.mlt = aacgmv2._aacgmv2.mlt_convert(*mlt_args) |
| 288 |
|
np.testing.assert_almost_equal(self.mlt, 16.2395, decimal=4) |
| 289 |
|
|
| 290 |
|
del mlt_args |
| 291 |
|
|
| 292 |
|
def test_mlt_convert_yrsec(self): |
| 293 |
|
"""Test MLT calculation using year and seconds of year""" |
|
@@ 236-251 (lines=16) @@
|
| 233 |
|
with pytest.raises(RuntimeError): |
| 234 |
|
aacgmv2._aacgmv2.convert(7, 0, 0, aacgmv2._aacgmv2.G2A) |
| 235 |
|
|
| 236 |
|
def test_inv_mlt_convert(self): |
| 237 |
|
"""Test MLT inversion""" |
| 238 |
|
mlt_args = list(self.long_date) |
| 239 |
|
mlt_args.extend([12.0]) |
| 240 |
|
self.mlon = aacgmv2._aacgmv2.inv_mlt_convert(*mlt_args) |
| 241 |
|
np.testing.assert_almost_equal(self.mlon, -153.5931, decimal=4) |
| 242 |
|
|
| 243 |
|
mlt_args[-1] = 25.0 |
| 244 |
|
self.mlon = aacgmv2._aacgmv2.inv_mlt_convert(*mlt_args) |
| 245 |
|
np.testing.assert_almost_equal(self.mlon, 41.4069, decimal=4) |
| 246 |
|
|
| 247 |
|
mlt_args[-1] = -1.0 |
| 248 |
|
self.mlon = aacgmv2._aacgmv2.inv_mlt_convert(*mlt_args) |
| 249 |
|
np.testing.assert_almost_equal(self.mlon, 11.4069, decimal=4) |
| 250 |
|
|
| 251 |
|
del mlt_args |
| 252 |
|
|
| 253 |
|
def test_inv_mlt_convert_yrsec(self): |
| 254 |
|
"""Test MLT inversion with year and seconds of year""" |