|
@@ 296-311 (lines=16) @@
|
| 293 |
|
del dtime, soy, mlt_args_1, mlt_args_2, mlt_args_3, mlon_1, mlon_2 |
| 294 |
|
del mlon_3 |
| 295 |
|
|
| 296 |
|
def test_mlt_convert(self): |
| 297 |
|
"""Test MLT calculation with different longitudes""" |
| 298 |
|
mlt_args = list(self.long_date) |
| 299 |
|
mlt_args.extend([270.0]) |
| 300 |
|
self.mlt = aacgmv2._aacgmv2.mlt_convert(*mlt_args) |
| 301 |
|
np.testing.assert_almost_equal(self.mlt, 16.2395, decimal=4) |
| 302 |
|
|
| 303 |
|
mlt_args[-1] = 80.0 |
| 304 |
|
self.mlt = aacgmv2._aacgmv2.mlt_convert(*mlt_args) |
| 305 |
|
np.testing.assert_almost_equal(self.mlt, 3.5729, decimal=4) |
| 306 |
|
|
| 307 |
|
mlt_args[-1] = -90.0 |
| 308 |
|
self.mlt = aacgmv2._aacgmv2.mlt_convert(*mlt_args) |
| 309 |
|
np.testing.assert_almost_equal(self.mlt, 16.2395, decimal=4) |
| 310 |
|
|
| 311 |
|
del mlt_args |
| 312 |
|
|
| 313 |
|
def test_mlt_convert_yrsec(self): |
| 314 |
|
"""Test MLT calculation using year and seconds of year""" |
|
@@ 258-273 (lines=16) @@
|
| 255 |
|
with pytest.raises(RuntimeError): |
| 256 |
|
aacgmv2._aacgmv2.convert(7, 0, 0, aacgmv2._aacgmv2.G2A) |
| 257 |
|
|
| 258 |
|
def test_inv_mlt_convert(self): |
| 259 |
|
"""Test MLT inversion""" |
| 260 |
|
mlt_args = list(self.long_date) |
| 261 |
|
mlt_args.extend([12.0]) |
| 262 |
|
self.mlon = aacgmv2._aacgmv2.inv_mlt_convert(*mlt_args) |
| 263 |
|
np.testing.assert_almost_equal(self.mlon, -153.5931, decimal=4) |
| 264 |
|
|
| 265 |
|
mlt_args[-1] = 25.0 |
| 266 |
|
self.mlon = aacgmv2._aacgmv2.inv_mlt_convert(*mlt_args) |
| 267 |
|
np.testing.assert_almost_equal(self.mlon, 41.4069, decimal=4) |
| 268 |
|
|
| 269 |
|
mlt_args[-1] = -1.0 |
| 270 |
|
self.mlon = aacgmv2._aacgmv2.inv_mlt_convert(*mlt_args) |
| 271 |
|
np.testing.assert_almost_equal(self.mlon, 11.4069, decimal=4) |
| 272 |
|
|
| 273 |
|
del mlt_args |
| 274 |
|
|
| 275 |
|
def test_inv_mlt_convert_yrsec(self): |
| 276 |
|
"""Test MLT inversion with year and seconds of year""" |