PyMap3D
PyMap3D: 3-D coordinate conversions for terrestrial and geospace environments - Published in JOSS (2018)
Science Score: 77.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 6 DOI reference(s) in README -
✓Academic publication links
Links to: joss.theoj.org, zenodo.org -
✓Committers with academic emails
1 of 19 committers (5.3%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.2%) to scientific vocabulary
Keywords
Scientific Fields
Repository
pure-Python (Numpy optional) 3D coordinate conversions for geospace ecef enu eci
Basic Info
- Host: GitHub
- Owner: geospace-code
- License: bsd-2-clause
- Language: Python
- Default Branch: main
- Homepage: https://geospace-code.github.io/pymap3d
- Size: 1.57 MB
Statistics
- Stars: 424
- Watchers: 11
- Forks: 87
- Open Issues: 5
- Releases: 57
Topics
Metadata Files
README.md
Python 3-D coordinate conversions
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.
Thanks to our contributors.
Similar toolboxes in other code languages
Prerequisites
Numpy and AstroPy are optional. Algorithms from Vallado and Meeus are used if AstroPy is not present.
Install
sh
python3 -m pip install pymap3d
or for the latest development code:
```sh git clone https://github.com/geospace-code/pymap3d
pip install -e pymap3d ```
One can verify Python functionality after installation by:
sh
pytest pymap3d
Usage
Where consistent with the definition of the functions, all arguments may be arbitrarily shaped (scalar, N-D array).
```python import pymap3d as pm
x,y,z = pm.geodetic2ecef(lat,lon,alt)
az,el,range = pm.geodetic2aer(lat, lon, alt, observerlat, observerlon, 0) ```
Python argument unpacking can be used for compact function arguments with scalars or arbitrarily shaped N-D arrays:
```python aer = (az,el,slantrange) obslla = (obslat ,obslon, obs_alt)
lla = pm.aer2geodetic(*aer, *obslla) ```
where tuple lla is comprised of scalar or N-D arrays (lat,lon,alt).
Example scripts are in the examples directory.
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:
aer2ecef aer2enu aer2geodetic aer2ned
ecef2aer ecef2enu ecef2enuv ecef2geodetic ecef2ned ecef2nedv
ecef2eci eci2ecef eci2aer aer2eci geodetic2eci eci2geodetic
enu2aer enu2ecef enu2geodetic
geodetic2aer geodetic2ecef geodetic2enu geodetic2ned
ned2aer ned2ecef ned2geodetic
azel2radec radec2azel
lookAtSpheroid
track2 departure meanm
rcurve rsphere
geod2geoc geoc2geod
geodetic2spherical spherical2geodetic
Vincenty functions "vincenty.vreckon" and "vincenty.vdist" are accessed like:
```python import pymap3d.vincenty as pmv
lat2, lon2 = pmv.vreckon(lat1, lon1, groundrangem, azimuthdeg) distm, azimuth_deg = pmv.vdist(lat1, lon1, lat2, lon2) ```
Additional functions:
- loxodrome_inverse: rhumb line distance and azimuth between ellipsoid points (lat,lon) akin to Matlab
distance('rh', ...)andazimuth('rh', ...) - loxodrome_direct
- geodetic latitude transforms to/from: parametric, authalic, isometric, and more in pymap3d.latitude
Abbreviations:
- AER: Azimuth, Elevation, Range
- ECEF: Earth-centered, Earth-fixed
- ECI: Earth-centered Inertial using IERS via
astropy - ENU: East North Up
- NED: North East Down
- radec: right ascension, declination
Ellipsoid
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:
```python import pymap3d as pm
print(pm.Ellipsoid.models) ```
Specify GRS80 ellipsoid:
```python 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
```sh 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.
sh
python -m pip install matlabengine
Notes
As compared to PyProj:
- 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.
Owner
- Name: Geospace code
- Login: geospace-code
- Kind: organization
- Location: 1 au
- Website: https://geospace-code.github.io
- Repositories: 16
- Profile: https://github.com/geospace-code
GNSS and other geospace analysis programs
Citation (CITATION.cff)
cff-version: 1.2.0
authors:
- orcid: 0000-0002-1637-6526
name: SciVision
title: PyMap3D
doi: 10.21105/joss.00580
CodeMeta (codemeta.json)
{
"@context": "https://doi.org/10.5063/schema/codemeta-3.0",
"@type": "SoftwareSourceCode",
"license": "https://spdx.org/licenses/BSD-2-Clause",
"codeRepository": "https://github.com/geospace-code/pymap3d",
"continuousIntegration": "https://github.com/geospace-code/pymap3d/actions",
"issueTracker": "https://github.com/geospace-code/pymap3d/issues",
"name": "PyMap3d",
"identifier": "10.21105/joss.00580",
"description": "pure-Python (Numpy optional) 3D coordinate conversions for geospace",
"applicationCategory": "geospace",
"developmentStatus": "active",
"funder": {
"@type": "Organization",
"name": "AFOSR"
},
"keywords": [
"coordinate transformation"
],
"programmingLanguage": [
"Python"
],
"author": [
{
"@type": "Organization",
"name": "SciVision"
}
]
}
GitHub Events
Total
- Issues event: 2
- Watch event: 29
- Issue comment event: 2
- Pull request review event: 3
- Pull request review comment event: 1
- Pull request event: 1
- Fork event: 3
Last Year
- Issues event: 2
- Watch event: 29
- Issue comment event: 2
- Pull request review event: 3
- Pull request review comment event: 1
- Pull request event: 1
- Fork event: 3
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Michael Hirsch, Ph.D | s****n | 716 |
| Noritada Kobayashi | n****i@g****m | 5 |
| Jonathan Plasse | 1****e | 3 |
| Laurie O | l****n@h****m | 3 |
| Adam Shapiro | a****m@p****m | 2 |
| Ashwin Gupta | a****0@g****m | 2 |
| Leonardo Uieda | l****a@g****m | 2 |
| Ryan Pavlick | r****k | 2 |
| Ondrej Pokorny | op@q****m | 1 |
| Clancy Walters | 1****3@s****u | 1 |
| David Rigie | d****e@g****m | 1 |
| David Schurman | d****1@g****m | 1 |
| Nikolai Gaiduchenko | G****E@g****m | 1 |
| Peter Bryan | p****n@g****m | 1 |
| Philippe Rivière | f****l@r****t | 1 |
| Samuel Marks | s****s@g****m | 1 |
| Seth Wagenman | 1****e | 1 |
| cchuravy | c****y@g****m | 1 |
| rpavlick | r****k@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 4 months ago
All Time
- Total issues: 58
- Total pull requests: 32
- Average time to close issues: 2 months
- Average time to close pull requests: about 2 months
- Total issue authors: 46
- Total pull request authors: 23
- Average comments per issue: 1.91
- Average comments per pull request: 1.44
- Merged pull requests: 19
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 2
- Pull requests: 2
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 2
- Pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- leouieda (8)
- noritada (4)
- quonn77 (2)
- bcminch (2)
- mcelhennyi (1)
- drhirsch (1)
- calum-blair-archangel (1)
- cojmeister (1)
- BleedObsidian (1)
- 2ar0n (1)
- powersa (1)
- iustin94 (1)
- niwhsa9 (1)
- philblckwd (1)
- ghtmtt (1)
Pull Request Authors
- ryanpavlick (6)
- EpicWink (3)
- noritada (3)
- RaczeQ (1)
- Yozh2 (1)
- adamshapiro0 (1)
- Fil (1)
- ClancyWalters (1)
- cchuravy (1)
- leouieda (1)
- unjambonakap (1)
- JonathanPlasse (1)
- jprMesh (1)
- brethvoice (1)
- dschurman (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 3
-
Total downloads:
- pypi 405,168 last-month
- Total docker downloads: 742
-
Total dependent packages: 23
(may contain duplicates) -
Total dependent repositories: 68
(may contain duplicates) - Total versions: 126
- Total maintainers: 1
pypi.org: pymap3d
pure Python (no prereqs) coordinate conversions, following convention of several popular Matlab routines.
- Documentation: https://pymap3d.readthedocs.io/
- License: BSD License
-
Latest release: 3.2.0
published 6 months ago
Rankings
Maintainers (1)
proxy.golang.org: github.com/geospace-code/pymap3d
- Documentation: https://pkg.go.dev/github.com/geospace-code/pymap3d#section-documentation
- License: bsd-2-clause
-
Latest release: v3.1.0+incompatible
published almost 2 years ago
Rankings
conda-forge.org: pymap3d
Pure Python (no prerequistes beyond Python itself) 3-D geographic coordinate conversions and geodesy. API similar to popular $1000 Matlab Mapping Toolbox. PyMap3D is intended for non-interactive use on massively parallel (HPC) and embedded systems. Includes some relevant Vallado algorithms. PyMap3D provides conversion routines for the following coordinate systems: * geodetic * geocentric * AER: Azimuth, Elevation, Range * ECEF: Earth-centered, Earth-fixed * ECI: Earth-centered Inertial * ENU: East North Up * NED: North East Down * radec: right ascension, declination
- Homepage: https://github.com/geospace-code/pymap3d
- License: BSD-2-Clause
-
Latest release: 2.9.1
published over 3 years ago
Rankings
Dependencies
- actions/checkout v3 composite
- actions/setup-python v4 composite
- codecov/codecov-action v3 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- pypa/gh-action-pypi-publish release/v1 composite