pygeodesy 24.5.15__py2.py3-none-any.whl → 24.5.24__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.5.15.dist-info → PyGeodesy-24.5.24.dist-info}/METADATA +2 -2
- PyGeodesy-24.5.24.dist-info/RECORD +116 -0
- pygeodesy/__init__.py +1 -1
- pygeodesy/albers.py +41 -41
- pygeodesy/auxilats/__init__.py +1 -1
- pygeodesy/auxilats/auxAngle.py +32 -31
- pygeodesy/auxilats/auxLat.py +80 -51
- pygeodesy/azimuthal.py +123 -124
- pygeodesy/basics.py +8 -6
- pygeodesy/booleans.py +11 -12
- pygeodesy/cartesianBase.py +25 -23
- pygeodesy/clipy.py +3 -3
- pygeodesy/css.py +50 -42
- pygeodesy/datums.py +42 -41
- pygeodesy/dms.py +6 -6
- pygeodesy/ecef.py +23 -24
- pygeodesy/ellipsoidalBase.py +28 -27
- pygeodesy/ellipsoidalBaseDI.py +3 -4
- pygeodesy/ellipsoidalNvector.py +11 -12
- pygeodesy/ellipsoids.py +41 -35
- pygeodesy/elliptic.py +3 -4
- pygeodesy/epsg.py +4 -3
- pygeodesy/errors.py +34 -12
- pygeodesy/etm.py +62 -54
- pygeodesy/fmath.py +36 -30
- pygeodesy/formy.py +93 -65
- pygeodesy/frechet.py +117 -102
- pygeodesy/fstats.py +21 -14
- pygeodesy/fsums.py +67 -57
- pygeodesy/gars.py +10 -9
- pygeodesy/geodesicw.py +19 -17
- pygeodesy/geodesicx/__init__.py +1 -1
- pygeodesy/geodesicx/gx.py +40 -32
- pygeodesy/geodesicx/gxarea.py +12 -9
- pygeodesy/geodesicx/gxbases.py +3 -4
- pygeodesy/geodesicx/gxline.py +6 -8
- pygeodesy/geodsolve.py +28 -27
- pygeodesy/geohash.py +47 -44
- pygeodesy/geoids.py +34 -32
- pygeodesy/hausdorff.py +112 -99
- pygeodesy/heights.py +134 -127
- pygeodesy/internals.py +14 -9
- pygeodesy/interns.py +3 -6
- pygeodesy/iters.py +19 -17
- pygeodesy/karney.py +15 -12
- pygeodesy/ktm.py +25 -18
- pygeodesy/latlonBase.py +12 -11
- pygeodesy/lazily.py +4 -4
- pygeodesy/lcc.py +24 -25
- pygeodesy/ltp.py +83 -71
- pygeodesy/ltpTuples.py +7 -5
- pygeodesy/mgrs.py +3 -3
- pygeodesy/named.py +126 -42
- pygeodesy/namedTuples.py +33 -25
- pygeodesy/nvectorBase.py +7 -7
- pygeodesy/points.py +9 -9
- pygeodesy/rhumb/__init__.py +1 -1
- pygeodesy/solveBase.py +5 -5
- pygeodesy/sphericalTrigonometry.py +5 -5
- pygeodesy/streprs.py +5 -5
- pygeodesy/trf.py +5 -5
- pygeodesy/triaxials.py +67 -63
- pygeodesy/units.py +35 -35
- pygeodesy/unitsBase.py +24 -11
- pygeodesy/utm.py +53 -53
- pygeodesy/utmupsBase.py +10 -8
- pygeodesy/vector2d.py +6 -7
- pygeodesy/vector3d.py +16 -17
- pygeodesy/vector3dBase.py +4 -5
- PyGeodesy-24.5.15.dist-info/RECORD +0 -116
- {PyGeodesy-24.5.15.dist-info → PyGeodesy-24.5.24.dist-info}/WHEEL +0 -0
- {PyGeodesy-24.5.15.dist-info → PyGeodesy-24.5.24.dist-info}/top_level.txt +0 -0
pygeodesy/auxilats/auxLat.py
CHANGED
|
@@ -22,16 +22,17 @@ from pygeodesy.basics import _reverange, _xinstanceof, _passarg
|
|
|
22
22
|
from pygeodesy.constants import INF, MAX_EXP, MIN_EXP, NAN, PI_2, PI_4, _EPSqrt, \
|
|
23
23
|
_0_0, _0_0s, _0_1, _0_25, _0_5, _1_0, _2_0, _3_0, \
|
|
24
24
|
_360_0, isfinite, isinf, isnan, _log2, _over
|
|
25
|
-
from pygeodesy.datums import _ellipsoidal_datum, _WGS84, Ellipsoid
|
|
25
|
+
from pygeodesy.datums import _ellipsoidal_datum, _WGS84, Ellipsoid, _name__
|
|
26
26
|
# from pygeodesy.ellipsoids import Ellipsoid # from .datums
|
|
27
27
|
from pygeodesy.elliptic import Elliptic as _Ef
|
|
28
|
-
from pygeodesy.errors import AuxError,
|
|
28
|
+
from pygeodesy.errors import AuxError, _xkwds_not, _xkwds_pop2, _Xorder
|
|
29
29
|
# from pygeodesy.fmath import cbrt # from .karney
|
|
30
30
|
from pygeodesy.fsums import Fsum, _Fsumf_, _sum
|
|
31
|
-
from pygeodesy.karney import _2cos2x, _polynomial, _ALL_DOCS, cbrt, _MODS
|
|
32
31
|
# from pygeodesy.internals import _passarg # from .basics
|
|
33
|
-
from pygeodesy.interns import NN, _DOT_, _UNDER_
|
|
32
|
+
from pygeodesy.interns import NN, _DOT_, _not_scalar_, _UNDER_
|
|
33
|
+
from pygeodesy.karney import _2cos2x, _polynomial, _ALL_DOCS, cbrt, _MODS
|
|
34
34
|
# from pygeodesy.lazily import _ALL_DOCS, _ALL_MODS as _MODS # from .karney
|
|
35
|
+
# from pygeodesy.named import _name__ # from .datums
|
|
35
36
|
from pygeodesy.props import Property, Property_RO, _update_all
|
|
36
37
|
from pygeodesy.units import _isDegrees, _isRadius, Degrees, Meter
|
|
37
38
|
# from pygeodesy.utily import atan1 # from .auxily
|
|
@@ -45,7 +46,7 @@ except ImportError: # Python 3.11-
|
|
|
45
46
|
return pow(_2_0, x)
|
|
46
47
|
|
|
47
48
|
__all__ = ()
|
|
48
|
-
__version__ = '24.
|
|
49
|
+
__version__ = '24.05.24'
|
|
49
50
|
|
|
50
51
|
_TRIPS = 1024 # XXX 2 or 3?
|
|
51
52
|
|
|
@@ -67,7 +68,7 @@ class AuxLat(AuxAngle):
|
|
|
67
68
|
# _Lmax = 0 # overwritten below
|
|
68
69
|
_mAL = 6 # 4, 6 or 8 aka Lmax
|
|
69
70
|
|
|
70
|
-
def __init__(self, a_earth=_WGS84, f=None, b=None,
|
|
71
|
+
def __init__(self, a_earth=_WGS84, f=None, b=None, **ALorder_name):
|
|
71
72
|
'''New L{AuxLat} instance on an ellipsoid or datum.
|
|
72
73
|
|
|
73
74
|
@arg a_earth: Equatorial radius, semi-axis (C{meter}) or an
|
|
@@ -78,28 +79,35 @@ class AuxLat(AuxAngle):
|
|
|
78
79
|
@kwarg b: Optional polar radius, semi-axis (C{meter}, same
|
|
79
80
|
units as B{C{a_earth}}), ignored if B{C{a_earth}}
|
|
80
81
|
is not scalar.
|
|
81
|
-
@kwarg
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
@kwarg name: Optional name (C{str}).
|
|
82
|
+
@kwarg ALorder_name: Optional C{B{name}=NN} (C{str}) and optional
|
|
83
|
+
keyword argument C{B{ALorder}=6} for the order of
|
|
84
|
+
this L{AuxLat}, see property C{ALorder}.
|
|
85
85
|
'''
|
|
86
|
-
if
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
if ALorder_name:
|
|
87
|
+
M = self._mAL
|
|
88
|
+
m, name = _xkwds_pop2(ALorder_name, ALorder=M)
|
|
89
|
+
if m != M:
|
|
90
|
+
self.ALorder = m
|
|
91
|
+
else:
|
|
92
|
+
name = NN
|
|
93
|
+
try:
|
|
94
|
+
if a_earth is not _WGS84:
|
|
95
|
+
n = _name__(name, name__=AuxLat)
|
|
89
96
|
if b is f is None:
|
|
90
97
|
E = _ellipsoidal_datum(a_earth, name=n).ellipsoid # XXX raiser=_earth_
|
|
91
98
|
elif _isRadius(a_earth):
|
|
92
|
-
E = Ellipsoid(a_earth, f=f, b=b, name=_UNDER_(n))
|
|
99
|
+
E = Ellipsoid(a_earth, f=f, b=b, name=_UNDER_(NN, n))
|
|
93
100
|
else:
|
|
94
|
-
raise ValueError()
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
101
|
+
raise ValueError(_not_scalar_)
|
|
102
|
+
self._E = E
|
|
103
|
+
elif not (b is f is None):
|
|
104
|
+
# _UnexpectedError into AuxError
|
|
105
|
+
name = _name__(name, **_xkwds_not(None, b=b, f=f))
|
|
98
106
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
107
|
+
if name:
|
|
108
|
+
self.name = name
|
|
109
|
+
except Exception as x:
|
|
110
|
+
raise AuxError(a_earth=a_earth, f=f, b=b, cause=x)
|
|
103
111
|
|
|
104
112
|
@Property_RO
|
|
105
113
|
def a(self):
|
|
@@ -137,6 +145,8 @@ class AuxLat(AuxAngle):
|
|
|
137
145
|
'''Convert I{Geographic} to I{Aunthalic} latitude.
|
|
138
146
|
|
|
139
147
|
@arg Phi: Geographic latitude (L{AuxAngle}).
|
|
148
|
+
@kwarg diff_name: Use C{B{diff}=True} to set C{diff}
|
|
149
|
+
optional C{B{name}=NN}.
|
|
140
150
|
|
|
141
151
|
@return: Parametric latitude, C{Beta} (L{AuxAngle}).
|
|
142
152
|
'''
|
|
@@ -144,15 +154,15 @@ class AuxLat(AuxAngle):
|
|
|
144
154
|
# assert Phi._AUX == Aux.PHI
|
|
145
155
|
tphi = fabs(Phi.tan)
|
|
146
156
|
if isfinite(tphi) and tphi and self.f:
|
|
147
|
-
y, x =
|
|
148
|
-
q =
|
|
149
|
-
qv =
|
|
150
|
-
Dq2 =
|
|
157
|
+
y, x = Phi._yx_normalized
|
|
158
|
+
q = self._q
|
|
159
|
+
qv = self._qf(tphi)
|
|
160
|
+
Dq2 = self._Dq(tphi)
|
|
151
161
|
Dq2 *= (q + qv) / (fabs(y) + _1_0) # _Dq(-tphi)
|
|
152
|
-
|
|
153
|
-
|
|
162
|
+
d, n = _diff_name2(Phi, **diff_name)
|
|
163
|
+
Xi = AuxXi(copysign(qv, Phi.y), x * sqrt(Dq2), name=n)
|
|
154
164
|
|
|
155
|
-
if
|
|
165
|
+
if d:
|
|
156
166
|
if isnan(tphi):
|
|
157
167
|
d = self._e2m1_sq2
|
|
158
168
|
else:
|
|
@@ -247,6 +257,8 @@ class AuxLat(AuxAngle):
|
|
|
247
257
|
'''Convert I{Geographic} to I{Conformal} latitude.
|
|
248
258
|
|
|
249
259
|
@arg Phi: Geographic latitude (L{AuxAngle}).
|
|
260
|
+
@kwarg diff_name: Use C{B{diff}=True} to set C{diff}
|
|
261
|
+
and an optional C{B{name}=NN}.
|
|
250
262
|
|
|
251
263
|
@return: Conformal latitude, C{Chi} (L{AuxAngle}).
|
|
252
264
|
'''
|
|
@@ -300,10 +312,10 @@ class AuxLat(AuxAngle):
|
|
|
300
312
|
else:
|
|
301
313
|
tchi = tphi * scsig - sig * scphi
|
|
302
314
|
|
|
303
|
-
n =
|
|
304
|
-
Chi
|
|
315
|
+
d, n = _diff_name2(Phi, **diff_name)
|
|
316
|
+
Chi = AuxChi(tchi, name=n).copyquadrant(Phi)
|
|
305
317
|
|
|
306
|
-
if
|
|
318
|
+
if d:
|
|
307
319
|
if isinf(tphi): # PYCHOK np cover
|
|
308
320
|
d = self._conformal_diff
|
|
309
321
|
else:
|
|
@@ -459,12 +471,13 @@ class AuxLat(AuxAngle):
|
|
|
459
471
|
'''Convert I{Auxiliary} to I{Geographic} latitude.
|
|
460
472
|
|
|
461
473
|
@arg Zeta: Auxiliary latitude (L{AuxAngle}).
|
|
474
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
462
475
|
|
|
463
476
|
@return: Geographic latitude, I{Phi} (L{AuxAngle}).
|
|
464
477
|
'''
|
|
465
478
|
_xinstanceof(AuxAngle, Zeta=Zeta)
|
|
466
479
|
aux = Zeta._AUX
|
|
467
|
-
n =
|
|
480
|
+
n = _name__(name, _or_nameof=Zeta)
|
|
468
481
|
f = self._fromAuxCase.get(aux, None)
|
|
469
482
|
if f is None:
|
|
470
483
|
Phi = AuxPhi(NAN, name=n)
|
|
@@ -493,27 +506,31 @@ class AuxLat(AuxAngle):
|
|
|
493
506
|
'''Convert I{Geographic} to I{Geocentric} latitude.
|
|
494
507
|
|
|
495
508
|
@arg Phi: Geographic latitude (L{AuxAngle}).
|
|
509
|
+
@kwarg diff_name: Use C{B{diff}=True} to set C{diff}
|
|
510
|
+
and an optional C{B{name}=NN}.
|
|
496
511
|
|
|
497
512
|
@return: Geocentric latitude, C{Phi} (L{AuxAngle}).
|
|
498
513
|
'''
|
|
499
514
|
_xinstanceof(AuxAngle, Phi=Phi)
|
|
500
515
|
# assert Phi._AUX == Aux.PHI
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
if
|
|
516
|
+
d, n = _diff_name2(Phi, **diff_name)
|
|
517
|
+
Theta = AuxTheta(Phi.y * self._e2m1, Phi.x, name=n)
|
|
518
|
+
if d:
|
|
504
519
|
Theta._diff = self._e2m1
|
|
505
520
|
return Theta
|
|
506
521
|
|
|
507
|
-
def Geodetic(self, Phi, **
|
|
522
|
+
def Geodetic(self, Phi, **name): # PYCHOK no cover
|
|
508
523
|
'''Convert I{Geographic} to I{Geodetic} latitude.
|
|
509
524
|
|
|
510
525
|
@arg Phi: Geographic latitude (L{AuxAngle}).
|
|
526
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
511
527
|
|
|
512
528
|
@return: Geodetic latitude, C{Phi} (L{AuxAngle}).
|
|
513
529
|
'''
|
|
514
530
|
_xinstanceof(AuxAngle, Phi=Phi)
|
|
515
531
|
# assert Phi._AUX == Aux.PHI
|
|
516
|
-
|
|
532
|
+
_, n = _diff_name2(Phi, **name)
|
|
533
|
+
return AuxPhi(Phi, name=n)
|
|
517
534
|
|
|
518
535
|
@Property_RO
|
|
519
536
|
def _n(self): # 3rd flattening
|
|
@@ -527,14 +544,16 @@ class AuxLat(AuxAngle):
|
|
|
527
544
|
'''Convert I{Geographic} to I{Parametric} latitude.
|
|
528
545
|
|
|
529
546
|
@arg Phi: Geographic latitude (L{AuxAngle}).
|
|
547
|
+
@kwarg diff_name: Use C{B{diff}=True} to set C{diff}
|
|
548
|
+
and an optional C{B{name}=NN}.
|
|
530
549
|
|
|
531
550
|
@return: Parametric latitude, C{Beta} (L{AuxAngle}).
|
|
532
551
|
'''
|
|
533
552
|
_xinstanceof(AuxAngle, Phi=Phi)
|
|
534
553
|
# assert Phi._AUX == Aux.PHI
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
if
|
|
554
|
+
d, n = _diff_name2(Phi, **diff_name)
|
|
555
|
+
Beta = AuxBeta(Phi.y * self._fm1, Phi.x, name=n)
|
|
556
|
+
if d:
|
|
538
557
|
Beta._diff = self._fm1
|
|
539
558
|
return Beta
|
|
540
559
|
|
|
@@ -584,6 +603,8 @@ class AuxLat(AuxAngle):
|
|
|
584
603
|
'''Convert I{Geographic} to I{Rectifying} latitude.
|
|
585
604
|
|
|
586
605
|
@arg Phi: Geographic latitude (L{AuxAngle}).
|
|
606
|
+
@kwarg diff_name: Use C{B{diff}=True} to set C{diff}
|
|
607
|
+
and an optional C{B{name}=NN}.
|
|
587
608
|
|
|
588
609
|
@return: Rectifying latitude, C{Mu} (L{AuxAngle}).
|
|
589
610
|
'''
|
|
@@ -625,11 +646,10 @@ class AuxLat(AuxAngle):
|
|
|
625
646
|
mx = sin(mx / mr) # XXX zero?
|
|
626
647
|
else: # zero Mu
|
|
627
648
|
my, mx = _0_0, _1_0
|
|
628
|
-
n
|
|
629
|
-
Mu
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
if _xkwds_get(diff_name, diff=False):
|
|
649
|
+
d, n = _diff_name2(Phi, **diff_name)
|
|
650
|
+
Mu = AuxMu(my, mx, # normalized
|
|
651
|
+
name=n).copyquadrant(Phi)
|
|
652
|
+
if d:
|
|
633
653
|
d, x = _0_0, Beta._x_normalized
|
|
634
654
|
if x and mr:
|
|
635
655
|
if Mu.x and Phi.x and not isinf(Phi.tan):
|
|
@@ -650,7 +670,7 @@ class AuxLat(AuxAngle):
|
|
|
650
670
|
as the ellipsoid axes).
|
|
651
671
|
'''
|
|
652
672
|
r = self._Ef_fRG_a2b2_PI_4 if exact else self._RectifyingR
|
|
653
|
-
return Meter(r,
|
|
673
|
+
return Meter(r, name__=self.RectifyingRadius)
|
|
654
674
|
|
|
655
675
|
@Property_RO
|
|
656
676
|
def _RectifyingR(self):
|
|
@@ -666,15 +686,17 @@ class AuxLat(AuxAngle):
|
|
|
666
686
|
|
|
667
687
|
@arg auxout: I{Auxiliary} kind (C{Aux.KIND}).
|
|
668
688
|
@arg Phi: Geographic latitude (L{AuxLat}).
|
|
689
|
+
@kwarg diff_name: Use C{B{diff}=True} to set C{diff}
|
|
690
|
+
and an optional C{B{name}=NN}.
|
|
669
691
|
|
|
670
692
|
@return: Auxiliary latitude, I{Eta} (L{AuxLat}).
|
|
671
693
|
'''
|
|
672
694
|
_xinstanceof(AuxAngle, Phi=Phi)
|
|
673
695
|
# assert Phi._AUX == Aux.PHI
|
|
674
|
-
n =
|
|
675
|
-
m
|
|
696
|
+
d, n = _diff_name2(Phi, **diff_name)
|
|
697
|
+
m = _toAuxCase.get(auxout, None)
|
|
676
698
|
if m: # callable
|
|
677
|
-
A = m(self, Phi,
|
|
699
|
+
A = m(self, Phi, diff=d, name=n)
|
|
678
700
|
elif auxout == Aux.GEODETIC: # == GEOGRAPHIC
|
|
679
701
|
A = AuxPhi(Phi, name=n)
|
|
680
702
|
else: # auxout?
|
|
@@ -756,8 +778,15 @@ def _CXcoeffs(aL): # PYCHOK in .auxilats.__main__
|
|
|
756
778
|
return _coeffs
|
|
757
779
|
|
|
758
780
|
|
|
781
|
+
def _diff_name2(Phi, diff=False, **name):
|
|
782
|
+
'''(INTERNAL) Get C{{Bdiff}=False} and C{B{name}=NN}.
|
|
783
|
+
'''
|
|
784
|
+
n = _name__(name, _or_nameof=Phi) # if name else Phi.name
|
|
785
|
+
return diff, n
|
|
786
|
+
|
|
787
|
+
|
|
759
788
|
def _Newton(tphi, Zeta, _toZeta, **name):
|
|
760
|
-
# Newton's method
|
|
789
|
+
# Newton's method from AuxLat._fromAux
|
|
761
790
|
try:
|
|
762
791
|
_lg2 = _log2
|
|
763
792
|
_abs = fabs
|