A Python wrapper for AACGM-v2 magnetic coordinates
Project description
This is a Python wrapper for the AACGM-v2 C library, which allows converting between geographic and magnetic coordinates. The currently included version of the C library is 2.6. The package is free software (MIT license). When referencing this package, please cite both the package DOI and the AACGM-v2 journal article:
Shepherd, S. G. (2014), Altitude‐adjusted corrected geomagnetic coordinates: Definition and functional approximations, Journal of Geophysical Research: Space Physics, 119, 7501–7521, doi:10.1002/2014JA020264.
Quick start
Install (requires NumPy):
pip install aacgmv2
Convert between AACGM and geographic coordinates:
>>> import aacgmv2 >>> import datetime as dt >>> import numpy as np >>> np.set_printoptions(formatter={'float_kind': lambda x:'{:.4f}'.format(x)}) >>> # geo to AACGM, single numbers >>> dtime = dt.datetime(2013, 11, 3) >>> np.array(aacgmv2.get_aacgm_coord(60, 15, 300, dtime)) array([57.4736, 93.6111, 1.4816]) >>> # AACGM to geo, mix arrays/numbers >>> np.array2string(np.array(aacgmv2.convert_latlon_arr([90, -90], 0, 0, dtime, method_code="A2G"))).replace('\n', '') '[[82.9686 -74.3390] [-84.6501 125.8476] [14.1246 12.8772]]'
Convert between AACGM and MLT:
>>> import aacgmv2 >>> import datetime as dt >>> import numpy as np >>> np.set_printoptions(formatter={'float_kind': lambda x:'{:.4f}'.format(x)}) >>> # MLT to AACGM >>> dtime = dt.datetime(2013, 11, 3, 0, 0, 0) >>> np.array(aacgmv2.convert_mlt([1.4822189, 12], dtime, m2a=True)) array([93.6203, -108.6130])
If you don’t know or use Python, you can also use the command line. See details in the full documentation.
Documentation
Badges
docs |
|
---|---|
tests |
|
package |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file aacgmv2-2.6.3.tar.gz
.
File metadata
- Download URL: aacgmv2-2.6.3.tar.gz
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76fa1d616cabccd27a56dae65d0a76a18be0644380698e354e9fe415a7b44d0e |
|
MD5 | 91e0f79a10364f7f38b5e16c88bce381 |
|
BLAKE2b-256 | 118c906192eb4591e084057174e8b4493b09494b3da36d695fd3aa1ea41ad86b |
File details
Details for the file aacgmv2-2.6.3-cp39-cp39-macosx_11_0_x86_64.whl
.
File metadata
- Download URL: aacgmv2-2.6.3-cp39-cp39-macosx_11_0_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.9, macOS 11.0+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fc538ead1637419fad29dfa7c48ab7527c0319ae985fcba2a70d59a3ee313fb |
|
MD5 | 21bba5a2a0ff7b681f2d58c2623596c3 |
|
BLAKE2b-256 | 1c1f9cf9403f9bd8a8aaba0bd5d14f8f1e0201c4d8ad59d7736744f89c249638 |