Skip to main content

A Python wrapper for AACGM-v2 magnetic coordinates

Project description

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.5. 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 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

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 Code Quality Status

package

PyPI Package latest release Supported versions
PyPI Wheel Supported implementations

Changelog

2.5.1 (2018-10-19)

  • Commented out debug statement in C code

  • Updated environment variable warning to output to stderr instead of stdout

  • Added templates for pull requests, issues, and a code of conduct

2.5.0 (2018-08-08)

  • Updated C code and coefficients to version 2.5. Changes in python code reflect changes in C code (includes going back to using environment variables instead of strings for coefficient file locations)

  • Added decorators to some of the test functions

  • Specified AppVeyor Visual Studio version, since it was defaulting to 2010 and that version doesn’t work with python 3

2.4.2 (2018-05-21)

  • Fixed bug in convert_mlt that caused all time inputs to occur at 00:00:00 UT

  • Fixed year of last two updates in changelog

2.4.1 (2018-04-04)

  • Fix bug in installation that caused files to be placed in the wrong directory

  • Added DOI

2.4.0 (2018-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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aacgmv2-2.5.1.tar.gz (1.5 MB view details)

Uploaded Source

Built Distributions

aacgmv2-2.5.1-cp36-cp36m-macosx_10_12_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.6m macOS 10.12+ x86-64

aacgmv2-2.5.1-cp35-cp35m-macosx_10_12_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.5m macOS 10.12+ x86-64

aacgmv2-2.5.1-cp27-cp27m-macosx_10_12_x86_64.whl (1.6 MB view details)

Uploaded CPython 2.7m macOS 10.12+ x86-64

File details

Details for the file aacgmv2-2.5.1.tar.gz.

File metadata

  • Download URL: aacgmv2-2.5.1.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.2 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.15

File hashes

Hashes for aacgmv2-2.5.1.tar.gz
Algorithm Hash digest
SHA256 a76a6c07ddcb4cdeed7f4007bfeeaea1400552315644c4151e1f7b3c9ce36e47
MD5 ebdabe50db0f7f06d7f80ebf8a731ccf
BLAKE2b-256 d36351f314b1aa042591287901bf4819c223273f7c98c3eac94b60d5e9b1121c

See more details on using hashes here.

File details

Details for the file aacgmv2-2.5.1-cp36-cp36m-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: aacgmv2-2.5.1-cp36-cp36m-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.6m, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.2 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.15

File hashes

Hashes for aacgmv2-2.5.1-cp36-cp36m-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ab2ec9a084d0f0431ee9e2f770bc02c18370b5a7c67ab7c8a98c712ad40a70f4
MD5 ae80ac46685c6d8dc0f1c9127c5afcc3
BLAKE2b-256 07f6bc8d9203ec7d7a37f41f02219932d0b8d9e6d140bcd47860c29bdc58fe27

See more details on using hashes here.

File details

Details for the file aacgmv2-2.5.1-cp35-cp35m-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: aacgmv2-2.5.1-cp35-cp35m-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.5m, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.2 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.15

File hashes

Hashes for aacgmv2-2.5.1-cp35-cp35m-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4c8d61add099a89db6f6d17bfe33e979c583297f05df0c7641fb3d4be4a2e20b
MD5 34858183d8a673e20cb4b9b51e060deb
BLAKE2b-256 d6ccd03293359c89cd35204a42e8db1e1fb7059f2507d56e79c819e456edbe9e

See more details on using hashes here.

File details

Details for the file aacgmv2-2.5.1-cp27-cp27m-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: aacgmv2-2.5.1-cp27-cp27m-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 2.7m, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.2 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.15

File hashes

Hashes for aacgmv2-2.5.1-cp27-cp27m-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 df1ba5834e22167885b727e1903d207659d353480f1bf948b0a61de64dc491a6
MD5 01887b23bfb9915e7c50001c158e6bb6
BLAKE2b-256 caf5fc539eff53722e24e1d3ed5fb2a124322a39008e704e52fb890bcc59a15d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page