pygeodesy 24.10.24__py2.py3-none-any.whl → 24.11.11__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {PyGeodesy-24.10.24.dist-info → PyGeodesy-24.11.11.dist-info}/METADATA +4 -4
- {PyGeodesy-24.10.24.dist-info → PyGeodesy-24.11.11.dist-info}/RECORD +54 -54
- {PyGeodesy-24.10.24.dist-info → PyGeodesy-24.11.11.dist-info}/WHEEL +1 -1
- pygeodesy/__init__.py +2 -2
- pygeodesy/azimuthal.py +51 -61
- pygeodesy/basics.py +34 -33
- pygeodesy/booleans.py +36 -36
- pygeodesy/cartesianBase.py +5 -5
- pygeodesy/constants.py +4 -4
- pygeodesy/css.py +7 -8
- pygeodesy/deprecated/__init__.py +1 -1
- pygeodesy/deprecated/classes.py +9 -9
- pygeodesy/deprecated/functions.py +6 -6
- pygeodesy/ecef.py +11 -14
- pygeodesy/ellipsoidalBase.py +105 -120
- pygeodesy/ellipsoidalBaseDI.py +114 -118
- pygeodesy/ellipsoidalExact.py +35 -37
- pygeodesy/ellipsoids.py +3 -3
- pygeodesy/errors.py +24 -24
- pygeodesy/etm.py +80 -72
- pygeodesy/fmath.py +39 -37
- pygeodesy/formy.py +3 -2
- pygeodesy/fsums.py +51 -40
- pygeodesy/geodesicw.py +15 -14
- pygeodesy/geodesicx/__init__.py +2 -2
- pygeodesy/geodsolve.py +7 -16
- pygeodesy/geoids.py +5 -5
- pygeodesy/heights.py +2 -2
- pygeodesy/internals.py +63 -79
- pygeodesy/karney.py +2 -2
- pygeodesy/ktm.py +11 -13
- pygeodesy/latlonBase.py +6 -6
- pygeodesy/lazily.py +5 -5
- pygeodesy/lcc.py +4 -4
- pygeodesy/ltp.py +10 -10
- pygeodesy/ltpTuples.py +74 -75
- pygeodesy/mgrs.py +9 -10
- pygeodesy/named.py +4 -0
- pygeodesy/osgr.py +9 -12
- pygeodesy/props.py +2 -2
- pygeodesy/resections.py +9 -10
- pygeodesy/rhumb/__init__.py +1 -1
- pygeodesy/rhumb/solve.py +3 -3
- pygeodesy/simplify.py +5 -5
- pygeodesy/sphericalNvector.py +80 -123
- pygeodesy/sphericalTrigonometry.py +60 -66
- pygeodesy/units.py +2 -2
- pygeodesy/utm.py +6 -6
- pygeodesy/vector2d.py +13 -13
- pygeodesy/vector3d.py +19 -21
- pygeodesy/vector3dBase.py +18 -15
- pygeodesy/webmercator.py +4 -4
- pygeodesy/wgrs.py +4 -4
- {PyGeodesy-24.10.24.dist-info → PyGeodesy-24.11.11.dist-info}/top_level.txt +0 -0
pygeodesy/booleans.py
CHANGED
|
@@ -21,7 +21,7 @@ from pygeodesy.basics import isodd, issubclassof, map2, _xscalar
|
|
|
21
21
|
from pygeodesy.constants import EPS, EPS2, INT0, _0_0, _0_5, _1_0
|
|
22
22
|
from pygeodesy.errors import ClipError, _IsnotError, _TypeError, \
|
|
23
23
|
_ValueError, _xattr, _xkwds_get, _xkwds_pop2
|
|
24
|
-
from pygeodesy.fmath import favg, hypot, hypot2
|
|
24
|
+
from pygeodesy.fmath import favg, fdot_, hypot, hypot2
|
|
25
25
|
# from pygeodesy.fsums import fsum1 # _MODS
|
|
26
26
|
from pygeodesy.interns import NN, _BANG_, _clipid_, _COMMASPACE_, \
|
|
27
27
|
_composite_, _DOT_, _duplicate_, _e_, \
|
|
@@ -43,12 +43,12 @@ from pygeodesy.utily import fabs, _unrollon, _Wrap
|
|
|
43
43
|
# from math import fabs # from .utily
|
|
44
44
|
|
|
45
45
|
__all__ = _ALL_LAZY.booleans
|
|
46
|
-
__version__ = '24.
|
|
46
|
+
__version__ = '24.11.07'
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
_0EPS = EPS # near-zero, positive
|
|
49
|
+
_EPS0 = -EPS # near-zero, negative
|
|
50
|
+
_1EPS = _1_0 + EPS # near-one, over
|
|
51
|
+
_EPS1 = _1_0 - EPS # near-one, under
|
|
52
52
|
_10EPS = EPS * 10 # see ._2Abs, ._10eps
|
|
53
53
|
|
|
54
54
|
_alpha_ = 'alpha'
|
|
@@ -162,7 +162,7 @@ class _LatLonBool(_Named):
|
|
|
162
162
|
other.x == self.x and
|
|
163
163
|
other.y == self.y)
|
|
164
164
|
|
|
165
|
-
def __ne__(self, other): # required for Python 2
|
|
165
|
+
def __ne__(self, other): # required for Python 2 # PYCHOK no cover
|
|
166
166
|
return not self.__eq__(other)
|
|
167
167
|
|
|
168
168
|
def __repr__(self):
|
|
@@ -316,11 +316,11 @@ class LatLonFHP(_LatLonBool):
|
|
|
316
316
|
|
|
317
317
|
def __mod__(self, other): # cross product
|
|
318
318
|
_other(self, other)
|
|
319
|
-
return self.x
|
|
319
|
+
return fdot_(self.x, other.y, -self.y, other.x)
|
|
320
320
|
|
|
321
321
|
def __mul__(self, other): # dot product
|
|
322
322
|
_other(self, other)
|
|
323
|
-
return self.x
|
|
323
|
+
return fdot_(self.x, other.x, self.y, other.y)
|
|
324
324
|
|
|
325
325
|
def __rmul__(self, other): # scalar product
|
|
326
326
|
_xscalar(other=other)
|
|
@@ -424,7 +424,7 @@ class LatLonFHP(_LatLonBool):
|
|
|
424
424
|
def _prev_next2(self):
|
|
425
425
|
# Adjust 2-tuple (._prev, ._next) iff a I{duplicate} intersection
|
|
426
426
|
p, n = self, self._next
|
|
427
|
-
if self._isduplicate:
|
|
427
|
+
if self._isduplicate: # PYCHOK no cover
|
|
428
428
|
p = self._dupof
|
|
429
429
|
while p._isduplicate:
|
|
430
430
|
p = p._dupof
|
|
@@ -580,7 +580,7 @@ class _Clip(_Named):
|
|
|
580
580
|
'''
|
|
581
581
|
return self._bltr4 > _other(self, other)._bltr4
|
|
582
582
|
|
|
583
|
-
def __hash__(self): # PYCHOK no
|
|
583
|
+
def __hash__(self): # PYCHOK no cover
|
|
584
584
|
return hash(self._bltr4)
|
|
585
585
|
|
|
586
586
|
def __iter__(self):
|
|
@@ -610,7 +610,7 @@ class _Clip(_Named):
|
|
|
610
610
|
'''
|
|
611
611
|
return self._bltr4 < _other(self, other)._bltr4
|
|
612
612
|
|
|
613
|
-
def __ne__(self, other): # required for Python 2
|
|
613
|
+
def __ne__(self, other): # required for Python 2 # PYCHOK no cover
|
|
614
614
|
'''See method C{__eq__}.
|
|
615
615
|
'''
|
|
616
616
|
return not self.__eq__(other)
|
|
@@ -1551,10 +1551,10 @@ class _EdgeFHP(object):
|
|
|
1551
1551
|
p1, p2 = self._p1_p2
|
|
1552
1552
|
ap1 = p1._2A(q1, q2)
|
|
1553
1553
|
ap2_1 = p2._2A(q1, q2) - ap1
|
|
1554
|
-
if fabs(ap2_1) >
|
|
1554
|
+
if fabs(ap2_1) > _0EPS: # non-parallel edges
|
|
1555
1555
|
aq1 = q1._2A(p1, p2)
|
|
1556
1556
|
aq2_1 = q2._2A(p1, p2) - aq1
|
|
1557
|
-
if fabs(aq2_1) >
|
|
1557
|
+
if fabs(aq2_1) > _0EPS:
|
|
1558
1558
|
# compute and classify alpha and beta
|
|
1559
1559
|
a, a_0, a_0_1, _ = _alpha4(-ap1 / ap2_1)
|
|
1560
1560
|
b, b_0, b_0_1, _ = _alpha4(-aq1 / aq2_1)
|
|
@@ -1564,7 +1564,7 @@ class _EdgeFHP(object):
|
|
|
1564
1564
|
_E.Q_INTERSECT if a_0 and b_0_1 else (
|
|
1565
1565
|
_E.V_INTERSECT if a_0 and b_0 else None)))
|
|
1566
1566
|
|
|
1567
|
-
elif fabs(ap1) <
|
|
1567
|
+
elif fabs(ap1) < _0EPS: # parallel or colinear edges
|
|
1568
1568
|
dp = self._dp
|
|
1569
1569
|
d1 = q1 - p1
|
|
1570
1570
|
# compute and classify alpha and beta
|
|
@@ -1610,8 +1610,8 @@ class _EdgeGH(object):
|
|
|
1610
1610
|
|
|
1611
1611
|
def _alpha2(self, x, y, dx, dy):
|
|
1612
1612
|
# Return C{(alpha)}, see .points.nearestOn5
|
|
1613
|
-
a = (y
|
|
1614
|
-
d = (y
|
|
1613
|
+
a = fdot_(y, dy, x, dx) / self._hypot2
|
|
1614
|
+
d = fdot_(y, dx, -x, dy) / self._hypot0
|
|
1615
1615
|
return a, fabs(d)
|
|
1616
1616
|
|
|
1617
1617
|
def _Error(self, n, *args, **kwds): # PYCHOK no cover
|
|
@@ -1622,7 +1622,7 @@ class _EdgeGH(object):
|
|
|
1622
1622
|
@Property_RO
|
|
1623
1623
|
def _hypot0(self):
|
|
1624
1624
|
_, sx, _, sy = self._x_sx_y_sy
|
|
1625
|
-
return hypot(sx, sy) *
|
|
1625
|
+
return hypot(sx, sy) * _0EPS
|
|
1626
1626
|
|
|
1627
1627
|
@Property_RO
|
|
1628
1628
|
def _hypot2(self):
|
|
@@ -1650,33 +1650,33 @@ class _EdgeGH(object):
|
|
|
1650
1650
|
cy = c2.y - c1_y
|
|
1651
1651
|
d = cy * sx - cx * sy
|
|
1652
1652
|
|
|
1653
|
-
if fabs(d) >
|
|
1653
|
+
if fabs(d) > _0EPS: # non-parallel edges
|
|
1654
1654
|
dx = x - c1_x
|
|
1655
1655
|
dy = y - c1_y
|
|
1656
|
-
ca = (sx
|
|
1657
|
-
if
|
|
1658
|
-
|
|
1659
|
-
sa = (cx
|
|
1660
|
-
if
|
|
1661
|
-
|
|
1656
|
+
ca = fdot_(sx, dy, -sy, dx) / d
|
|
1657
|
+
if _0EPS < ca < _EPS1 or (self._xtend and
|
|
1658
|
+
_EPS0 < ca < _1EPS):
|
|
1659
|
+
sa = fdot_(cx, dy, -cy, dx) / d
|
|
1660
|
+
if _0EPS < sa < _EPS1 or (self._xtend and
|
|
1661
|
+
_EPS0 < sa < _1EPS):
|
|
1662
1662
|
yield (y + sa * sy), (x + sa * sx), sa, ca
|
|
1663
1663
|
|
|
1664
1664
|
# unhandled, "degenerate" cases 1, 2 or 3
|
|
1665
|
-
elif self._raiser and not (sa <
|
|
1665
|
+
elif self._raiser and not (sa < _EPS0 or sa > _1EPS): # PYCHOK no cover
|
|
1666
1666
|
raise self._Error(1, c1, c2, sa=sa) # intersection at s1 or s2
|
|
1667
1667
|
|
|
1668
|
-
elif self._raiser and not (ca <
|
|
1668
|
+
elif self._raiser and not (ca < _EPS0 or ca > _1EPS): # PYCHOK no cover
|
|
1669
1669
|
# intersection at c1 or c2 or at c1 or c2 and s1 or s2
|
|
1670
|
-
sa = (cx
|
|
1671
|
-
e
|
|
1670
|
+
sa = fdot_(cx, dy, -cy, dx) / d
|
|
1671
|
+
e = 2 if sa < _EPS0 or sa > _1EPS else 3
|
|
1672
1672
|
raise self._Error(e, c1, c2, ca=ca)
|
|
1673
1673
|
|
|
1674
1674
|
elif parallel and (sx or sy) and (cx or cy): # PYCHOK no cover
|
|
1675
1675
|
# non-null, parallel or colinear edges
|
|
1676
1676
|
sa1, d1 = self._alpha2(c1_x - x, c1_y - y, sx, sy)
|
|
1677
1677
|
sa2, d2 = self._alpha2(c2.x - x, c2.y - y, sx, sy)
|
|
1678
|
-
if max(d1, d2) <
|
|
1679
|
-
if self._xtend and not _outside(sa1, sa2,
|
|
1678
|
+
if max(d1, d2) < _0EPS:
|
|
1679
|
+
if self._xtend and not _outside(sa1, sa2, _EPS0, _1EPS):
|
|
1680
1680
|
if sa1 > sa2: # anti-parallel
|
|
1681
1681
|
sa1, sa2 = sa2, sa1
|
|
1682
1682
|
ca1, ca2 = _1_0, _0_0
|
|
@@ -1694,7 +1694,7 @@ class _EdgeGH(object):
|
|
|
1694
1694
|
yield (y + sy), (x + sx), ca2, _alpha1(ca2 - ca)
|
|
1695
1695
|
else: # c2 is between s1 and s2
|
|
1696
1696
|
yield (y + sa2 * sy), (x + sa2 * sx), sa2, ca2
|
|
1697
|
-
elif self._raiser and not _outside(sa1, sa2, _0_0,
|
|
1697
|
+
elif self._raiser and not _outside(sa1, sa2, _0_0, _1EPS):
|
|
1698
1698
|
raise self._Error(4, c1, c2, d1=d1, d2=d2)
|
|
1699
1699
|
|
|
1700
1700
|
|
|
@@ -1887,9 +1887,9 @@ class BooleanGH(_CompositeGH, _BooleanBase):
|
|
|
1887
1887
|
return self._boolean(other, True, False, self.__sub__)
|
|
1888
1888
|
|
|
1889
1889
|
|
|
1890
|
-
def _alpha1(alpha):
|
|
1890
|
+
def _alpha1(alpha): # PYCHOK no cover
|
|
1891
1891
|
# Return C{alpha} in C{[0..1]} range
|
|
1892
|
-
if
|
|
1892
|
+
if _EPS0 < alpha < _1EPS:
|
|
1893
1893
|
return max(_0_0, min(alpha, _1_0))
|
|
1894
1894
|
t = _not_(Fmt.SQUARE(_ELLIPSIS_(0, 1)))
|
|
1895
1895
|
raise ClipError(_alpha_, alpha, txt=t)
|
|
@@ -1899,8 +1899,8 @@ def _alpha4(a):
|
|
|
1899
1899
|
# Return 4-tuple (alpha, -EPS < alpha < EPS,
|
|
1900
1900
|
# 0 < alpha < 1,
|
|
1901
1901
|
# not 0 < alpha < 1)
|
|
1902
|
-
a_EPS = bool(
|
|
1903
|
-
a_0_1 = bool(
|
|
1902
|
+
a_EPS = bool(_EPS0 < a < _0EPS)
|
|
1903
|
+
a_0_1 = bool(_0EPS < a < _EPS1)
|
|
1904
1904
|
return a, a_EPS, a_0_1, (not a_0_1)
|
|
1905
1905
|
|
|
1906
1906
|
|
pygeodesy/cartesianBase.py
CHANGED
|
@@ -43,7 +43,7 @@ from pygeodesy.vector3d import Vector3d, _xyzhdlln4
|
|
|
43
43
|
# from math import atan2, degrees, fabs, radians, sqrt # from .fmath, .utily
|
|
44
44
|
|
|
45
45
|
__all__ = _ALL_LAZY.cartesianBase
|
|
46
|
-
__version__ = '24.
|
|
46
|
+
__version__ = '24.11.06'
|
|
47
47
|
|
|
48
48
|
_r_ = 'r'
|
|
49
49
|
_theta_ = 'theta'
|
|
@@ -186,7 +186,7 @@ class CartesianBase(Vector3d):
|
|
|
186
186
|
or L{Local9Tuple}).
|
|
187
187
|
@kwarg Cartesian: Optional (geocentric) class to return the destination
|
|
188
188
|
or C{None}.
|
|
189
|
-
@kwarg name_Cartesian_kwds: Optional C{B{name}=NN} (C{str}) and
|
|
189
|
+
@kwarg name_Cartesian_kwds: Optional C{B{name}=NN} (C{str}) and optionally,
|
|
190
190
|
additional B{C{Cartesian}} keyword arguments, ignored if
|
|
191
191
|
C{B{Cartesian} is None}.
|
|
192
192
|
|
|
@@ -768,7 +768,7 @@ class CartesianBase(Vector3d):
|
|
|
768
768
|
(C{Nvector}) or C{None}.
|
|
769
769
|
@kwarg datum: Optional datum (L{Datum}, L{Ellipsoid}, L{Ellipsoid2}
|
|
770
770
|
or L{a_f2Tuple}) overriding this cartesian's datum.
|
|
771
|
-
@kwarg name_Nvector_kwds: Optional C{B{name}=NN} (C{str}) and
|
|
771
|
+
@kwarg name_Nvector_kwds: Optional C{B{name}=NN} (C{str}) and optionally,
|
|
772
772
|
additional B{C{Nvector}} keyword arguments, ignored if
|
|
773
773
|
C{B{Nvector} is None}.
|
|
774
774
|
|
|
@@ -940,8 +940,8 @@ def rtp2xyz_(r_rtp, theta=0, phi=0, **name_Cartesian_and_kwds):
|
|
|
940
940
|
@arg theta: Inclination B{C{theta}} (C{radians} with respect to the positive z-axis),
|
|
941
941
|
required if C{B{r_rtp}} is C{scalar}, ignored otherwise.
|
|
942
942
|
@arg phi: Azimuthal angle B{C{phi}} (C{radians}), like B{C{theta}}.
|
|
943
|
-
@kwarg name_Cartesian_and_kwds: Optional C{B{name}=NN} (C{str}),
|
|
944
|
-
class to return the coordinates and
|
|
943
|
+
@kwarg name_Cartesian_and_kwds: Optional C{B{name}=NN} (C{str}), C{B{Cartesian}=None}
|
|
944
|
+
class to return the coordinates and optionally, additional C{B{Cartesian}}
|
|
945
945
|
keyword arguments.
|
|
946
946
|
|
|
947
947
|
@return: A C{B{Cartesian}(x, y, z)} instance or if no C{B{Cartesian}} keyword argument
|
pygeodesy/constants.py
CHANGED
|
@@ -10,10 +10,10 @@ L{pygeodesy.isnon0} and L{pygeodesy.remainder}.
|
|
|
10
10
|
# make sure int/int division yields float quotient, see .basics
|
|
11
11
|
from __future__ import division as _; del _ # PYCHOK semicolon
|
|
12
12
|
|
|
13
|
-
from pygeodesy.basics import _copysign, isbool, iscomplex, isint
|
|
13
|
+
from pygeodesy.basics import _copysign, isbool, iscomplex, isint
|
|
14
14
|
from pygeodesy.errors import _xError, _xError2, _xkwds_get1, _xkwds_item2
|
|
15
15
|
# from pygeodesy.fsums import _isFsum_2Tuple # _MODS
|
|
16
|
-
|
|
16
|
+
from pygeodesy.internals import _0_0, _100_0
|
|
17
17
|
from pygeodesy.interns import _INF_, _NAN_, _UNDER_
|
|
18
18
|
from pygeodesy.lazily import _ALL_MODS as _MODS, _ALL_LAZY
|
|
19
19
|
# from pygeodesy.streprs import Fmt # from .unitsBase
|
|
@@ -26,7 +26,7 @@ except ImportError: # Python 2-
|
|
|
26
26
|
_inf, _nan = float(_INF_), float(_NAN_)
|
|
27
27
|
|
|
28
28
|
__all__ = _ALL_LAZY.constants
|
|
29
|
-
__version__ = '24.
|
|
29
|
+
__version__ = '24.11.06'
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
def _copysign_0_0(y):
|
|
@@ -185,7 +185,7 @@ _32_0 = _float( 32) # PYCHOK expected
|
|
|
185
185
|
_60_0 = _float( 60) # PYCHOK expected
|
|
186
186
|
_64_0 = _float( 64) # PYCHOK expected
|
|
187
187
|
_90_0 = _float( 90) # PYCHOK expected
|
|
188
|
-
_100_0 = _float(
|
|
188
|
+
_100_0 = _float(_100_0) # PYCHOK expected
|
|
189
189
|
_180_0 = _float( 180) # PYCHOK expected
|
|
190
190
|
_270_0 = _float( 270) # PYCHOK expected
|
|
191
191
|
_360_0 = _float( 360) # PYCHOK expected
|
pygeodesy/css.py
CHANGED
|
@@ -33,7 +33,7 @@ from pygeodesy.units import Azimuth, Degrees, Easting, Height, _heigHt, \
|
|
|
33
33
|
# from math import fabs # from .karney
|
|
34
34
|
|
|
35
35
|
__all__ = _ALL_LAZY.css
|
|
36
|
-
__version__ = '24.
|
|
36
|
+
__version__ = '24.11.06'
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
def _CS0(cs0):
|
|
@@ -313,16 +313,15 @@ class CassiniSoldner(_NamedBase):
|
|
|
313
313
|
self._sb0, self._cb0 = _norm2(s * g.f1, c)
|
|
314
314
|
|
|
315
315
|
def reverse(self, easting, northing, LatLon=None, **name_LatLon_kwds):
|
|
316
|
-
'''Convert a Cassini-Soldner location to (ellipsoidal) geodetic
|
|
317
|
-
lat- and longitude.
|
|
316
|
+
'''Convert a Cassini-Soldner location to (ellipsoidal) geodetic lat- and longitude.
|
|
318
317
|
|
|
319
318
|
@arg easting: Easting of the location (C{meter}).
|
|
320
319
|
@arg northing: Northing of the location (C{meter}).
|
|
321
|
-
@kwarg LatLon: Optional, ellipsoidal class to return the geodetic
|
|
322
|
-
|
|
323
|
-
@kwarg name_LatLon_kwds: Optional name C{B{name}=NN} (C{str}) and
|
|
324
|
-
|
|
325
|
-
|
|
320
|
+
@kwarg LatLon: Optional, ellipsoidal class to return the geodetic location as
|
|
321
|
+
(C{LatLon}) or C{None}.
|
|
322
|
+
@kwarg name_LatLon_kwds: Optional name C{B{name}=NN} (C{str}) and optionally,
|
|
323
|
+
additional B{C{LatLon}} keyword arguments, ignored if C{B{LatLon}
|
|
324
|
+
is None}.
|
|
326
325
|
|
|
327
326
|
@return: Geodetic location B{C{LatLon}} or if C{B{LatLon} is None},
|
|
328
327
|
a L{LatLon2Tuple}C{(lat, lon)}.
|
pygeodesy/deprecated/__init__.py
CHANGED
|
@@ -27,7 +27,7 @@ __all__ = (_ALL_DEPRECATED.deprecated_bases +
|
|
|
27
27
|
_ALL_DEPRECATED.deprecated_classes +
|
|
28
28
|
_ALL_DEPRECATED.deprecated_consterns +
|
|
29
29
|
_ALL_DEPRECATED.deprecated_functions)
|
|
30
|
-
__version__ = '24.
|
|
30
|
+
__version__ = '24.11.07'
|
|
31
31
|
|
|
32
32
|
if _unLazy0:
|
|
33
33
|
from pygeodesy.deprecated import bases, datum, nvector, rhumbBase, \
|
pygeodesy/deprecated/classes.py
CHANGED
|
@@ -22,7 +22,7 @@ from pygeodesy.trf import TRFXform7Tuple as _TRFXform7Tuple
|
|
|
22
22
|
from pygeodesy.units import Bearing, Int, Lamd, Lat, Lon, Meter, Phid
|
|
23
23
|
|
|
24
24
|
__all__ = _ALL_DEPRECATED.deprecated_classes
|
|
25
|
-
__version__ = '24.07
|
|
25
|
+
__version__ = '24.11.07'
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
class _Deprecated_NamedTuple(_NamedTuple):
|
|
@@ -153,7 +153,7 @@ def HeightIDW3(knots, **kwds): # PYCHOK no cover
|
|
|
153
153
|
|
|
154
154
|
class Lam_(Lamd):
|
|
155
155
|
'''DEPRECATED on 2024.06.15, use class L{Lamd}.'''
|
|
156
|
-
def __init__(self, *args, **kwds): # PYCHOK
|
|
156
|
+
def __init__(self, *args, **kwds): # PYCHOK no cover
|
|
157
157
|
deprecated_class(self.__class__)
|
|
158
158
|
Lamd.__init__(self, *args, **kwds)
|
|
159
159
|
|
|
@@ -172,7 +172,7 @@ class NearestOn4Tuple(_Deprecated_NamedTuple): # PYCHOK no cover
|
|
|
172
172
|
|
|
173
173
|
class Phi_(Phid):
|
|
174
174
|
'''DEPRECATED on 2024.06.15, use class L{Phid}.'''
|
|
175
|
-
def __init__(self, *args, **kwds): # PYCHOK
|
|
175
|
+
def __init__(self, *args, **kwds): # PYCHOK no cover
|
|
176
176
|
deprecated_class(self.__class__)
|
|
177
177
|
Phid.__init__(self, *args, **kwds)
|
|
178
178
|
|
|
@@ -205,22 +205,22 @@ class Rhumb7Tuple(_Deprecated_NamedTuple):
|
|
|
205
205
|
_Units_ = _Rhumb8Tuple._Units_[:7]
|
|
206
206
|
|
|
207
207
|
@deprecated_method
|
|
208
|
-
def toDirect9Tuple(self, **kwds):
|
|
208
|
+
def toDirect9Tuple(self, **kwds): # PYCHOK no cover
|
|
209
209
|
return self.toRhumb8Tuple().toDirect9Tuple(self, **kwds)
|
|
210
210
|
|
|
211
211
|
@deprecated_method
|
|
212
|
-
def toGDict(self, **kwds):
|
|
212
|
+
def toGDict(self, **kwds): # PYCHOK no cover
|
|
213
213
|
return self.toRhumb8Tuple().toGDict(**kwds)
|
|
214
214
|
|
|
215
215
|
@deprecated_method
|
|
216
|
-
def toInverse10Tuple(self, **kwds):
|
|
216
|
+
def toInverse10Tuple(self, **kwds): # PYCHOK no cover
|
|
217
217
|
return self.toRhumb8Tuple().toInverse10Tuple(self, **kwds)
|
|
218
218
|
|
|
219
219
|
@deprecated_method
|
|
220
|
-
def toRhumb8Tuple(self, dflt=NAN):
|
|
220
|
+
def toRhumb8Tuple(self, dflt=NAN): # PYCHOK no cover
|
|
221
221
|
return _Rhumb8Tuple(self + (dflt,), name=self.name)
|
|
222
222
|
|
|
223
|
-
def _to7Tuple(self):
|
|
223
|
+
def _to7Tuple(self): # PYCHOK no cover
|
|
224
224
|
'''(INTERNAL) see L{Rhumb8Tuple._to7Tuple}.
|
|
225
225
|
'''
|
|
226
226
|
return self
|
|
@@ -266,7 +266,7 @@ class UtmUps4Tuple(_Deprecated_NamedTuple): # PYCHOK no cover
|
|
|
266
266
|
|
|
267
267
|
class XDist(ADict):
|
|
268
268
|
'''DEPRECATED on 2024.07.02, use class L{XDict}.'''
|
|
269
|
-
def __init__(self, *args, **kwds): # PYCHOK
|
|
269
|
+
def __init__(self, *args, **kwds): # PYCHOK no cover
|
|
270
270
|
deprecated_class(self.__class__)
|
|
271
271
|
ADict.__init__(self, *args, **kwds)
|
|
272
272
|
|
|
@@ -14,7 +14,7 @@ from pygeodesy.props import deprecated_function
|
|
|
14
14
|
from pygeodesy.units import Number_, Scalar_
|
|
15
15
|
|
|
16
16
|
__all__ = _ALL_DEPRECATED.deprecated_functions
|
|
17
|
-
__version__ = '24.
|
|
17
|
+
__version__ = '24.11.07'
|
|
18
18
|
|
|
19
19
|
_WGS84 = _UTM = object()
|
|
20
20
|
|
|
@@ -32,7 +32,7 @@ def areaof(points, adjust=True, radius=R_M, wrap=True): # PYCHOK no cover
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
@deprecated_function
|
|
35
|
-
def atand(x):
|
|
35
|
+
def atand(x): # PYCHOK no cover
|
|
36
36
|
'''DEPRECATED on 2023.09.28, use function L{pygeodesy.atan1d}.'''
|
|
37
37
|
return _MODS.utily.atan1d(x)
|
|
38
38
|
|
|
@@ -124,19 +124,19 @@ def equirectangular3(lat1, lon1, lat2, lon2, **options): # PYCHOK no cover
|
|
|
124
124
|
|
|
125
125
|
|
|
126
126
|
@deprecated_function
|
|
127
|
-
def excessAbc(A, b, c):
|
|
127
|
+
def excessAbc(A, b, c): # PYCHOK no cover
|
|
128
128
|
'''DEPRECATED on 2023.04.04, use function L{pygeodesy.excessAbc_}.'''
|
|
129
129
|
return _MODS.formy.excessAbc_(A, b, c)
|
|
130
130
|
|
|
131
131
|
|
|
132
132
|
@deprecated_function
|
|
133
|
-
def excessGirard(A, B, C):
|
|
133
|
+
def excessGirard(A, B, C): # PYCHOK no cover
|
|
134
134
|
'''DEPRECATED on 2023.04.04, use function L{pygeodesy.excessGirard_}.'''
|
|
135
135
|
return _MODS.formy.excessGirard_(A, B, C)
|
|
136
136
|
|
|
137
137
|
|
|
138
138
|
@deprecated_function
|
|
139
|
-
def excessLHuilier(a, b, c):
|
|
139
|
+
def excessLHuilier(a, b, c): # PYCHOK no cover
|
|
140
140
|
'''DEPRECATED on 2023.04.04, use function L{pygeodesy.excessLHuilier_}.'''
|
|
141
141
|
return _MODS.formy.excessLHuilier_(a, b, c)
|
|
142
142
|
|
|
@@ -176,7 +176,7 @@ def falsed2f(falsed=True, Error=ValueError, **name_value): # PYCHOK no cover
|
|
|
176
176
|
|
|
177
177
|
|
|
178
178
|
@deprecated_function
|
|
179
|
-
def float0(*xs):
|
|
179
|
+
def float0(*xs): # PYCHOK no cover
|
|
180
180
|
'''DEPRECATED on 2023.04.21, use function L{pygeodesy.float0_}.'''
|
|
181
181
|
return float0_(*xs)
|
|
182
182
|
|
pygeodesy/ecef.py
CHANGED
|
@@ -86,7 +86,7 @@ from pygeodesy.utily import atan1, atan1d, atan2d, degrees90, degrees180, \
|
|
|
86
86
|
from math import atan2, cos, degrees, fabs, radians, sqrt
|
|
87
87
|
|
|
88
88
|
__all__ = _ALL_LAZY.ecef
|
|
89
|
-
__version__ = '24.
|
|
89
|
+
__version__ = '24.10.28'
|
|
90
90
|
|
|
91
91
|
_Ecef_ = 'Ecef'
|
|
92
92
|
_prolate_ = 'prolate'
|
|
@@ -383,8 +383,8 @@ class EcefFarrell21(_EcefBase):
|
|
|
383
383
|
lon = self._polon(y, x, p, **lon00_name)
|
|
384
384
|
# note, phi and lam are swapped on page 29
|
|
385
385
|
|
|
386
|
-
except (ValueError, ZeroDivisionError) as
|
|
387
|
-
raise EcefError(x=x, y=y, z=z, cause=
|
|
386
|
+
except (ValueError, ZeroDivisionError) as X:
|
|
387
|
+
raise EcefError(x=x, y=y, z=z, cause=X)
|
|
388
388
|
|
|
389
389
|
return Ecef9Tuple(x, y, z, lat, lon, h,
|
|
390
390
|
1, None, self.datum,
|
|
@@ -638,9 +638,8 @@ class EcefSudano(_EcefBase):
|
|
|
638
638
|
R = hypot(x, y) # Rh
|
|
639
639
|
d = e - R
|
|
640
640
|
|
|
641
|
-
_a = fabs
|
|
642
641
|
lat = atan1d(z, R * E.e21)
|
|
643
|
-
sa, ca = sincos2d(
|
|
642
|
+
sa, ca = sincos2d(fabs(lat))
|
|
644
643
|
# Sudano's Eq (A-6) and (A-7) refactored/reduced,
|
|
645
644
|
# replacing Rn from Eq (A-4) with n = E.a / ca:
|
|
646
645
|
# N = ca**2 * ((z + E.e2 * n * sa) * ca - R * sa)
|
|
@@ -650,32 +649,30 @@ class EcefSudano(_EcefBase):
|
|
|
650
649
|
# = ca**2 * (E.e2 * E.a / E.e2s2(sa) - R / ca**2)
|
|
651
650
|
# N / D = (z * ca + (E.e2 * E.a - R) * sa) /
|
|
652
651
|
# (E.e2 * E.a / E.e2s2(sa) - R / ca**2)
|
|
653
|
-
_E = EPS_2
|
|
654
652
|
tol = self.tolerance
|
|
655
653
|
_S2 = Fsum(sa).fsum2f_
|
|
656
|
-
_rt = sqrt
|
|
657
654
|
for i in range(1, _TRIPS):
|
|
658
655
|
ca2 = _1_0 - sa**2
|
|
659
|
-
if ca2 <
|
|
656
|
+
if ca2 < EPS_2: # PYCHOK no cover
|
|
660
657
|
ca = _0_0
|
|
661
658
|
break
|
|
662
|
-
ca =
|
|
659
|
+
ca = sqrt(ca2)
|
|
663
660
|
r = e / E.e2s2(sa) - R / ca2
|
|
664
|
-
if
|
|
661
|
+
if fabs(r) < EPS_2:
|
|
665
662
|
break
|
|
666
663
|
lat = None
|
|
667
|
-
sa,
|
|
668
|
-
if
|
|
664
|
+
sa, t = _S2(-z * ca / r, -d * sa / r)
|
|
665
|
+
if fabs(t) < tol:
|
|
669
666
|
break
|
|
670
667
|
else:
|
|
671
668
|
t = unstr(self.reverse, x=x, y=y, z=z)
|
|
672
669
|
raise EcefError(t, txt=Fmt.no_convergence(r, tol))
|
|
673
670
|
|
|
674
671
|
if lat is None:
|
|
675
|
-
lat = copysign0(atan1d(
|
|
672
|
+
lat = copysign0(atan1d(fabs(sa), ca), z)
|
|
676
673
|
lon = self._polon(y, x, R, **lon00_name)
|
|
677
674
|
|
|
678
|
-
h = fsumf_(R * ca,
|
|
675
|
+
h = fsumf_(R * ca, fabs(z * sa), -E.a * E.e2s(sa)) # use Veness'
|
|
679
676
|
# because Sudano's Eq (7) doesn't produce the correct height
|
|
680
677
|
# h = (fabs(z) + R - E.a * cos(a + E.e21) * sa / ca) / (ca + sa)
|
|
681
678
|
return Ecef9Tuple(x, y, z, lat, lon, h,
|