pygeodesy 24.6.1__py2.py3-none-any.whl → 24.6.9__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.6.1.dist-info → PyGeodesy-24.6.9.dist-info}/METADATA +2 -2
- {PyGeodesy-24.6.1.dist-info → PyGeodesy-24.6.9.dist-info}/RECORD +43 -43
- pygeodesy/__init__.py +1 -1
- pygeodesy/booleans.py +52 -65
- pygeodesy/cartesianBase.py +138 -147
- pygeodesy/ecef.py +46 -52
- pygeodesy/ellipsoidalBase.py +6 -43
- pygeodesy/ellipsoidalNvector.py +7 -7
- pygeodesy/errors.py +2 -2
- pygeodesy/frechet.py +3 -4
- pygeodesy/fsums.py +2 -2
- pygeodesy/geodsolve.py +23 -25
- pygeodesy/geohash.py +14 -27
- pygeodesy/geoids.py +1 -1
- pygeodesy/hausdorff.py +6 -7
- pygeodesy/heights.py +14 -27
- pygeodesy/internals.py +13 -12
- pygeodesy/interns.py +3 -9
- pygeodesy/iters.py +2 -2
- pygeodesy/latlonBase.py +189 -176
- pygeodesy/lazily.py +90 -54
- pygeodesy/lcc.py +2 -2
- pygeodesy/ltp.py +37 -17
- pygeodesy/ltpTuples.py +124 -115
- pygeodesy/mgrs.py +28 -1
- pygeodesy/named.py +92 -67
- pygeodesy/namedTuples.py +43 -14
- pygeodesy/nvectorBase.py +19 -22
- pygeodesy/points.py +2 -2
- pygeodesy/rhumb/solve.py +8 -61
- pygeodesy/solveBase.py +22 -19
- pygeodesy/sphericalBase.py +17 -11
- pygeodesy/streprs.py +6 -4
- pygeodesy/trf.py +3 -3
- pygeodesy/triaxials.py +70 -49
- pygeodesy/units.py +40 -65
- pygeodesy/unitsBase.py +2 -2
- pygeodesy/utily.py +5 -4
- pygeodesy/utmupsBase.py +2 -2
- pygeodesy/vector3d.py +34 -36
- pygeodesy/vector3dBase.py +12 -9
- {PyGeodesy-24.6.1.dist-info → PyGeodesy-24.6.9.dist-info}/WHEEL +0 -0
- {PyGeodesy-24.6.1.dist-info → PyGeodesy-24.6.9.dist-info}/top_level.txt +0 -0
pygeodesy/solveBase.py
CHANGED
|
@@ -13,7 +13,7 @@ from pygeodesy.internals import _enquote, printf
|
|
|
13
13
|
from pygeodesy.interns import NN, _0_, _BACKSLASH_, _COMMASPACE_, \
|
|
14
14
|
_EQUAL_, _Error_, _SPACE_, _UNUSED_
|
|
15
15
|
from pygeodesy.karney import Caps, _CapsBase, GDict
|
|
16
|
-
from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY,
|
|
16
|
+
from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _sys_version_info2
|
|
17
17
|
from pygeodesy.named import callername, _name2__, notOverloaded
|
|
18
18
|
from pygeodesy.props import Property, Property_RO, property_RO, _update_all
|
|
19
19
|
from pygeodesy.streprs import Fmt, fstr, fstrzs, pairs, strs
|
|
@@ -23,34 +23,37 @@ from pygeodesy.utily import unroll180, wrap360 # PYCHOK shared
|
|
|
23
23
|
from subprocess import PIPE as _PIPE, Popen as _Popen, STDOUT as _STDOUT
|
|
24
24
|
|
|
25
25
|
__all__ = _ALL_LAZY.solveBase
|
|
26
|
-
__version__ = '24.05
|
|
26
|
+
__version__ = '24.06.05'
|
|
27
27
|
|
|
28
|
-
_ERROR_
|
|
29
|
-
|
|
28
|
+
_ERROR_ = 'ERROR'
|
|
29
|
+
_Popen_kwds = dict(creationflags=0,
|
|
30
|
+
# executable=sys.executable, shell=True,
|
|
31
|
+
stdin=_PIPE, stdout=_PIPE, stderr=_STDOUT)
|
|
32
|
+
if _sys_version_info2 > (3, 6):
|
|
33
|
+
_Popen_kwds.update(text=True)
|
|
34
|
+
del _PIPE, _STDOUT, _sys_version_info2 # _ALL_LAZY
|
|
30
35
|
|
|
31
36
|
|
|
32
37
|
def _cmd_stdin_(cmd, stdin): # PYCHOK no cover
|
|
33
38
|
'''(INTERNAL) Cmd line, stdin and caller as sC{str}.
|
|
34
39
|
'''
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
if stdin is not None:
|
|
41
|
+
cmd += _BACKSLASH_, str(stdin)
|
|
42
|
+
cmd += Fmt.PAREN(callername(up=3)),
|
|
43
|
+
return _SPACE_.join(cmd)
|
|
38
44
|
|
|
39
45
|
|
|
40
|
-
def _popen2(cmd, stdin=None): # in .mgrs,
|
|
46
|
+
def _popen2(cmd, stdin=None): # in .mgrs, test.bases, .testMgrs
|
|
41
47
|
'''(INTERNAL) Invoke C{B{cmd} tuple} and return C{exitcode}
|
|
42
48
|
and all output to C{stdout/-err}.
|
|
43
49
|
'''
|
|
44
|
-
p = _Popen(cmd,
|
|
45
|
-
|
|
46
|
-
stdin=_PIPE, stdout=_PIPE, stderr=_STDOUT,
|
|
47
|
-
**_text_True) # PYCHOK kwArgs
|
|
48
|
-
r = p.communicate(stdin)[0]
|
|
50
|
+
p = _Popen(cmd, **_Popen_kwds) # PYCHOK kwArgs
|
|
51
|
+
r = p.communicate(stdin)[0]
|
|
49
52
|
return p.returncode, ub2str(r).strip()
|
|
50
53
|
|
|
51
54
|
|
|
52
|
-
class
|
|
53
|
-
'''(NTERNAL) Base class for C{
|
|
55
|
+
class _SolveCapsBase(_CapsBase):
|
|
56
|
+
'''(NTERNAL) Base class for C{_SolveBase} and C{_LineSolveBase}.
|
|
54
57
|
'''
|
|
55
58
|
_Error = None
|
|
56
59
|
_Exact = True
|
|
@@ -131,7 +134,7 @@ class _SolveLineSolveBase(_CapsBase):
|
|
|
131
134
|
|
|
132
135
|
@note: The C{Solve} return code is in property L{status}.
|
|
133
136
|
'''
|
|
134
|
-
c = (self._Solve_path,) + map2(str, options)
|
|
137
|
+
c = (self._Solve_path,) + map2(str, options) # map2(_enquote, options)
|
|
135
138
|
i = _xkwds_get1(stdin, stdin=None)
|
|
136
139
|
r = self._invoke(c, stdin=i)
|
|
137
140
|
s = self.status
|
|
@@ -270,7 +273,7 @@ class _SolveLineSolveBase(_CapsBase):
|
|
|
270
273
|
return self.invoke('--version')
|
|
271
274
|
|
|
272
275
|
|
|
273
|
-
class _SolveBase(
|
|
276
|
+
class _SolveBase(_SolveCapsBase):
|
|
274
277
|
'''(NTERNAL) Base class for C{_GeodesicSolveBase} and C{_RhumbSolveBase}.
|
|
275
278
|
'''
|
|
276
279
|
_datum = _WGS84
|
|
@@ -387,7 +390,7 @@ class _SolveBase(_SolveLineSolveBase):
|
|
|
387
390
|
return sep.join(pairs(d, prec=prec))
|
|
388
391
|
|
|
389
392
|
|
|
390
|
-
class _SolveLineBase(
|
|
393
|
+
class _SolveLineBase(_SolveCapsBase):
|
|
391
394
|
'''(NTERNAL) Base class for C{GeodesicLineSolve} and C{RhumbLineSolve}.
|
|
392
395
|
'''
|
|
393
396
|
# _caps = 0
|
|
@@ -448,7 +451,7 @@ class _SolveLineBase(_SolveLineSolveBase):
|
|
|
448
451
|
return sep.join(pairs(d, prec=prec))
|
|
449
452
|
|
|
450
453
|
|
|
451
|
-
__all__ += _ALL_DOCS(_SolveBase, _SolveLineBase,
|
|
454
|
+
__all__ += _ALL_DOCS(_SolveBase, _SolveLineBase, _SolveCapsBase)
|
|
452
455
|
|
|
453
456
|
# **) MIT License
|
|
454
457
|
#
|
pygeodesy/sphericalBase.py
CHANGED
|
@@ -40,7 +40,7 @@ from pygeodesy.utily import acos1, asin1, atan2b, atan2d, degrees90, \
|
|
|
40
40
|
from math import cos, fabs, log, sin, sqrt
|
|
41
41
|
|
|
42
42
|
__all__ = _ALL_LAZY.sphericalBase
|
|
43
|
-
__version__ = '24.
|
|
43
|
+
__version__ = '24.06.06'
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
class CartesianSphericalBase(CartesianBase):
|
|
@@ -380,7 +380,8 @@ class LatLonSphericalBase(LatLonBase):
|
|
|
380
380
|
'''DEPRECATED, use method C{.rhumbAzimuthTo}.'''
|
|
381
381
|
return self.rhumbAzimuthTo(other, b360=True) # [0..360)
|
|
382
382
|
|
|
383
|
-
def rhumbDestination(self, distance, azimuth, radius=R_M, height=None,
|
|
383
|
+
def rhumbDestination(self, distance, azimuth, radius=R_M, height=None,
|
|
384
|
+
exact=False, **name):
|
|
384
385
|
'''Return the destination point having travelled the given distance from
|
|
385
386
|
this point along a rhumb line (loxodrome) of the given azimuth.
|
|
386
387
|
|
|
@@ -393,6 +394,7 @@ class LatLonSphericalBase(LatLonBase):
|
|
|
393
394
|
@kwarg height: Optional height, overriding the default height (C{meter}.
|
|
394
395
|
@kwarg exact: If C{True}, use I{Elliptic, Krüger} L{Rhumb} (C{bool}),
|
|
395
396
|
default C{False} for backward compatibility.
|
|
397
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
396
398
|
|
|
397
399
|
@return: The destination point (spherical C{LatLon}).
|
|
398
400
|
|
|
@@ -401,7 +403,7 @@ class LatLonSphericalBase(LatLonBase):
|
|
|
401
403
|
'''
|
|
402
404
|
if exact: # use series, always
|
|
403
405
|
r = LatLonBase.rhumbDestination(self, distance, azimuth, exact=False, # Krüger
|
|
404
|
-
radius=radius, height=height)
|
|
406
|
+
radius=radius, height=height, **name)
|
|
405
407
|
else: # radius=None from .rhumbMidpointTo
|
|
406
408
|
if radius in (None, self._radius):
|
|
407
409
|
d, r = self.datum, radius
|
|
@@ -425,7 +427,7 @@ class LatLonSphericalBase(LatLonBase):
|
|
|
425
427
|
b2 = b1 if isnear0(q) else (b1 + r * sb / q)
|
|
426
428
|
|
|
427
429
|
h = self._heigHt(height)
|
|
428
|
-
r = self.classof(degrees90(a2), degrees180(b2), datum=d, height=h)
|
|
430
|
+
r = self.classof(degrees90(a2), degrees180(b2), datum=d, height=h, **name)
|
|
429
431
|
return r
|
|
430
432
|
|
|
431
433
|
def rhumbDistanceTo(self, other, radius=R_M, exact=False, wrap=False):
|
|
@@ -499,7 +501,7 @@ class LatLonSphericalBase(LatLonBase):
|
|
|
499
501
|
height=height, wrap=wrap)
|
|
500
502
|
|
|
501
503
|
def rhumbMidpointTo(self, other, height=None, radius=R_M, exact=False,
|
|
502
|
-
fraction=_0_5,
|
|
504
|
+
fraction=_0_5, **wrap_name):
|
|
503
505
|
'''Return the (loxodromic) midpoint on the rhumb line between
|
|
504
506
|
this and an other point.
|
|
505
507
|
|
|
@@ -511,8 +513,9 @@ class LatLonSphericalBase(LatLonBase):
|
|
|
511
513
|
default C{False} for backward compatibility.
|
|
512
514
|
@kwarg fraction: Midpoint location from this point (C{scalar}), may
|
|
513
515
|
be negative if C{B{exact}=True}.
|
|
514
|
-
@kwarg
|
|
515
|
-
|
|
516
|
+
@kwarg wrap_name: Optional C{B{name}=NN} (C{str}) and optional keyword
|
|
517
|
+
argument C{B{wrap}=False}, if C{True}, wrap or I{normalize}
|
|
518
|
+
and unroll the B{C{other}} point (C{bool}).
|
|
516
519
|
|
|
517
520
|
@return: The (mid)point at the given B{C{fraction}} along the rhumb
|
|
518
521
|
line (spherical C{LatLon}).
|
|
@@ -524,18 +527,21 @@ class LatLonSphericalBase(LatLonBase):
|
|
|
524
527
|
if exact: # use series, always
|
|
525
528
|
r = LatLonBase.rhumbMidpointTo(self, other, exact=False, # Krüger
|
|
526
529
|
radius=radius, height=height,
|
|
527
|
-
fraction=fraction,
|
|
530
|
+
fraction=fraction, **wrap_name)
|
|
528
531
|
elif fraction is not _0_5:
|
|
529
532
|
f = Scalar_(fraction=fraction) # low=_0_0
|
|
530
|
-
|
|
533
|
+
w, n = self._wrap_name2(**wrap_name)
|
|
534
|
+
r, db, dp = self._rhumbs3(other, w, r=True) # radians
|
|
531
535
|
z = atan2b(db, dp)
|
|
532
536
|
h = self._havg(other, f=f, h=height)
|
|
533
|
-
r = self.rhumbDestination(r * f, z, radius=None, height=h)
|
|
537
|
+
r = self.rhumbDestination(r * f, z, radius=None, height=h, name=n)
|
|
534
538
|
|
|
535
539
|
else: # for backward compatibility, unwrapped
|
|
540
|
+
_, n = self._wrap_name2(**wrap_name)
|
|
536
541
|
# see <https://MathForum.org/library/drmath/view/51822.html>
|
|
537
542
|
a1, b1 = self.philam
|
|
538
543
|
a2, b2 = self.others(other).philam
|
|
544
|
+
_, n = self._wrap_name2(**wrap_name)
|
|
539
545
|
|
|
540
546
|
if fabs(b2 - b1) > PI:
|
|
541
547
|
b1 += PI2 # crossing anti-meridian
|
|
@@ -557,7 +563,7 @@ class LatLonSphericalBase(LatLonBase):
|
|
|
557
563
|
d = self.datum if radius in (None, self._radius) else \
|
|
558
564
|
_spherical_datum(radius, name=self.name, raiser=_radius_)
|
|
559
565
|
h = self._havg(other, h=height)
|
|
560
|
-
r = self.classof(degrees90(a3), degrees180(b3), datum=d, height=h)
|
|
566
|
+
r = self.classof(degrees90(a3), degrees180(b3), datum=d, height=h, name=n)
|
|
561
567
|
return r
|
|
562
568
|
|
|
563
569
|
@property_RO
|
pygeodesy/streprs.py
CHANGED
|
@@ -8,7 +8,7 @@ from pygeodesy.basics import isint, islistuple, isscalar, isstr, itemsorted, \
|
|
|
8
8
|
_zip, _0_0
|
|
9
9
|
# from pygeodesy.constants import _0_0
|
|
10
10
|
from pygeodesy.errors import _or, _AttributeError, _IsnotError, _TypeError, \
|
|
11
|
-
_ValueError, _xkwds_get, _xkwds_item2
|
|
11
|
+
_ValueError, _xkwds_get, _xkwds_item2
|
|
12
12
|
# from pygeodesy.internals import _dunder_nameof # from .lazily
|
|
13
13
|
from pygeodesy.interns import NN, _0_, _0to9_, MISSING, _BAR_, _COMMASPACE_, \
|
|
14
14
|
_DOT_, _E_, _ELLIPSIS_, _EQUAL_, _H_, _LR_PAIRS, \
|
|
@@ -22,7 +22,7 @@ from pygeodesy.lazily import _ALL_LAZY, _ALL_MODS as _MODS, _dunder_nameof
|
|
|
22
22
|
from math import fabs, log10 as _log10
|
|
23
23
|
|
|
24
24
|
__all__ = _ALL_LAZY.streprs
|
|
25
|
-
__version__ = '24.
|
|
25
|
+
__version__ = '24.06.04'
|
|
26
26
|
|
|
27
27
|
_at_ = 'at' # PYCHOK used!
|
|
28
28
|
_EN_PREC = 6 # max MGRS/OSGR precision, 1 micrometer
|
|
@@ -546,8 +546,10 @@ def unstr(where, *args, **kwds):
|
|
|
546
546
|
|
|
547
547
|
@return: Representation (C{str}).
|
|
548
548
|
'''
|
|
549
|
-
|
|
550
|
-
|
|
549
|
+
def _e_g_kwds3(_ELLIPSIS=False, _fmt=Fmt.g, **kwds):
|
|
550
|
+
return _ELLIPSIS, _fmt, kwds
|
|
551
|
+
|
|
552
|
+
e, g, kwds = _e_g_kwds3(**kwds)
|
|
551
553
|
t = reprs(args, fmt=g) if args else ()
|
|
552
554
|
if e:
|
|
553
555
|
t += _ELLIPSIS_,
|
pygeodesy/trf.py
CHANGED
|
@@ -91,7 +91,7 @@ from math import ceil as _ceil, fabs
|
|
|
91
91
|
# import operator as _operator # from .datums
|
|
92
92
|
|
|
93
93
|
__all__ = _ALL_LAZY.trf
|
|
94
|
-
__version__ = '24.
|
|
94
|
+
__version__ = '24.06.09'
|
|
95
95
|
|
|
96
96
|
_EP0CH = Epoch(0, low=0)
|
|
97
97
|
_Es = {_EP0CH: _EP0CH} # L{Epoch}s, deleted below
|
|
@@ -253,7 +253,7 @@ class RefFrame(_NamedEnumItem):
|
|
|
253
253
|
'''
|
|
254
254
|
D = self.datum
|
|
255
255
|
e = self.epoch if epoch is None else _Epoch(epoch)
|
|
256
|
-
t = (Fmt.EQUAL(name=repr(
|
|
256
|
+
t = (Fmt.EQUAL(name=repr(self._name__(name))),
|
|
257
257
|
Fmt.EQUAL(epoch=e),
|
|
258
258
|
Fmt.EQUAL(datum=_DOT_(classname(D) + _s_, D.name)))
|
|
259
259
|
return _COMMASPACE_.join(t[int(name is None):])
|
|
@@ -903,7 +903,7 @@ def date2epoch(year, month, day):
|
|
|
903
903
|
e = y + float(sum(_mDays[:m]) + d) / _366_0
|
|
904
904
|
return Epoch(e, low=0)
|
|
905
905
|
|
|
906
|
-
raise ValueError # _invalid_
|
|
906
|
+
raise ValueError() # _invalid_
|
|
907
907
|
except (TRFError, TypeError, ValueError) as x:
|
|
908
908
|
raise TRFError(year=year, month=month, day=day, cause=x)
|
|
909
909
|
|
pygeodesy/triaxials.py
CHANGED
|
@@ -35,7 +35,6 @@ from pygeodesy.constants import EPS, EPS0, EPS02, EPS4, INT0, PI2, PI_3, PI4, \
|
|
|
35
35
|
_EPS2e4, float0_, isfinite, isnear1, _0_0, _0_5, \
|
|
36
36
|
_1_0, _N_1_0, _N_2_0, _4_0 # PYCHOK used!
|
|
37
37
|
from pygeodesy.datums import Datum, _spherical_datum, _WGS84, Ellipsoid, _EWGS84, Fmt
|
|
38
|
-
# from pygeodesy.dms import toDMS # _MODS
|
|
39
38
|
# from pygeodesy.ellipsoids import Ellipsoid, _EWGS84 # from .datums
|
|
40
39
|
# from pygeodesy.elliptic import Elliptic # _MODS
|
|
41
40
|
# from pygeodesy.errors import _ValueError # from .basics
|
|
@@ -47,38 +46,49 @@ from pygeodesy.interns import NN, _a_, _b_, _beta_, _c_, _distant_, _finite_, \
|
|
|
47
46
|
_spherical_, _too_, _x_, _y_
|
|
48
47
|
# from pygeodesy.lazily import _ALL_LAZY, _ALL_MODS as _MODS # from .vector3d
|
|
49
48
|
from pygeodesy.named import _lazyNamedEnumItem as _lazy, _name__, _NamedEnum, \
|
|
50
|
-
_NamedEnumItem,
|
|
51
|
-
from pygeodesy.namedTuples import LatLon3Tuple, Vector3Tuple,
|
|
49
|
+
_NamedEnumItem, _Pass
|
|
50
|
+
from pygeodesy.namedTuples import LatLon3Tuple, _NamedTupleTo, Vector3Tuple, \
|
|
51
|
+
Vector4Tuple
|
|
52
52
|
from pygeodesy.props import Property_RO, property_RO
|
|
53
53
|
# from pygeodesy.streprs import Fmt # from .datums
|
|
54
|
-
from pygeodesy.units import Float, Height_, Meter, Meter2, Meter3,
|
|
55
|
-
Radius, Scalar_
|
|
54
|
+
from pygeodesy.units import Degrees, Float, Height_, Meter, Meter2, Meter3, \
|
|
55
|
+
Radians, Radius, Scalar_
|
|
56
56
|
from pygeodesy.utily import asin1, atan2d, km2m, m2km, SinCos2, sincos2d_
|
|
57
57
|
from pygeodesy.vector3d import _otherV3d, Vector3d, _ALL_LAZY, _MODS
|
|
58
58
|
|
|
59
59
|
from math import atan2, fabs, sqrt
|
|
60
60
|
|
|
61
61
|
__all__ = _ALL_LAZY.triaxials
|
|
62
|
-
__version__ = '24.
|
|
62
|
+
__version__ = '24.06.09'
|
|
63
63
|
|
|
64
64
|
_not_ordered_ = _not_('ordered')
|
|
65
65
|
_omega_ = 'omega'
|
|
66
66
|
_TRIPS = 269 # 48-55, Eberly 1074?
|
|
67
67
|
|
|
68
68
|
|
|
69
|
-
class _NamedTupleTo
|
|
70
|
-
'''(INTERNAL) Base for
|
|
69
|
+
class _NamedTupleToX(_NamedTupleTo): # in .testNamedTuples
|
|
70
|
+
'''(INTERNAL) Base class for L{BetaOmega2Tuple},
|
|
71
|
+
L{BetaOmega3Tuple} and L{Jacobi2Tuple}.
|
|
71
72
|
'''
|
|
72
|
-
def _toDegrees(self,
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
def _toDegrees(self, name, **toDMS_kwds):
|
|
74
|
+
'''(INTERNAL) Convert C{self[0:2]} to L{Degrees} or C{toDMS}.
|
|
75
|
+
'''
|
|
76
|
+
return self._toX3U(_NamedTupleTo._Degrees3, Degrees, name, *self, **toDMS_kwds)
|
|
77
|
+
|
|
78
|
+
def _toRadians(self, name):
|
|
79
|
+
'''(INTERNAL) Convert C{self[0:2]} to L{Radians}.
|
|
80
|
+
'''
|
|
81
|
+
return self._toX3U(_NamedTupleTo._Radians3, Radians, name, *self)
|
|
75
82
|
|
|
76
|
-
def
|
|
77
|
-
a, b,
|
|
78
|
-
|
|
83
|
+
def _toX3U(self, _X3, U, name, a, b, *c, **kwds):
|
|
84
|
+
a, b, s = _X3(self, a, b, **kwds)
|
|
85
|
+
if s is None or name:
|
|
86
|
+
n = self._name__(name)
|
|
87
|
+
s = self.classof(a, b, *c, name=n).reUnit(U, U).toUnits()
|
|
88
|
+
return s
|
|
79
89
|
|
|
80
90
|
|
|
81
|
-
class BetaOmega2Tuple(
|
|
91
|
+
class BetaOmega2Tuple(_NamedTupleToX):
|
|
82
92
|
'''2-Tuple C{(beta, omega)} with I{ellipsoidal} lat- and
|
|
83
93
|
longitude C{beta} and C{omega} both in L{Radians} (or
|
|
84
94
|
L{Degrees}).
|
|
@@ -86,27 +96,30 @@ class BetaOmega2Tuple(_NamedTupleTo):
|
|
|
86
96
|
_Names_ = (_beta_, _omega_)
|
|
87
97
|
_Units_ = (_Pass, _Pass)
|
|
88
98
|
|
|
89
|
-
def toDegrees(self, **toDMS_kwds):
|
|
99
|
+
def toDegrees(self, name=NN, **toDMS_kwds):
|
|
90
100
|
'''Convert this L{BetaOmega2Tuple} to L{Degrees} or C{toDMS}.
|
|
91
101
|
|
|
92
|
-
@
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
102
|
+
@kwarg name: Optional name (C{str}), overriding this name.
|
|
103
|
+
|
|
104
|
+
@return: L{BetaOmega2Tuple}C{(beta, omega)} with C{beta} and
|
|
105
|
+
C{omega} both in L{Degrees} or as L{toDMS} strings
|
|
106
|
+
provided some B{C{toDMS_kwds}} keyword arguments are
|
|
96
107
|
specified.
|
|
97
108
|
'''
|
|
98
|
-
return
|
|
109
|
+
return self._toDegrees(name, **toDMS_kwds)
|
|
99
110
|
|
|
100
|
-
def toRadians(self):
|
|
111
|
+
def toRadians(self, **name):
|
|
101
112
|
'''Convert this L{BetaOmega2Tuple} to L{Radians}.
|
|
102
113
|
|
|
103
|
-
@
|
|
104
|
-
|
|
114
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}), overriding this name.
|
|
115
|
+
|
|
116
|
+
@return: L{BetaOmega2Tuple}C{(beta, omega)} with C{beta} and C{omega}
|
|
117
|
+
both in L{Radians}.
|
|
105
118
|
'''
|
|
106
|
-
return
|
|
119
|
+
return self._toRadians(name)
|
|
107
120
|
|
|
108
121
|
|
|
109
|
-
class BetaOmega3Tuple(
|
|
122
|
+
class BetaOmega3Tuple(_NamedTupleToX):
|
|
110
123
|
'''3-Tuple C{(beta, omega, height)} with I{ellipsoidal} lat- and
|
|
111
124
|
longitude C{beta} and C{omega} both in L{Radians} (or L{Degrees})
|
|
112
125
|
and the C{height}, rather the (signed) I{distance} to the triaxial's
|
|
@@ -116,54 +129,62 @@ class BetaOmega3Tuple(_NamedTupleTo):
|
|
|
116
129
|
_Names_ = BetaOmega2Tuple._Names_ + (_height_,)
|
|
117
130
|
_Units_ = BetaOmega2Tuple._Units_ + ( Meter,)
|
|
118
131
|
|
|
119
|
-
def toDegrees(self, **toDMS_kwds):
|
|
132
|
+
def toDegrees(self, name=NN, **toDMS_kwds):
|
|
120
133
|
'''Convert this L{BetaOmega3Tuple} to L{Degrees} or C{toDMS}.
|
|
121
134
|
|
|
135
|
+
@kwarg name: Optional name (C{str}), overriding this name.
|
|
136
|
+
|
|
122
137
|
@return: L{BetaOmega3Tuple}C{(beta, omega, height)} with
|
|
123
|
-
C{beta} and C{omega} both in L{Degrees} or as
|
|
124
|
-
L{toDMS}
|
|
138
|
+
C{beta} and C{omega} both in L{Degrees} or as
|
|
139
|
+
L{toDMS} strings provided some B{C{toDMS_kwds}}
|
|
125
140
|
keyword arguments are specified.
|
|
126
141
|
'''
|
|
127
|
-
return
|
|
142
|
+
return self._toDegrees(name, **toDMS_kwds)
|
|
128
143
|
|
|
129
|
-
def toRadians(self):
|
|
144
|
+
def toRadians(self, **name):
|
|
130
145
|
'''Convert this L{BetaOmega3Tuple} to L{Radians}.
|
|
131
146
|
|
|
132
|
-
@
|
|
133
|
-
|
|
147
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}), overriding this name.
|
|
148
|
+
|
|
149
|
+
@return: L{BetaOmega3Tuple}C{(beta, omega, height)} with C{beta}
|
|
150
|
+
and C{omega} both in L{Radians}.
|
|
134
151
|
'''
|
|
135
|
-
return
|
|
152
|
+
return self._toRadians(name)
|
|
136
153
|
|
|
137
|
-
def to2Tuple(self):
|
|
154
|
+
def to2Tuple(self, **name):
|
|
138
155
|
'''Reduce this L{BetaOmega3Tuple} to a L{BetaOmega2Tuple}.
|
|
156
|
+
|
|
157
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}), overriding this name.
|
|
139
158
|
'''
|
|
140
|
-
return BetaOmega2Tuple(*self[:2])
|
|
159
|
+
return BetaOmega2Tuple(*self[:2], name=self._name__(name))
|
|
141
160
|
|
|
142
161
|
|
|
143
|
-
class Jacobi2Tuple(
|
|
162
|
+
class Jacobi2Tuple(_NamedTupleToX):
|
|
144
163
|
'''2-Tuple C{(x, y)} with a Jacobi Conformal C{x} and C{y}
|
|
145
164
|
projection, both in L{Radians} (or L{Degrees}).
|
|
146
165
|
'''
|
|
147
166
|
_Names_ = (_x_, _y_)
|
|
148
167
|
_Units_ = (_Pass, _Pass)
|
|
149
168
|
|
|
150
|
-
def toDegrees(self, **toDMS_kwds):
|
|
169
|
+
def toDegrees(self, name=NN, **toDMS_kwds):
|
|
151
170
|
'''Convert this L{Jacobi2Tuple} to L{Degrees} or C{toDMS}.
|
|
152
171
|
|
|
153
|
-
@
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
172
|
+
@kwarg name: Optional name (C{str}), overriding this name.
|
|
173
|
+
|
|
174
|
+
@return: L{Jacobi2Tuple}C{(x, y)} with C{x} and C{y} both
|
|
175
|
+
in L{Degrees} or as L{toDMS} strings provided some
|
|
176
|
+
B{C{toDMS_kwds}} keyword arguments are specified.
|
|
157
177
|
'''
|
|
158
|
-
return
|
|
178
|
+
return self._toDegrees(name, **toDMS_kwds)
|
|
159
179
|
|
|
160
|
-
def toRadians(self):
|
|
180
|
+
def toRadians(self, **name):
|
|
161
181
|
'''Convert this L{Jacobi2Tuple} to L{Radians}.
|
|
162
182
|
|
|
163
|
-
@
|
|
164
|
-
|
|
183
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}), overriding this name.
|
|
184
|
+
|
|
185
|
+
@return: L{Jacobi2Tuple}C{(x, y)} with C{x} and C{y} both in L{Radians}.
|
|
165
186
|
'''
|
|
166
|
-
return
|
|
187
|
+
return self._toRadians(name)
|
|
167
188
|
|
|
168
189
|
|
|
169
190
|
class Triaxial_(_NamedEnumItem):
|
|
@@ -894,8 +915,8 @@ class Triaxial(Triaxial_):
|
|
|
894
915
|
s = v.times_(self._1e2ac, # == 1 - e_sub_x**2
|
|
895
916
|
self._1e2bc, # == 1 - e_sub_y**2
|
|
896
917
|
_1_0)
|
|
897
|
-
|
|
898
|
-
return LatLon3Tuple(
|
|
918
|
+
a, b, h = self._reverseLatLon3(s, atan2d, v, self.forwardLatLon_)
|
|
919
|
+
return LatLon3Tuple(Degrees(lat=a), Degrees(lon=b), h, **name)
|
|
899
920
|
|
|
900
921
|
def _reverseLatLon3(self, s, atan2_, v, forward_):
|
|
901
922
|
'''(INTERNAL) Helper for C{.reverseBetOmg} and C{.reverseLatLon}.
|