Skip to main content

A Python wrapper for Apex coordinates

Project description

Documentation Status PyPI Package latest release

This is a Python wrapper for the Apex fortran library by Emmert et al. [2010] [1], which allows converting between geodetic, modified apex, and quasi-dipole coordinates as well as getting modified apex and quasi-dipole base vectors (Richmond [1995] [2]). MLT calculations are also included. The package is free software (MIT license).

Quick start

Install (requires NumPy):

pip install apexpy

Conversion is done by creating an Apex object and using its methods to perform the desired calculations. Some simple examples:

>>> from apexpy import Apex
>>> from __future__ import print_function
>>> A = Apex(date=2015.3)  # datetime objects are also supported
>>> # geo to apex, scalar input
>>> mlat, mlon = A.convert(60, 15, 'geo', 'apex', height=300)
>>> print("{:.12f}, {:.12f}".format(mlat, mlon))
57.469573974609, 93.633583068848
>>> # apex to geo, array input
>>> glat, glon = A.convert([90, -90], 0, 'apex', 'geo', height=0)
>>> print(["{:.12f}, {:.12f}".format(ll, glon[i]) for i,ll in enumerate(glat)])
['83.099594116211, -84.594589233398', '-74.388267517090, 125.714927673340']
>>> # geo to MLT
>>> import datetime as dt
>>> mlat, mlt = A.convert(60, 15, 'geo', 'mlt', datetime=dt.datetime(2015, 2, 10, 18, 0, 0))
>>> print("{:.12f}, {:.12f}".format(mlat, mlt))
56.590423583984, 19.108103879293
>>> # can also convert magnetic longitude to mlt
>>> mlt = A.mlon2mlt(120, dt.datetime(2015, 2, 10, 18, 0, 0))
>>> print("{:.2f}".format(mlt))
20.89

If you don’t know or use Python, you can also use the command line. See details in the full documentation.

Documentation

https://apexpy.readthedocs.org/

References

Badges

docs

Documentation Status

tests

Travis-CI Build Status AppVeyor Build Status Requirements Status
Coverage Status Coverage 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

1.0.2 (2018-02-27)

  • Extend character limit for allowable data file path, and update documentation to reflect a change in maintainers. Also updated testing implimentation, reduced fortran compiler warnings, and improved PEP8 compliance.

1.0.1 (2016-03-10)

  • Remove geocentric to geodetic conversion of subsolar point based on feedback from Art Richmond. (The subsolar point is the same in geocentric and geodetic coordinates.) The helper function gc2gdlat have been kept to preserve backwards compatibility.

1.0.0 (2015-11-30)

  • 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

apexpy-1.0.2.tar.gz (253.4 kB view hashes)

Uploaded Source

Built Distributions

apexpy-1.0.2-cp35-cp35m-macosx_10_12_x86_64.whl (364.0 kB view hashes)

Uploaded CPython 3.5m macOS 10.12+ x86-64

apexpy-1.0.2-cp34-cp34m-macosx_10_12_x86_64.whl (363.6 kB view hashes)

Uploaded CPython 3.4m macOS 10.12+ x86-64

apexpy-1.0.2-cp33-cp33m-macosx_10_12_x86_64.whl (362.4 kB view hashes)

Uploaded CPython 3.3m macOS 10.12+ x86-64

apexpy-1.0.2-cp27-cp27m-macosx_10_12_x86_64.whl (364.8 kB view hashes)

Uploaded CPython 2.7m macOS 10.12+ x86-64

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