Skip to content

Commit

Permalink
py34 support
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed May 8, 2019
1 parent 95e1e17 commit 615ca44
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 30 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,15 @@ Includes some relevant

## Prerequisites

* Python ≥ 3.5 or PyPy3
Python ≥ 3.4

or

PyPy3

References to Numpy and AstroPy are *optional*, algorithms from Vallado and Meeus are used if AstroPy is not present.
PyMap3D is regularly tested with Python ≥ 3.5.
Limited Python 3.4 support is available for systems using MicroPython or other cases where a current Python version isn't available.


## Install
Expand Down
9 changes: 4 additions & 5 deletions pymap3d/math/aer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
""" transforms involving AER: azimuth, elevation, slant range"""
from typing import Tuple

from .ecef import ecef2enu, geodetic2ecef, ecef2geodetic, enu2uvw, Ellipsoid
from .enu import geodetic2enu, aer2enu, enu2aer
Expand All @@ -9,7 +8,7 @@

def ecef2aer(x: float, y: float, z: float,
lat0: float, lon0: float, h0: float,
ell: Ellipsoid = None, deg: bool = True) -> Tuple[float, float, float]:
ell: Ellipsoid = None, deg: bool = True):
"""
gives azimuth, elevation and slant range from an Observer to a Point with ECEF coordinates.
Expand Down Expand Up @@ -51,7 +50,7 @@ def ecef2aer(x: float, y: float, z: float,

def geodetic2aer(lat: float, lon: float, h: float,
lat0: float, lon0: float, h0: float,
ell: Ellipsoid = None, deg: bool = True) -> Tuple[float, float, float]:
ell: Ellipsoid = None, deg: bool = True):
"""
gives azimuth, elevation and slant range from an Observer to a Point with geodetic coordinates.
Expand Down Expand Up @@ -93,7 +92,7 @@ def geodetic2aer(lat: float, lon: float, h: float,
def aer2geodetic(az: float, el: float, srange: float,
lat0: float, lon0: float, h0: float,
ell: Ellipsoid = None,
deg: bool = True) -> Tuple[float, float, float]:
deg: bool = True):
"""
gives geodetic coordinates of a point with az, el, range
from an observer at lat0, lon0, h0
Expand Down Expand Up @@ -136,7 +135,7 @@ def aer2geodetic(az: float, el: float, srange: float,

def aer2ecef(az: float, el: float, srange: float,
lat0: float, lon0: float, alt0: float,
ell: Ellipsoid = None, deg: bool = True) -> Tuple[float, float, float]:
ell: Ellipsoid = None, deg: bool = True):
"""
converts target azimuth, elevation, range from observer at lat0,lon0,alt0 to ECEF coordinates.
Expand Down
15 changes: 7 additions & 8 deletions pymap3d/math/ecef.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
""" Transforms involving ECEF: earth-centered, earth-fixed frame """
from math import radians, sin, cos, tan, hypot, degrees, sqrt, pi
from math import atan as arctan, atan2 as arctan2
from typing import Tuple

tau = 2 * pi

Expand Down Expand Up @@ -90,7 +89,7 @@ def get_radius_normal(lat_radians: float, ell: Ellipsoid = None) -> float:


