Skip to content

w2naf/aacgmv2

 
 

Repository files navigation

Overview

Documentation Status PyPI Package latest release doi

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

https://aacgmv2.readthedocs.org/

http://superdarn.thayer.dartmouth.edu/aacgm.html

Badges

docs Documentation Status
tests
Travis-CI Build Status AppVeyor Build Status Requirements Status
Code Quality Status CodeClimate Quality Status
Scrutinizer Status codacy
package
PyPI Package latest release Supported versions
PyPI Wheel Supported implementations
alt

Codacy Code Quality Status

About

Python library for AACGM-v2 magnetic coordinates

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE-AstAlg.txt

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 53.1%
  • Python 44.7%
  • C++ 1.6%
  • Batchfile 0.6%