pygeodesy 24.5.8__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.8.dist-info → PyGeodesy-24.5.24.dist-info}/METADATA +2 -2
- PyGeodesy-24.5.24.dist-info/RECORD +116 -0
- pygeodesy/__init__.py +16 -12
- pygeodesy/__main__.py +9 -10
- pygeodesy/albers.py +42 -42
- pygeodesy/auxilats/__init__.py +1 -1
- pygeodesy/auxilats/__main__.py +7 -10
- pygeodesy/auxilats/auxAngle.py +32 -31
- pygeodesy/auxilats/auxLat.py +81 -51
- pygeodesy/azimuthal.py +123 -124
- pygeodesy/basics.py +165 -176
- pygeodesy/booleans.py +14 -15
- pygeodesy/cartesianBase.py +25 -23
- pygeodesy/clipy.py +3 -3
- pygeodesy/constants.py +8 -6
- pygeodesy/css.py +50 -42
- pygeodesy/datums.py +50 -48
- pygeodesy/dms.py +6 -6
- pygeodesy/ecef.py +27 -27
- pygeodesy/elevations.py +2 -2
- pygeodesy/ellipsoidalBase.py +28 -27
- pygeodesy/ellipsoidalBaseDI.py +8 -7
- pygeodesy/ellipsoidalNvector.py +11 -12
- pygeodesy/ellipsoids.py +41 -35
- pygeodesy/elliptic.py +12 -10
- pygeodesy/epsg.py +4 -3
- pygeodesy/errors.py +35 -13
- pygeodesy/etm.py +62 -53
- pygeodesy/fmath.py +48 -41
- pygeodesy/formy.py +93 -65
- pygeodesy/frechet.py +117 -102
- pygeodesy/fstats.py +52 -46
- pygeodesy/fsums.py +169 -145
- pygeodesy/gars.py +10 -9
- pygeodesy/geodesicw.py +32 -30
- pygeodesy/geodesicx/__init__.py +1 -1
- pygeodesy/geodesicx/__main__.py +4 -4
- pygeodesy/geodesicx/gx.py +40 -32
- pygeodesy/geodesicx/gxarea.py +15 -12
- pygeodesy/geodesicx/gxbases.py +3 -4
- pygeodesy/geodesicx/gxline.py +6 -8
- pygeodesy/geodsolve.py +28 -26
- pygeodesy/geohash.py +47 -44
- pygeodesy/geoids.py +37 -35
- pygeodesy/hausdorff.py +112 -99
- pygeodesy/heights.py +136 -129
- pygeodesy/internals.py +576 -0
- pygeodesy/interns.py +6 -207
- pygeodesy/iters.py +22 -19
- pygeodesy/karney.py +18 -15
- pygeodesy/ktm.py +31 -24
- pygeodesy/latlonBase.py +12 -11
- pygeodesy/lazily.py +140 -218
- pygeodesy/lcc.py +24 -25
- pygeodesy/ltp.py +83 -71
- pygeodesy/ltpTuples.py +7 -5
- pygeodesy/mgrs.py +5 -4
- pygeodesy/named.py +136 -49
- pygeodesy/namedTuples.py +33 -25
- pygeodesy/nvectorBase.py +10 -9
- pygeodesy/osgr.py +14 -12
- pygeodesy/points.py +13 -13
- pygeodesy/props.py +7 -7
- pygeodesy/rhumb/__init__.py +1 -1
- pygeodesy/rhumb/bases.py +3 -2
- pygeodesy/rhumb/solve.py +2 -2
- pygeodesy/solveBase.py +8 -7
- pygeodesy/sphericalTrigonometry.py +5 -5
- pygeodesy/streprs.py +8 -7
- pygeodesy/trf.py +8 -8
- pygeodesy/triaxials.py +67 -63
- pygeodesy/units.py +48 -50
- pygeodesy/unitsBase.py +24 -11
- pygeodesy/ups.py +7 -6
- pygeodesy/utily.py +4 -4
- pygeodesy/utm.py +53 -52
- pygeodesy/utmupsBase.py +11 -8
- pygeodesy/vector2d.py +6 -7
- pygeodesy/vector3d.py +16 -17
- pygeodesy/vector3dBase.py +5 -5
- PyGeodesy-24.5.8.dist-info/RECORD +0 -115
- {PyGeodesy-24.5.8.dist-info → PyGeodesy-24.5.24.dist-info}/WHEEL +0 -0
- {PyGeodesy-24.5.8.dist-info → PyGeodesy-24.5.24.dist-info}/top_level.txt +0 -0
pygeodesy/auxilats/auxAngle.py
CHANGED
|
@@ -14,16 +14,15 @@ under the MIT/X11 License. For more information, see the U{GeographicLib
|
|
|
14
14
|
# make sure int/int division yields float quotient, see .basics
|
|
15
15
|
from __future__ import division as _; del _ # PYCHOK semicolon
|
|
16
16
|
|
|
17
|
-
from pygeodesy.auxilats.auxily import Aux, _Aux2Greek
|
|
18
|
-
from pygeodesy.basics import _xinstanceof
|
|
17
|
+
from pygeodesy.auxilats.auxily import Aux, _Aux2Greek
|
|
18
|
+
from pygeodesy.basics import _xinstanceof
|
|
19
19
|
from pygeodesy.constants import EPS, _INF_NAN_NINF, MAX, NAN, _0_0, _0_5, _1_0, \
|
|
20
20
|
_copysign_1_0, _over, _pos_self, isfinite, isnan
|
|
21
|
-
|
|
21
|
+
from pygeodesy.errors import AuxError, _UnexpectedError, _xkwds_pop2
|
|
22
22
|
from pygeodesy.fmath import hypot, unstr
|
|
23
|
-
from pygeodesy.fsums import _add_op_, _iadd_op_, _isub_op_, _sub_op_
|
|
24
|
-
|
|
25
|
-
# from pygeodesy.
|
|
26
|
-
from pygeodesy.lazily import _ALL_DOCS, _ALL_MODS as _MODS
|
|
23
|
+
from pygeodesy.fsums import _add_op_, _iadd_op_, _isub_op_, _sub_op_
|
|
24
|
+
from pygeodesy.named import _name2__, _Named, _ALL_DOCS, _MODS
|
|
25
|
+
# from pygeodesy.lazily import _ALL_DOCS, _ALL_MODS as _MODS # from .named
|
|
27
26
|
from pygeodesy.props import Property, Property_RO, property_RO, _update_all
|
|
28
27
|
# from pygeodesy.streprs import unstr # from .fmath
|
|
29
28
|
from pygeodesy.units import Degrees, Radians
|
|
@@ -32,7 +31,7 @@ from pygeodesy.utily import atan2d, sincos2, sincos2d
|
|
|
32
31
|
from math import asinh, atan2, copysign, degrees, fabs, radians, sinh
|
|
33
32
|
|
|
34
33
|
__all__ = ()
|
|
35
|
-
__version__ = '24.
|
|
34
|
+
__version__ = '24.05.24'
|
|
36
35
|
|
|
37
36
|
_0_INF_NAN_NINF = (0, _0_0) + _INF_NAN_NINF
|
|
38
37
|
_MAX_2 = MAX * _0_5 # PYCHOK used!
|
|
@@ -49,18 +48,18 @@ class AuxAngle(_Named):
|
|
|
49
48
|
_y = _0_0
|
|
50
49
|
_x = _1_0
|
|
51
50
|
|
|
52
|
-
def __init__(self, y_angle=_0_0, x=_1_0,
|
|
51
|
+
def __init__(self, y_angle=_0_0, x=_1_0, **aux_name):
|
|
53
52
|
'''New L{AuxAngle}.
|
|
54
53
|
|
|
55
54
|
@kwarg y_angle: The Y component (C{scalar}, including C{INF}, C{NAN}
|
|
56
55
|
and C{NINF}) or a previous L{AuxAngle} instance.
|
|
57
56
|
@kwarg x: The X component, ignored if C{B{y_angle}} is non-C{scalar}.
|
|
58
|
-
@kwarg
|
|
59
|
-
|
|
60
|
-
is non-C{scalar}.
|
|
57
|
+
@kwarg aux_name: Optional C{B{name}=NN} (C{str}) and I{Auxiliary} kind
|
|
58
|
+
(C{B{aux}=Aux.KIND}), ignored if B{C{y_angle}} is L{AuxAngle}.
|
|
61
59
|
|
|
62
60
|
@raise AuxError: Invalid B{C{y_angle}}, B{C{x}} or B{C{aux}}.
|
|
63
61
|
'''
|
|
62
|
+
name, aux = _name2__(**aux_name)
|
|
64
63
|
try:
|
|
65
64
|
yx = y_angle._yx
|
|
66
65
|
if self._AUX is None:
|
|
@@ -70,11 +69,13 @@ class AuxAngle(_Named):
|
|
|
70
69
|
except AttributeError:
|
|
71
70
|
yx = y_angle, x
|
|
72
71
|
if aux:
|
|
73
|
-
|
|
74
|
-
if
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
a, kwds = _xkwds_pop2(aux, aux=self._AUX)
|
|
73
|
+
if kwds:
|
|
74
|
+
raise _UnexpectedError(**kwds)
|
|
75
|
+
if a is not self._AUX:
|
|
76
|
+
if a not in _AUXClass:
|
|
77
|
+
raise AuxError(aux=a)
|
|
78
|
+
self._AUX = a
|
|
78
79
|
self._y, self._x = _yx2(yx)
|
|
79
80
|
if name:
|
|
80
81
|
self.name = name
|
|
@@ -428,16 +429,16 @@ class AuxBeta(AuxAngle):
|
|
|
428
429
|
_AUX = Aux.BETA
|
|
429
430
|
|
|
430
431
|
@staticmethod
|
|
431
|
-
def fromDegrees(deg, name
|
|
432
|
+
def fromDegrees(deg, **name):
|
|
432
433
|
'''Get an L{AuxBeta} from degrees.
|
|
433
434
|
'''
|
|
434
|
-
return AuxBeta(*sincos2d(deg), name
|
|
435
|
+
return AuxBeta(*sincos2d(deg), **name)
|
|
435
436
|
|
|
436
437
|
@staticmethod
|
|
437
|
-
def fromRadians(rad, name
|
|
438
|
+
def fromRadians(rad, **name):
|
|
438
439
|
'''Get an L{AuxBeta} from radians.
|
|
439
440
|
'''
|
|
440
|
-
return AuxBeta(*sincos2(rad), name
|
|
441
|
+
return AuxBeta(*sincos2(rad), **name)
|
|
441
442
|
|
|
442
443
|
|
|
443
444
|
class AuxChi(AuxAngle):
|
|
@@ -446,10 +447,10 @@ class AuxChi(AuxAngle):
|
|
|
446
447
|
_AUX = Aux.CHI
|
|
447
448
|
|
|
448
449
|
@staticmethod
|
|
449
|
-
def fromDegrees(deg, name
|
|
450
|
+
def fromDegrees(deg, **name):
|
|
450
451
|
'''Get an L{AuxChi} from degrees.
|
|
451
452
|
'''
|
|
452
|
-
return AuxChi(*sincos2d(deg), name
|
|
453
|
+
return AuxChi(*sincos2d(deg), **name)
|
|
453
454
|
|
|
454
455
|
|
|
455
456
|
class AuxMu(AuxAngle):
|
|
@@ -458,10 +459,10 @@ class AuxMu(AuxAngle):
|
|
|
458
459
|
_AUX = Aux.MU
|
|
459
460
|
|
|
460
461
|
@staticmethod
|
|
461
|
-
def fromDegrees(deg, name
|
|
462
|
+
def fromDegrees(deg, **name):
|
|
462
463
|
'''Get an L{AuxMu} from degrees.
|
|
463
464
|
'''
|
|
464
|
-
return AuxMu(*sincos2d(deg), name
|
|
465
|
+
return AuxMu(*sincos2d(deg), **name)
|
|
465
466
|
|
|
466
467
|
|
|
467
468
|
class AuxPhi(AuxAngle):
|
|
@@ -471,10 +472,10 @@ class AuxPhi(AuxAngle):
|
|
|
471
472
|
_diff = _1_0 # see .auxLat._Newton
|
|
472
473
|
|
|
473
474
|
@staticmethod
|
|
474
|
-
def fromDegrees(deg, name
|
|
475
|
+
def fromDegrees(deg, **name):
|
|
475
476
|
'''Get an L{AuxPhi} from degrees.
|
|
476
477
|
'''
|
|
477
|
-
return AuxPhi(*sincos2d(deg), name
|
|
478
|
+
return AuxPhi(*sincos2d(deg), **name)
|
|
478
479
|
|
|
479
480
|
|
|
480
481
|
class AuxTheta(AuxAngle):
|
|
@@ -483,10 +484,10 @@ class AuxTheta(AuxAngle):
|
|
|
483
484
|
_AUX = Aux.THETA
|
|
484
485
|
|
|
485
486
|
@staticmethod
|
|
486
|
-
def fromDegrees(deg, name
|
|
487
|
+
def fromDegrees(deg, **name):
|
|
487
488
|
'''Get an L{AuxTheta} from degrees.
|
|
488
489
|
'''
|
|
489
|
-
return AuxTheta(*sincos2d(deg), name
|
|
490
|
+
return AuxTheta(*sincos2d(deg), **name)
|
|
490
491
|
|
|
491
492
|
|
|
492
493
|
class AuxXi(AuxAngle):
|
|
@@ -495,10 +496,10 @@ class AuxXi(AuxAngle):
|
|
|
495
496
|
_AUX = Aux.XI
|
|
496
497
|
|
|
497
498
|
@staticmethod
|
|
498
|
-
def fromDegrees(deg, name
|
|
499
|
+
def fromDegrees(deg, **name):
|
|
499
500
|
'''Get an L{AuxXi} from degrees.
|
|
500
501
|
'''
|
|
501
|
-
return AuxXi(*sincos2d(deg), name
|
|
502
|
+
return AuxXi(*sincos2d(deg), **name)
|
|
502
503
|
|
|
503
504
|
|
|
504
505
|
_AUXClass = {Aux.BETA: AuxBeta,
|
pygeodesy/auxilats/auxLat.py
CHANGED
|
@@ -18,19 +18,21 @@ from __future__ import division as _; del _ # PYCHOK semicolon
|
|
|
18
18
|
from pygeodesy.auxilats.auxAngle import AuxAngle, AuxBeta, AuxChi, _AuxClass, \
|
|
19
19
|
AuxMu, AuxPhi, AuxTheta, AuxXi
|
|
20
20
|
from pygeodesy.auxilats.auxily import Aux, _sc, _sn, _Ufloats, atan1
|
|
21
|
-
from pygeodesy.basics import
|
|
21
|
+
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.internals import _passarg # from .basics
|
|
32
|
+
from pygeodesy.interns import NN, _DOT_, _not_scalar_, _UNDER_
|
|
31
33
|
from pygeodesy.karney import _2cos2x, _polynomial, _ALL_DOCS, cbrt, _MODS
|
|
32
|
-
from pygeodesy.interns import NN, _DOT_, _UNDER_ # _earth_
|
|
33
34
|
# from pygeodesy.lazily import _ALL_DOCS, _ALL_MODS as _MODS # from .karney
|
|
35
|
+
# from pygeodesy.named import _name__ # from .datums
|
|
34
36
|
from pygeodesy.props import Property, Property_RO, _update_all
|
|
35
37
|
from pygeodesy.units import _isDegrees, _isRadius, Degrees, Meter
|
|
36
38
|
# from pygeodesy.utily import atan1 # from .auxily
|
|
@@ -44,7 +46,7 @@ except ImportError: # Python 3.11-
|
|
|
44
46
|
return pow(_2_0, x)
|
|
45
47
|
|
|
46
48
|
__all__ = ()
|
|
47
|
-
__version__ = '24.
|
|
49
|
+
__version__ = '24.05.24'
|
|
48
50
|
|
|
49
51
|
_TRIPS = 1024 # XXX 2 or 3?
|
|
50
52
|
|
|
@@ -66,7 +68,7 @@ class AuxLat(AuxAngle):
|
|
|
66
68
|
# _Lmax = 0 # overwritten below
|
|
67
69
|
_mAL = 6 # 4, 6 or 8 aka Lmax
|
|
68
70
|
|
|
69
|
-
def __init__(self, a_earth=_WGS84, f=None, b=None,
|
|
71
|
+
def __init__(self, a_earth=_WGS84, f=None, b=None, **ALorder_name):
|
|
70
72
|
'''New L{AuxLat} instance on an ellipsoid or datum.
|
|
71
73
|
|
|
72
74
|
@arg a_earth: Equatorial radius, semi-axis (C{meter}) or an
|
|
@@ -77,28 +79,35 @@ class AuxLat(AuxAngle):
|
|
|
77
79
|
@kwarg b: Optional polar radius, semi-axis (C{meter}, same
|
|
78
80
|
units as B{C{a_earth}}), ignored if B{C{a_earth}}
|
|
79
81
|
is not scalar.
|
|
80
|
-
@kwarg
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
@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}.
|
|
84
85
|
'''
|
|
85
|
-
if
|
|
86
|
-
|
|
87
|
-
|
|
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)
|
|
88
96
|
if b is f is None:
|
|
89
97
|
E = _ellipsoidal_datum(a_earth, name=n).ellipsoid # XXX raiser=_earth_
|
|
90
98
|
elif _isRadius(a_earth):
|
|
91
|
-
E = Ellipsoid(a_earth, f=f, b=b, name=_UNDER_(n))
|
|
99
|
+
E = Ellipsoid(a_earth, f=f, b=b, name=_UNDER_(NN, n))
|
|
92
100
|
else:
|
|
93
|
-
raise ValueError()
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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))
|
|
97
106
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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)
|
|
102
111
|
|
|
103
112
|
@Property_RO
|
|
104
113
|
def a(self):
|
|
@@ -136,6 +145,8 @@ class AuxLat(AuxAngle):
|
|
|
136
145
|
'''Convert I{Geographic} to I{Aunthalic} latitude.
|
|
137
146
|
|
|
138
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}.
|
|
139
150
|
|
|
140
151
|
@return: Parametric latitude, C{Beta} (L{AuxAngle}).
|
|
141
152
|
'''
|
|
@@ -143,15 +154,15 @@ class AuxLat(AuxAngle):
|
|
|
143
154
|
# assert Phi._AUX == Aux.PHI
|
|
144
155
|
tphi = fabs(Phi.tan)
|
|
145
156
|
if isfinite(tphi) and tphi and self.f:
|
|
146
|
-
y, x =
|
|
147
|
-
q =
|
|
148
|
-
qv =
|
|
149
|
-
Dq2 =
|
|
157
|
+
y, x = Phi._yx_normalized
|
|
158
|
+
q = self._q
|
|
159
|
+
qv = self._qf(tphi)
|
|
160
|
+
Dq2 = self._Dq(tphi)
|
|
150
161
|
Dq2 *= (q + qv) / (fabs(y) + _1_0) # _Dq(-tphi)
|
|
151
|
-
|
|
152
|
-
|
|
162
|
+
d, n = _diff_name2(Phi, **diff_name)
|
|
163
|
+
Xi = AuxXi(copysign(qv, Phi.y), x * sqrt(Dq2), name=n)
|
|
153
164
|
|
|
154
|
-
if
|
|
165
|
+
if d:
|
|
155
166
|
if isnan(tphi):
|
|
156
167
|
d = self._e2m1_sq2
|
|
157
168
|
else:
|
|
@@ -246,6 +257,8 @@ class AuxLat(AuxAngle):
|
|
|
246
257
|
'''Convert I{Geographic} to I{Conformal} latitude.
|
|
247
258
|
|
|
248
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}.
|
|
249
262
|
|
|
250
263
|
@return: Conformal latitude, C{Chi} (L{AuxAngle}).
|
|
251
264
|
'''
|
|
@@ -299,10 +312,10 @@ class AuxLat(AuxAngle):
|
|
|
299
312
|
else:
|
|
300
313
|
tchi = tphi * scsig - sig * scphi
|
|
301
314
|
|
|
302
|
-
n =
|
|
303
|
-
Chi
|
|
315
|
+
d, n = _diff_name2(Phi, **diff_name)
|
|
316
|
+
Chi = AuxChi(tchi, name=n).copyquadrant(Phi)
|
|
304
317
|
|
|
305
|
-
if
|
|
318
|
+
if d:
|
|
306
319
|
if isinf(tphi): # PYCHOK np cover
|
|
307
320
|
d = self._conformal_diff
|
|
308
321
|
else:
|
|
@@ -458,12 +471,13 @@ class AuxLat(AuxAngle):
|
|
|
458
471
|
'''Convert I{Auxiliary} to I{Geographic} latitude.
|
|
459
472
|
|
|
460
473
|
@arg Zeta: Auxiliary latitude (L{AuxAngle}).
|
|
474
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
461
475
|
|
|
462
476
|
@return: Geographic latitude, I{Phi} (L{AuxAngle}).
|
|
463
477
|
'''
|
|
464
478
|
_xinstanceof(AuxAngle, Zeta=Zeta)
|
|
465
479
|
aux = Zeta._AUX
|
|
466
|
-
n =
|
|
480
|
+
n = _name__(name, _or_nameof=Zeta)
|
|
467
481
|
f = self._fromAuxCase.get(aux, None)
|
|
468
482
|
if f is None:
|
|
469
483
|
Phi = AuxPhi(NAN, name=n)
|
|
@@ -492,27 +506,31 @@ class AuxLat(AuxAngle):
|
|
|
492
506
|
'''Convert I{Geographic} to I{Geocentric} latitude.
|
|
493
507
|
|
|
494
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}.
|
|
495
511
|
|
|
496
512
|
@return: Geocentric latitude, C{Phi} (L{AuxAngle}).
|
|
497
513
|
'''
|
|
498
514
|
_xinstanceof(AuxAngle, Phi=Phi)
|
|
499
515
|
# assert Phi._AUX == Aux.PHI
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
if
|
|
516
|
+
d, n = _diff_name2(Phi, **diff_name)
|
|
517
|
+
Theta = AuxTheta(Phi.y * self._e2m1, Phi.x, name=n)
|
|
518
|
+
if d:
|
|
503
519
|
Theta._diff = self._e2m1
|
|
504
520
|
return Theta
|
|
505
521
|
|
|
506
|
-
def Geodetic(self, Phi, **
|
|
522
|
+
def Geodetic(self, Phi, **name): # PYCHOK no cover
|
|
507
523
|
'''Convert I{Geographic} to I{Geodetic} latitude.
|
|
508
524
|
|
|
509
525
|
@arg Phi: Geographic latitude (L{AuxAngle}).
|
|
526
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
510
527
|
|
|
511
528
|
@return: Geodetic latitude, C{Phi} (L{AuxAngle}).
|
|
512
529
|
'''
|
|
513
530
|
_xinstanceof(AuxAngle, Phi=Phi)
|
|
514
531
|
# assert Phi._AUX == Aux.PHI
|
|
515
|
-
|
|
532
|
+
_, n = _diff_name2(Phi, **name)
|
|
533
|
+
return AuxPhi(Phi, name=n)
|
|
516
534
|
|
|
517
535
|
@Property_RO
|
|
518
536
|
def _n(self): # 3rd flattening
|
|
@@ -526,14 +544,16 @@ class AuxLat(AuxAngle):
|
|
|
526
544
|
'''Convert I{Geographic} to I{Parametric} latitude.
|
|
527
545
|
|
|
528
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}.
|
|
529
549
|
|
|
530
550
|
@return: Parametric latitude, C{Beta} (L{AuxAngle}).
|
|
531
551
|
'''
|
|
532
552
|
_xinstanceof(AuxAngle, Phi=Phi)
|
|
533
553
|
# assert Phi._AUX == Aux.PHI
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
if
|
|
554
|
+
d, n = _diff_name2(Phi, **diff_name)
|
|
555
|
+
Beta = AuxBeta(Phi.y * self._fm1, Phi.x, name=n)
|
|
556
|
+
if d:
|
|
537
557
|
Beta._diff = self._fm1
|
|
538
558
|
return Beta
|
|
539
559
|
|
|
@@ -583,6 +603,8 @@ class AuxLat(AuxAngle):
|
|
|
583
603
|
'''Convert I{Geographic} to I{Rectifying} latitude.
|
|
584
604
|
|
|
585
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}.
|
|
586
608
|
|
|
587
609
|
@return: Rectifying latitude, C{Mu} (L{AuxAngle}).
|
|
588
610
|
'''
|
|
@@ -624,11 +646,10 @@ class AuxLat(AuxAngle):
|
|
|
624
646
|
mx = sin(mx / mr) # XXX zero?
|
|
625
647
|
else: # zero Mu
|
|
626
648
|
my, mx = _0_0, _1_0
|
|
627
|
-
n
|
|
628
|
-
Mu
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
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:
|
|
632
653
|
d, x = _0_0, Beta._x_normalized
|
|
633
654
|
if x and mr:
|
|
634
655
|
if Mu.x and Phi.x and not isinf(Phi.tan):
|
|
@@ -649,7 +670,7 @@ class AuxLat(AuxAngle):
|
|
|
649
670
|
as the ellipsoid axes).
|
|
650
671
|
'''
|
|
651
672
|
r = self._Ef_fRG_a2b2_PI_4 if exact else self._RectifyingR
|
|
652
|
-
return Meter(r,
|
|
673
|
+
return Meter(r, name__=self.RectifyingRadius)
|
|
653
674
|
|
|
654
675
|
@Property_RO
|
|
655
676
|
def _RectifyingR(self):
|
|
@@ -665,15 +686,17 @@ class AuxLat(AuxAngle):
|
|
|
665
686
|
|
|
666
687
|
@arg auxout: I{Auxiliary} kind (C{Aux.KIND}).
|
|
667
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}.
|
|
668
691
|
|
|
669
692
|
@return: Auxiliary latitude, I{Eta} (L{AuxLat}).
|
|
670
693
|
'''
|
|
671
694
|
_xinstanceof(AuxAngle, Phi=Phi)
|
|
672
695
|
# assert Phi._AUX == Aux.PHI
|
|
673
|
-
n =
|
|
674
|
-
m
|
|
696
|
+
d, n = _diff_name2(Phi, **diff_name)
|
|
697
|
+
m = _toAuxCase.get(auxout, None)
|
|
675
698
|
if m: # callable
|
|
676
|
-
A = m(self, Phi,
|
|
699
|
+
A = m(self, Phi, diff=d, name=n)
|
|
677
700
|
elif auxout == Aux.GEODETIC: # == GEOGRAPHIC
|
|
678
701
|
A = AuxPhi(Phi, name=n)
|
|
679
702
|
else: # auxout?
|
|
@@ -755,8 +778,15 @@ def _CXcoeffs(aL): # PYCHOK in .auxilats.__main__
|
|
|
755
778
|
return _coeffs
|
|
756
779
|
|
|
757
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
|
+
|
|
758
788
|
def _Newton(tphi, Zeta, _toZeta, **name):
|
|
759
|
-
# Newton's method
|
|
789
|
+
# Newton's method from AuxLat._fromAux
|
|
760
790
|
try:
|
|
761
791
|
_lg2 = _log2
|
|
762
792
|
_abs = fabs
|