def geodetic2ecef(lat: float, lon: float, alt: float,
ell: Ellipsoid = None, deg: bool = True) -> Tuple[float, float, float]:
ell: Ellipsoid = None, deg: bool = True):
"""
point transformation from Geodetic of specified ellipsoid (default WGS-84) to ECEF
Expand Down Expand Up @@ -143,7 +142,7 @@ def geodetic2ecef(lat: float, lon: float, alt: float,


def ecef2geodetic(x: float, y: float, z: float,
ell: Ellipsoid = None, deg: bool = True) -> Tuple[float, float, float]:
ell: Ellipsoid = None, deg: bool = True):
"""
convert ECEF (meters) to geodetic coordinates
Expand Down Expand Up @@ -216,7 +215,7 @@ def ecef2geodetic(x: float, y: float, z: float,


def ecef2enuv(u: float, v: float, w: float,
lat0: float, lon0: float, deg: bool = True) -> Tuple[float, float, float]:
lat0: float, lon0: float, deg: bool = True):
"""
VECTOR from observer to target ECEF => ENU
Expand Down Expand Up @@ -261,7 +260,7 @@ def ecef2enuv(u: float, v: float, w: float,

def ecef2enu(x: float, y: float, z: float,
lat0: float, lon0: float, h0: float,
ell: Ellipsoid = None, deg: bool = True) -> Tuple[float, float, float]:
ell: Ellipsoid = None, deg: bool = True):
"""
from observer to target, ECEF => ENU
Expand Down Expand Up @@ -300,7 +299,7 @@ def ecef2enu(x: float, y: float, z: float,


def enu2uvw(east: float, north: float, up: float,
lat0: float, lon0: float, deg: bool = True) -> Tuple[float, float, float]:
lat0: float, lon0: float, deg: bool = True):
"""
Parameters
----------
Expand Down Expand Up @@ -334,7 +333,7 @@ def enu2uvw(east: float, north: float, up: float,


def uvw2enu(u: float, v: float, w: float,
lat0: float, lon0: float, deg: bool = True) -> Tuple[float, float, float]:
lat0: float, lon0: float, deg: bool = True):
"""
Parameters
----------
Expand Down Expand Up @@ -368,7 +367,7 @@ def uvw2enu(u: float, v: float, w: float,

def enu2ecef(e1: float, n1: float, u1: float,
lat0: float, lon0: float, h0: float,
ell: Ellipsoid = None, deg: bool = True) -> Tuple[float, float, float]:
ell: Ellipsoid = None, deg: bool = True):
"""
ENU to ECEF
Expand Down
9 changes: 4 additions & 5 deletions pymap3d/math/enu.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
""" transforms involving ENU East North Up """
from typing import Tuple
from math import radians, sin, cos, hypot, degrees, pi
from math import atan2 as arctan2

Expand All @@ -10,7 +9,7 @@
__all__ = ['enu2aer', 'aer2enu', 'enu2geodetic', 'geodetic2enu']


def enu2aer(e: float, n: float, u: float, deg: bool = True) -> Tuple[float, float, float]:
def enu2aer(e: float, n: float, u: float, deg: bool = True):
"""
ENU to Azimuth, Elevation, Range
Expand Down Expand Up @@ -58,7 +57,7 @@ def enu2aer(e: float, n: float, u: float, deg: bool = True) -> Tuple[float, floa


def aer2enu(az: float, el: float, srange: float,
deg: bool = True) -> Tuple[float, float, float]:
deg: bool = True):
"""
Azimuth, Elevation, Slant range to target to East, north, Up
Expand Down Expand Up @@ -96,7 +95,7 @@ def aer2enu(az: float, el: float, srange: float,

def enu2geodetic(e: float, n: float, u: float,
lat0: float, lon0: float, h0: float,
ell: Ellipsoid = None, deg: bool = True) -> Tuple[float, float, float]:
ell: Ellipsoid = None, deg: bool = True):
"""
East, North, Up to target to geodetic coordinates
Expand Down Expand Up @@ -137,7 +136,7 @@ def enu2geodetic(e: float, n: float, u: float,

def geodetic2enu(lat: float, lon: float, h: float,
lat0: float, lon0: float, h0: float,
ell: Ellipsoid = None, deg: bool = True) -> Tuple[float, float, float]:
ell: Ellipsoid = None, deg: bool = True):
"""
Parameters
----------
Expand Down
15 changes: 7 additions & 8 deletions pymap3d/math/ned.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
""" Transforms involving NED North East Down """
from .enu import geodetic2enu, aer2enu, enu2aer
from .ecef import ecef2geodetic, ecef2enuv, ecef2enu, enu2ecef, Ellipsoid
from typing import Tuple

__all__ = ['aer2ned', 'ned2aer', 'ned2geodetic', 'ned2ecef', 'ecef2ned', 'geodetic2ned', 'ecef2nedv']


def aer2ned(az: float, elev: float, slantRange: float,
deg: bool = True) -> Tuple[float, float, float]:
deg: bool = True):
"""
converts azimuth, elevation, range to target from observer to North, East, Down
Expand Down Expand Up @@ -38,7 +37,7 @@ def aer2ned(az: float, elev: float, slantRange: float,


def ned2aer(n: float, e: float, d: float,
deg: bool = True) -> Tuple[float, float, float]:
deg: bool = True):
"""
converts North, East, Down to azimuth, elevation, range
Expand Down Expand Up @@ -69,7 +68,7 @@ def ned2aer(n: float, e: float, d: float,

def ned2geodetic(n: float, e: float, d: float,
lat0: float, lon0: float, h0: float,
ell: Ellipsoid = None, deg: bool = True) -> Tuple[float, float, float]:
ell: Ellipsoid = None, deg: bool = True):
"""
Converts North, East, Down to target latitude, longitude, altitude
Expand Down Expand Up @@ -111,7 +110,7 @@ def ned2geodetic(n: float, e: float, d: float,

def ned2ecef(n: float, e: float, d: float,
lat0: float, lon0: float, h0: float,
ell: Ellipsoid = None, deg: bool = True) -> Tuple[float, float, float]:
ell: Ellipsoid = None, deg: bool = True):
"""
North, East, Down to target ECEF coordinates
Expand Down Expand Up @@ -150,7 +149,7 @@ def ned2ecef(n: float, e: float, d: float,

def ecef2ned(x: float, y: float, z: float,
lat0: float, lon0: float, h0: float,
ell: Ellipsoid = None, deg: bool = True) -> Tuple[float, float, float]:
ell: Ellipsoid = None, deg: bool = True):
"""
Convert ECEF x,y,z to North, East, Down
Expand Down Expand Up @@ -192,7 +191,7 @@ def ecef2ned(x: float, y: float, z: float,

def geodetic2ned(lat: float, lon: float, h: float,
lat0: float, lon0: float, h0: float,
ell: Ellipsoid = None, deg: bool = True) -> Tuple[float, float, float]:
ell: Ellipsoid = None, deg: bool = True):
"""
convert latitude, longitude, altitude of target to North, East, Down from observer
Expand Down Expand Up @@ -234,7 +233,7 @@ def geodetic2ned(lat: float, lon: float, h: float,

def ecef2nedv(x: float, y: float, z: float,
lat0: float, lon0: float,
deg: bool = True) -> Tuple[float, float, float]:
deg: bool = True):
"""
for VECTOR between two points
Expand Down
1 change: 0 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[pytest]
minversion = 3.5

filterwarnings =
ignore::DeprecationWarning
Expand Down
5 changes: 3 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ classifiers =
Environment :: Console
Intended Audience :: Science/Research
Operating System :: OS Independent
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Expand All @@ -24,7 +25,7 @@ long_description = file: README.md
long_description_content_type = text/markdown

[options]
python_requires = >= 3.5
python_requires = >= 3.4
setup_requires =
pip >= 10
setuptools >= 38.6.0
Expand All @@ -36,7 +37,7 @@ install_requires =

[options.extras_require]
tests =
pytest >= 3.5
pytest
cov =
pytest-cov
coveralls
Expand Down

0 comments on commit 615ca44

Please sign in to comment.