Pure Python (no prerequistes beyond Python itself) 3-D geographic coordinate conversions and geodesy.
Function syntax is roughly similar to Matlab Mapping Toolbox.
PyMap3D is intended for non-interactive use on massively parallel (HPC) and embedded systems.
Native Python float is typically 64 bit.
Numpy can select real precision bits: 32, 64, 128, etc.
Functions
Popular mapping toolbox functions ported to Python include the
following, where the source coordinate system (before the "2") is
converted to the desired coordinate system:
Numerous functions in pymap3d use an ellipsoid model.
The default is WGS84 Ellipsoid.
Numerous other ellipsoids are available in pymap3d.Ellipsoid.
Print available ellipsoid models:
import pymap3d as pm
print(pm.Ellipsoid.models)
Specify GRS80 ellipsoid:
import pymap3d as pm
ell = pm.Ellipsoid.from_name('grs80')
array vs scalar
Use of pymap3d on embedded systems or other streaming data applications often deal with scalar position data.
These data are handled efficiently with the Python math stdlib module.
Vector data can be handled via list comprehension.
Those needing multidimensional data with SIMD and other Numpy and/or PyPy accelerated performance can do so automatically by installing Numpy.
pymap3d seamlessly falls back to Python's math module if Numpy isn't present.
To keep the code clean, only scalar data can be used without Numpy.
As noted above, use list comprehension if you need vector data without Numpy.
Caveats
Atmospheric effects neglected in all functions not invoking AstroPy.
Would need to update code to add these input parameters (just start a GitHub Issue to request).
Planetary perturbations and nutation etc. not fully considered.
Compare to Matlab Mapping and Aerospace Toolbox
The tests in files tests/test_matlab*.py selected by
pytest -k matlab
# run from pymap3d/ top-level directory
use
Matlab Engine for Python
to compare Python PyMap3D output with Matlab output using Matlab functions.
PyMap3D does not require anything beyond pure Python for most transforms
Astronomical conversions are done using (optional) AstroPy for established accuracy
PyMap3D API is similar to Matlab Mapping Toolbox, while PyProj's interface is quite distinct
PyMap3D intrinsically handles local coordinate systems such as ENU,
while PyProj ENU requires some additional effort.
PyProj is oriented towards points on the planet surface, while PyMap3D handles points on or above the planet surface equally well, particularly important for airborne vehicles and remote sensing.
AstroPy.Units.Quantity
At this time,
AstroPy.Units.Quantity
is not supported.
Let us know if this is of interest.
Impacts on performance would have to be considered before making Quantity a first-class citizen.
For now, you can workaround by passing in the .value of the variable.
Alternatives
Use instead of pymap3d: tools that do the same job, closest first.