A Python wrapper for Apex coordinates
Project description
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
References
Badges
docs |
|
---|---|
tests |
|
package |
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
Built Distributions
Hashes for apexpy-1.0.2-cp35-cp35m-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ddcc8b0798eb072dbdc953c8aba9d609f64b37d7f991c1f993ecb3dcf2d8752 |
|
MD5 | 6591632bb0562f829226c597a434f289 |
|
BLAKE2b-256 | 3aeb12efa265a5fedafd71cc3da3d6e7f123277134814831665b10444928c7a6 |
Hashes for apexpy-1.0.2-cp34-cp34m-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aaad5ea9b3f561adc9dbfa6149708a0bc082ea9ea1e6722fd6d195de11fd2876 |
|
MD5 | 7508f59e2ed94079df92cc877381b658 |
|
BLAKE2b-256 | 321397abfa25c0dd8b37e1e7397cca099fc3718e67cdf291bce41866deafe6d3 |
Hashes for apexpy-1.0.2-cp33-cp33m-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc94d542a0a43fdb1404f3da7f6645cd553f48f3bee2b759f2652460be820ba9 |
|
MD5 | 671c4609b047187923bb1ac98bf66da5 |
|
BLAKE2b-256 | 9c4aa22c898cf7514e8915f34cde7d9707aaf9abaf945372b31625dedd5ab8f4 |
Hashes for apexpy-1.0.2-cp27-cp27m-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe3e578096f10caf24a5e65f5e1b570a36e97e363bc228084ac2b0c23c8bb4f9 |
|
MD5 | 9e428147bf83ae9a27ef44f100e241ed |
|
BLAKE2b-256 | 78c2bb9a253be1696ce8e2b570e92313401ec5dca0870c35e53aa50e7aa8d2ad |