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.4. The package is free software (MIT license).
Quick start
Install (requires NumPy and logging):
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.4698, 93.6300, 1.4822]) >>> # AACGM to geo, mix arrays/numbers >>> aacgmv2.convert_latlon_arr([90, -90], 0, 0, dtime, code="A2G") (array([82.9666, -74.3385]), array([-84.6652, 125.8401]), array([14.1244, 12.8771]))
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) >>> aacgmv2.convert_mlt([1.4822189, 12], dtime, m2a=True) array([93.6300, -108.6033])
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 |
Changelog
2.4.0 (2017-03-21)
Update to use AACGM-v2.4, which includes changes to the inverse MLT and dipole tilt functions and some minor bug fixes
Updated file structure
Updated methods, retaining old methods in deprecated module
Added testing for python 3.6
Updated dependencies, removing support for python 3.3
Tested on Mac OSX
Updated comments to include units for input and output
2.0.0 (2016-11-03)
Change method of calculating MLT, see documentation of convert_mlt for details
1.0.13 (2015-10-30)
Correctly convert output of subsol() to geodetic coordinates (the error in MLT/mlon conversion was not large, typically two decimal places and below)
1.0.12 (2015-10-26)
Return nan in forbidden region instead of throwing exception
1.0.11 (2015-10-26)
Fix bug in subsolar/MLT conversion
1.0.10 (2015-10-08)
No code changes, debugged automatic build/upload process and needed new version numbers along the way
1.0.0 (2015-10-07)
Initial release
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 Distributions
File details
Details for the file aacgmv2-2.4.0.tar.gz
.
File metadata
- Download URL: aacgmv2-2.4.0.tar.gz
- Upload date:
- Size: 499.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2b4e6f5ec3aaf9a110e99958399007ea43a9f9a92ed59f812ca6e0f39c68c38 |
|
MD5 | 9dd5c89df57c8d6499be35e003fc8340 |
|
BLAKE2b-256 | 8ece0747df70a8b2ecbb9b4d1890ad568e7463e37234c80e327f81264f5dd8a8 |
File details
Details for the file aacgmv2-2.4.0-cp36-cp36m-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: aacgmv2-2.4.0-cp36-cp36m-macosx_10_12_x86_64.whl
- Upload date:
- Size: 39.4 kB
- Tags: CPython 3.6m, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d972f21e0accb92265cc7362922c792326e6864485a2a69d1fb0bd698e0454f0 |
|
MD5 | dd582557f5152076f170e76ff2d983a8 |
|
BLAKE2b-256 | 67815a209d525c799397fc15a434c410bc70b965ab1b083ffcef2edf06dbc193 |
File details
Details for the file aacgmv2-2.4.0-cp35-cp35m-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: aacgmv2-2.4.0-cp35-cp35m-macosx_10_12_x86_64.whl
- Upload date:
- Size: 39.4 kB
- Tags: CPython 3.5m, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 533c4358e9fda01f6156a1af446e5956db4beab471dd065633a5b34815d22fe7 |
|
MD5 | 3d25dafff864f1fd3e1c6a2743bd9fd1 |
|
BLAKE2b-256 | c67e5e6df1e2da8f476c9b0834bf32f21d038196fd4f69425249944d58522915 |
File details
Details for the file aacgmv2-2.4.0-cp34-cp34m-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: aacgmv2-2.4.0-cp34-cp34m-macosx_10_12_x86_64.whl
- Upload date:
- Size: 39.3 kB
- Tags: CPython 3.4m, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b523a2d1886dc5a8a38a4f26f47f597a82e351efeaa4bae29fae2e1e435098e1 |
|
MD5 | c20e42062a2a0d86778c83763881c2c0 |
|
BLAKE2b-256 | 8f96d283b42f22ca4a65d1035d930a5eb0a63f074836f693df037672b90b5b70 |
File details
Details for the file aacgmv2-2.4.0-cp27-cp27m-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: aacgmv2-2.4.0-cp27-cp27m-macosx_10_12_x86_64.whl
- Upload date:
- Size: 42.4 kB
- Tags: CPython 2.7m, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 800fb145af66de2b4899d3bb5f9e36da7b8b7b00af34726c186588aa5f8938e1 |
|
MD5 | e9c6c837c80279e33cfb5665b6aae321 |
|
BLAKE2b-256 | a48cde7f1865bca9ba05deca9d59255f149b0cd9f81ec5ddf1dd4706b19fc112 |