pygeodesy 24.5.15__py2.py3-none-any.whl → 24.6.1__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.6.1.dist-info}/METADATA +6 -5
- PyGeodesy-24.6.1.dist-info/RECORD +116 -0
- pygeodesy/__init__.py +4 -4
- pygeodesy/albers.py +41 -41
- pygeodesy/auxilats/__init__.py +1 -1
- pygeodesy/auxilats/__main__.py +2 -2
- pygeodesy/auxilats/auxAngle.py +32 -31
- pygeodesy/auxilats/auxLat.py +80 -51
- pygeodesy/azimuthal.py +123 -124
- pygeodesy/basics.py +46 -10
- pygeodesy/booleans.py +13 -14
- pygeodesy/cartesianBase.py +25 -23
- pygeodesy/clipy.py +3 -3
- pygeodesy/constants.py +3 -3
- pygeodesy/css.py +50 -42
- pygeodesy/datums.py +42 -41
- pygeodesy/deprecated/functions.py +9 -3
- pygeodesy/dms.py +6 -6
- pygeodesy/ecef.py +41 -41
- pygeodesy/ellipsoidalBase.py +41 -41
- pygeodesy/ellipsoidalBaseDI.py +3 -4
- pygeodesy/ellipsoidalGeodSolve.py +2 -2
- pygeodesy/ellipsoidalKarney.py +3 -3
- pygeodesy/ellipsoidalNvector.py +11 -12
- pygeodesy/ellipsoids.py +45 -38
- pygeodesy/elliptic.py +3 -4
- pygeodesy/epsg.py +4 -3
- pygeodesy/errors.py +52 -20
- pygeodesy/etm.py +68 -65
- pygeodesy/fmath.py +44 -49
- pygeodesy/formy.py +129 -115
- pygeodesy/frechet.py +118 -103
- pygeodesy/fstats.py +21 -14
- pygeodesy/fsums.py +124 -80
- pygeodesy/gars.py +10 -9
- pygeodesy/geodesicw.py +19 -17
- pygeodesy/geodesicx/__init__.py +1 -1
- pygeodesy/geodesicx/__main__.py +2 -2
- pygeodesy/geodesicx/gx.py +39 -33
- pygeodesy/geodesicx/gxarea.py +12 -9
- pygeodesy/geodesicx/gxbases.py +3 -4
- pygeodesy/geodesicx/gxline.py +6 -8
- pygeodesy/geodsolve.py +29 -28
- pygeodesy/geohash.py +60 -57
- pygeodesy/geoids.py +34 -32
- pygeodesy/hausdorff.py +114 -101
- pygeodesy/heights.py +137 -130
- pygeodesy/internals.py +16 -11
- pygeodesy/interns.py +3 -6
- pygeodesy/iters.py +19 -17
- pygeodesy/karney.py +21 -17
- pygeodesy/ktm.py +25 -18
- pygeodesy/latlonBase.py +12 -11
- pygeodesy/lazily.py +6 -6
- pygeodesy/lcc.py +24 -25
- pygeodesy/ltp.py +143 -113
- pygeodesy/ltpTuples.py +207 -150
- pygeodesy/mgrs.py +26 -26
- pygeodesy/named.py +172 -90
- pygeodesy/namedTuples.py +33 -25
- pygeodesy/nvectorBase.py +8 -8
- pygeodesy/osgr.py +40 -48
- pygeodesy/points.py +18 -18
- pygeodesy/props.py +29 -16
- pygeodesy/rhumb/__init__.py +1 -1
- pygeodesy/rhumb/aux_.py +13 -15
- pygeodesy/rhumb/bases.py +12 -5
- pygeodesy/rhumb/ekx.py +24 -18
- pygeodesy/rhumb/solve.py +13 -10
- pygeodesy/simplify.py +16 -16
- pygeodesy/solveBase.py +18 -18
- pygeodesy/sphericalBase.py +17 -21
- pygeodesy/sphericalTrigonometry.py +21 -21
- pygeodesy/streprs.py +5 -5
- pygeodesy/trf.py +13 -11
- pygeodesy/triaxials.py +68 -64
- pygeodesy/units.py +35 -35
- pygeodesy/unitsBase.py +24 -11
- pygeodesy/ups.py +66 -70
- pygeodesy/utily.py +3 -3
- pygeodesy/utm.py +183 -187
- pygeodesy/utmups.py +38 -38
- pygeodesy/utmupsBase.py +104 -106
- pygeodesy/vector2d.py +6 -7
- pygeodesy/vector3d.py +16 -17
- pygeodesy/vector3dBase.py +4 -5
- pygeodesy/webmercator.py +43 -51
- PyGeodesy-24.5.15.dist-info/RECORD +0 -116
- {PyGeodesy-24.5.15.dist-info → PyGeodesy-24.6.1.dist-info}/WHEEL +0 -0
- {PyGeodesy-24.5.15.dist-info → PyGeodesy-24.6.1.dist-info}/top_level.txt +0 -0
pygeodesy/ltpTuples.py
CHANGED
|
@@ -18,11 +18,12 @@ from pygeodesy.errors import _TypeError, _TypesError, _xattr, \
|
|
|
18
18
|
_xkwds, _xkwds_item2
|
|
19
19
|
from pygeodesy.fmath import hypot, hypot_
|
|
20
20
|
from pygeodesy.interns import NN, _4_, _azimuth_, _center_, _COMMASPACE_, \
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
_ecef_, _elevation_, _height_, _lat_, _lon_, \
|
|
22
|
+
_ltp_, _M_, _name_, _up_, _X_, _x_, _xyz_, \
|
|
23
|
+
_Y_, _y_, _z_
|
|
24
24
|
from pygeodesy.lazily import _ALL_DOCS, _ALL_LAZY, _ALL_MODS as _MODS
|
|
25
|
-
from pygeodesy.named import
|
|
25
|
+
from pygeodesy.named import _name__, _name1__, _name2__, _NamedBase, \
|
|
26
|
+
_NamedTuple, _Pass, _xnamed
|
|
26
27
|
from pygeodesy.namedTuples import LatLon2Tuple, PhiLam2Tuple, Vector3Tuple
|
|
27
28
|
from pygeodesy.props import deprecated_method, deprecated_Property_RO, \
|
|
28
29
|
Property_RO, property_RO
|
|
@@ -35,13 +36,16 @@ from pygeodesy.vector3d import Vector3d
|
|
|
35
36
|
from math import cos, radians
|
|
36
37
|
|
|
37
38
|
__all__ = _ALL_LAZY.ltpTuples
|
|
38
|
-
__version__ = '24.
|
|
39
|
+
__version__ = '24.05.31'
|
|
39
40
|
|
|
40
41
|
_aer_ = 'aer'
|
|
41
42
|
_alt_ = 'alt'
|
|
43
|
+
_down_ = 'down'
|
|
44
|
+
_east_ = 'east'
|
|
42
45
|
_enu_ = 'enu'
|
|
43
46
|
_h__ = 'h_'
|
|
44
47
|
_ned_ = 'ned'
|
|
48
|
+
_north_ = 'north'
|
|
45
49
|
_local_ = 'local'
|
|
46
50
|
_roll_ = 'roll'
|
|
47
51
|
_slantrange_ = 'slantrange'
|
|
@@ -108,7 +112,7 @@ def _xyzLocal(*Types, **name_inst):
|
|
|
108
112
|
try:
|
|
109
113
|
return inst.xyzLocal
|
|
110
114
|
except (AttributeError, TypeError):
|
|
111
|
-
raise _TypeError(n, inst,
|
|
115
|
+
raise _TypeError(n, inst, txt_not_=_local_)
|
|
112
116
|
|
|
113
117
|
|
|
114
118
|
class _NamedAerNed(_NamedBase):
|
|
@@ -122,56 +126,66 @@ class _NamedAerNed(_NamedBase):
|
|
|
122
126
|
'''
|
|
123
127
|
return self._ltp
|
|
124
128
|
|
|
125
|
-
def toAer(self, Aer=None, **
|
|
129
|
+
def toAer(self, Aer=None, **name_Aer_kwds):
|
|
126
130
|
'''Get the I{local} I{Azimuth, Elevation, slant Range} (AER) components.
|
|
127
131
|
|
|
128
132
|
@kwarg Aer: Class to return AER (L{Aer}) or C{None}.
|
|
129
|
-
@kwarg
|
|
130
|
-
|
|
133
|
+
@kwarg name_Aer_kwds: Optional C{B{name}=NN} (C{str}) and
|
|
134
|
+
optional, additional B{L{Aer}} keyword arguments,
|
|
135
|
+
ignored if B{C{Aer}} is C{None}.
|
|
131
136
|
|
|
132
137
|
@return: AER as an L{Aer} instance or if C{B{Aer} is None},
|
|
133
138
|
an L{Aer4Tuple}C{(azimuth, elevation, slantrange, ltp)}.
|
|
139
|
+
|
|
140
|
+
@raise TypeError: Invalid B{C{Aer}} or B{C{name_Aer_kwds}}.
|
|
134
141
|
'''
|
|
135
|
-
return self.xyz4._toXyz(Aer,
|
|
142
|
+
return self.xyz4._toXyz(Aer, name_Aer_kwds)
|
|
136
143
|
|
|
137
|
-
def toEnu(self, Enu=None, **
|
|
144
|
+
def toEnu(self, Enu=None, **name_Enu_kwds):
|
|
138
145
|
'''Get the I{local} I{East, North, Up} (ENU) components.
|
|
139
146
|
|
|
140
147
|
@kwarg Enu: Class to return ENU (L{Enu}) or C{None}.
|
|
141
|
-
@kwarg
|
|
142
|
-
|
|
148
|
+
@kwarg name_Enu_kwds: Optional C{B{name}=NN} (C{str}) and
|
|
149
|
+
optional, additional B{L{Enu}} keyword arguments,
|
|
150
|
+
ignored if C{B{Enu} is None}.
|
|
143
151
|
|
|
144
152
|
@return: ENU as an L{Enu} instance or if C{B{Enu} is None},
|
|
145
153
|
an L{Enu4Tuple}C{(east, north, up, ltp)}.
|
|
154
|
+
|
|
155
|
+
@raise TypeError: Invalid B{C{Enu}} or B{C{name_Enu_kwds}}.
|
|
146
156
|
'''
|
|
147
|
-
return self.xyz4._toXyz(Enu,
|
|
157
|
+
return self.xyz4._toXyz(Enu, name_Enu_kwds)
|
|
148
158
|
|
|
149
|
-
def toNed(self, Ned=None, **
|
|
159
|
+
def toNed(self, Ned=None, **name_Ned_kwds):
|
|
150
160
|
'''Get the I{local} I{North, East, Down} (NED) components.
|
|
151
161
|
|
|
152
162
|
@kwarg Ned: Class to return NED (L{Ned}) or C{None}.
|
|
153
|
-
@kwarg
|
|
154
|
-
|
|
163
|
+
@kwarg name_Ned_kwds: Optional C{B{name}=NN} (C{str}) and
|
|
164
|
+
optional, additional B{L{Ned}} keyword arguments,
|
|
165
|
+
ignored if B{C{Ned}} is C{None}.
|
|
155
166
|
|
|
156
167
|
@return: NED as an L{Ned} instance or if C{B{Ned} is None},
|
|
157
168
|
an L{Ned4Tuple}C{(north, east, down, ltp)}.
|
|
169
|
+
|
|
170
|
+
@raise TypeError: Invalid B{C{Ned}} or B{C{name_Ned_kwds}}.
|
|
158
171
|
'''
|
|
159
|
-
return self.xyz4._toXyz(Ned,
|
|
172
|
+
return self.xyz4._toXyz(Ned, name_Ned_kwds)
|
|
160
173
|
|
|
161
|
-
def toXyz(self, Xyz=None, **
|
|
174
|
+
def toXyz(self, Xyz=None, **name_Xyz_kwds):
|
|
162
175
|
'''Get the local I{X, Y, Z} (XYZ) components.
|
|
163
176
|
|
|
164
177
|
@kwarg Xyz: Class to return XYZ (L{XyzLocal}, L{Enu},
|
|
165
178
|
L{Ned}, L{Aer}) or C{None}.
|
|
166
|
-
@kwarg
|
|
167
|
-
|
|
179
|
+
@kwarg name_Xyz_kwds: Optional C{B{name}=NN} (C{str}) and
|
|
180
|
+
optional, additional B{C{Xyz}} keyword arguments,
|
|
181
|
+
ignored if C{B{Xyz} is None}.
|
|
168
182
|
|
|
169
183
|
@return: XYZ as an B{C{Xyz}} instance or if C{B{Xyz} is None},
|
|
170
184
|
an L{Xyz4Tuple}C{(x, y, z, ltp)}.
|
|
171
185
|
|
|
172
|
-
@raise TypeError: Invalid B{C{Xyz}}.
|
|
186
|
+
@raise TypeError: Invalid B{C{Xyz}} or B{C{name_Xyz_kwds}}.
|
|
173
187
|
'''
|
|
174
|
-
return self.xyz4._toXyz(Xyz,
|
|
188
|
+
return self.xyz4._toXyz(Xyz, name_Xyz_kwds)
|
|
175
189
|
|
|
176
190
|
@Property_RO
|
|
177
191
|
def xyz(self):
|
|
@@ -200,7 +214,7 @@ class Aer(_NamedAerNed):
|
|
|
200
214
|
_slantrange = _0_0 # distance (C{Meter})
|
|
201
215
|
_toStr = _aer_
|
|
202
216
|
|
|
203
|
-
def __init__(self, azimuth_aer, elevation=0, slantrange=0, ltp=None, name
|
|
217
|
+
def __init__(self, azimuth_aer, elevation=0, slantrange=0, ltp=None, **name):
|
|
204
218
|
'''New L{Aer}.
|
|
205
219
|
|
|
206
220
|
@arg azimuth_aer: Scalar azimuth, bearing from North (compass C{degrees})
|
|
@@ -214,7 +228,7 @@ class Aer(_NamedAerNed):
|
|
|
214
228
|
B{C{azimuth_aer}}.
|
|
215
229
|
@kwarg ltp: The I{local tangent plane}, (geodetic) origin (L{Ltp},
|
|
216
230
|
L{LocalCartesian}).
|
|
217
|
-
@kwarg name: Optional name (C{str}).
|
|
231
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
218
232
|
|
|
219
233
|
@raise TypeError: Invalid B{C{azimuth_aer}} or B{C{ltp}}.
|
|
220
234
|
|
|
@@ -225,18 +239,18 @@ class Aer(_NamedAerNed):
|
|
|
225
239
|
self._azimuth = Bearing(azimuth=azimuth_aer)
|
|
226
240
|
self._elevation = Degrees_(elevation=elevation, low=_N_90_0, high=_90_0)
|
|
227
241
|
self._slantrange = Meter_(slantrange=slantrange)
|
|
228
|
-
p, n = ltp, name
|
|
242
|
+
p, n = ltp, _name__(**name)
|
|
229
243
|
else: # PYCHOK no cover
|
|
230
244
|
p = _xyzLocal(Aer, Aer4Tuple, Ned, azimuth_aer=azimuth_aer)
|
|
231
245
|
aer = p.toAer() if p else azimuth_aer
|
|
232
246
|
self._azimuth, self._elevation, self._slantrange = \
|
|
233
247
|
aer.azimuth, aer.elevation, aer.slantrange
|
|
234
248
|
p = _xattr(aer, ltp=ltp)
|
|
235
|
-
n =
|
|
249
|
+
n = aer._name__(name)
|
|
236
250
|
|
|
237
251
|
if p:
|
|
238
252
|
self._ltp = _MODS.ltp._xLtp(p)
|
|
239
|
-
if
|
|
253
|
+
if n:
|
|
240
254
|
self.name = n
|
|
241
255
|
|
|
242
256
|
@Property_RO
|
|
@@ -410,7 +424,7 @@ class Ned(_NamedAerNed):
|
|
|
410
424
|
_north = _0_0 # north, XyzLocal.x (C{meter})
|
|
411
425
|
_toStr = _ned_
|
|
412
426
|
|
|
413
|
-
def __init__(self, north_ned, east=0, down=0, ltp=None, name
|
|
427
|
+
def __init__(self, north_ned, east=0, down=0, ltp=None, **name):
|
|
414
428
|
'''New L{Ned} vector.
|
|
415
429
|
|
|
416
430
|
@arg north_ned: Scalar North component (C{meter}) or a previous
|
|
@@ -424,7 +438,7 @@ class Ned(_NamedAerNed):
|
|
|
424
438
|
scalar B{C{north_ned}}.
|
|
425
439
|
@kwarg ltp: The I{local tangent plane}, (geodetic) origin (L{Ltp},
|
|
426
440
|
L{LocalCartesian}).
|
|
427
|
-
@kwarg name: Optional name (C{str}).
|
|
441
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
428
442
|
|
|
429
443
|
@raise TypeError: Invalid B{C{north_ned}} or B{C{ltp}}.
|
|
430
444
|
|
|
@@ -434,13 +448,13 @@ class Ned(_NamedAerNed):
|
|
|
434
448
|
self._north = Meter(north=north_ned or _0_0)
|
|
435
449
|
self._east = Meter(east=east or _0_0)
|
|
436
450
|
self._down = Meter(down=down or _0_0)
|
|
437
|
-
p, n = ltp, name
|
|
451
|
+
p, n = ltp, _name__(**name)
|
|
438
452
|
else: # PYCHOK no cover
|
|
439
453
|
p = _xyzLocal(Ned, Ned4Tuple, Aer, north_ned=north_ned)
|
|
440
454
|
ned = p.toNed() if p else north_ned
|
|
441
455
|
self._north, self._east, self._down = ned.north, ned.east, ned.down
|
|
442
456
|
p = _xattr(ned, ltp=ltp)
|
|
443
|
-
n =
|
|
457
|
+
n = ned._name__(name)
|
|
444
458
|
|
|
445
459
|
if p:
|
|
446
460
|
self._ltp = _MODS.ltp._xLtp(p)
|
|
@@ -644,7 +658,7 @@ class XyzLocal(_Vector3d):
|
|
|
644
658
|
'''
|
|
645
659
|
_ltp = None # local tangent plane (C{Ltp}), origin
|
|
646
660
|
|
|
647
|
-
def __init__(self, x_xyz, y=0, z=0, ltp=None, name
|
|
661
|
+
def __init__(self, x_xyz, y=0, z=0, ltp=None, **name):
|
|
648
662
|
'''New L{XyzLocal}.
|
|
649
663
|
|
|
650
664
|
@arg x_xyz: Scalar X component (C{meter}), C{positive east} or a
|
|
@@ -658,6 +672,7 @@ class XyzLocal(_Vector3d):
|
|
|
658
672
|
used with scalar B{C{x_xyz}}.
|
|
659
673
|
@kwarg ltp: The I{local tangent plane}, (geodetic) origin (L{Ltp},
|
|
660
674
|
L{LocalCartesian}).
|
|
675
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
661
676
|
|
|
662
677
|
@raise TypeError: Invalid B{C{x_xyz}} or B{C{ltp}}.
|
|
663
678
|
|
|
@@ -667,12 +682,12 @@ class XyzLocal(_Vector3d):
|
|
|
667
682
|
self._x = Meter(x=x_xyz or _0_0)
|
|
668
683
|
self._y = Meter(y=y or _0_0)
|
|
669
684
|
self._z = Meter(z=z or _0_0)
|
|
670
|
-
p, n = ltp, name
|
|
685
|
+
p, n = ltp, _name__(**name)
|
|
671
686
|
else:
|
|
672
687
|
xyz = _xyzLocal(XyzLocal, Xyz4Tuple, Local9Tuple, x_xyz=x_xyz) or x_xyz
|
|
673
688
|
self._x, self._y, self._z = xyz.x, xyz.y, xyz.z
|
|
674
689
|
p = _xattr(xyz, ltp=ltp)
|
|
675
|
-
n =
|
|
690
|
+
n = xyz._name__(name)
|
|
676
691
|
|
|
677
692
|
if p:
|
|
678
693
|
self._ltp = _MODS.ltp._xLtp(p)
|
|
@@ -705,8 +720,8 @@ class XyzLocal(_Vector3d):
|
|
|
705
720
|
|
|
706
721
|
@return: New instance (C{self.__class__}).
|
|
707
722
|
'''
|
|
708
|
-
kwds =
|
|
709
|
-
return self.__class__(*args, **kwds)
|
|
723
|
+
kwds = _name1__(kwds, _or_nameof=self)
|
|
724
|
+
return self.__class__(*args, **_xkwds(kwds, ltp=self.ltp))
|
|
710
725
|
|
|
711
726
|
@Property_RO
|
|
712
727
|
def down(self):
|
|
@@ -753,6 +768,14 @@ class XyzLocal(_Vector3d):
|
|
|
753
768
|
'''
|
|
754
769
|
return self._ltp
|
|
755
770
|
|
|
771
|
+
def _ltp_kwds_name3(self, ltp, kwds):
|
|
772
|
+
'''(INTERNAL) Helper for methods C{toCartesian} and C{toLatLon}.
|
|
773
|
+
'''
|
|
774
|
+
ltp = _MODS.ltp._xLtp(ltp, self.ltp)
|
|
775
|
+
kwds = _name1__(kwds, _or_nameof=self)
|
|
776
|
+
kwds = _name1__(kwds, _or_nameof=ltp)
|
|
777
|
+
return ltp, kwds, kwds.get(_name_, NN)
|
|
778
|
+
|
|
756
779
|
@Property_RO
|
|
757
780
|
def ned4(self):
|
|
758
781
|
'''Get the C{(north, east, down, ltp)} components (L{Ned4Tuple}).
|
|
@@ -771,124 +794,136 @@ class XyzLocal(_Vector3d):
|
|
|
771
794
|
'''
|
|
772
795
|
return self.aer4.slantrange
|
|
773
796
|
|
|
774
|
-
def toAer(self, Aer=None, **
|
|
797
|
+
def toAer(self, Aer=None, **name_Aer_kwds):
|
|
775
798
|
'''Get the local I{Azimuth, Elevation, slantRange} components.
|
|
776
799
|
|
|
777
800
|
@kwarg Aer: Class to return AER (L{Aer}) or C{None}.
|
|
778
|
-
@kwarg
|
|
779
|
-
|
|
801
|
+
@kwarg name_Aer_kwds: Optional C{B{name}=NN} (C{str}) and
|
|
802
|
+
optional, additional B{C{Aer}} keyword arguments,
|
|
803
|
+
ignored if C{B{Aer} is None}.
|
|
780
804
|
|
|
781
805
|
@return: AER as an L{Aer} instance or if C{B{Aer} is None}, an
|
|
782
806
|
L{Aer4Tuple}C{(azimuth, elevation, slantrange, ltp)}.
|
|
783
807
|
|
|
784
|
-
@raise TypeError: Invalid B{C{Aer}}.
|
|
808
|
+
@raise TypeError: Invalid B{C{Aer}} or B{C{name_Aer_kwds}}.
|
|
785
809
|
'''
|
|
786
|
-
return self.aer4._toAer(Aer,
|
|
810
|
+
return self.aer4._toAer(Aer, name_Aer_kwds)
|
|
787
811
|
|
|
788
|
-
def toCartesian(self, Cartesian=None, ltp=None, **
|
|
812
|
+
def toCartesian(self, Cartesian=None, ltp=None, **name_Cartesian_kwds):
|
|
789
813
|
'''Get the geocentric C{(x, y, z)} (ECEF) coordinates of this local.
|
|
790
814
|
|
|
791
815
|
@kwarg Cartesian: Optional class to return C{(x, y, z)} (C{Cartesian})
|
|
792
816
|
or C{None}.
|
|
793
817
|
@kwarg ltp: Optional I{local tangent plane} (LTP) (L{Ltp}),
|
|
794
818
|
overriding this C{ltp}.
|
|
795
|
-
@kwarg
|
|
796
|
-
|
|
819
|
+
@kwarg name_Cartesian_kwds: Optional C{B{name}=NN} (C{str}) and
|
|
820
|
+
optional, additional B{C{Cartesian}} keyword arguments,
|
|
821
|
+
ignored if C{B{Cartesian} is None}.
|
|
797
822
|
|
|
798
823
|
@return: A B{C{Cartesian}} instance of if C{B{Cartesian} is None}, an
|
|
799
824
|
L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)}
|
|
800
825
|
with C{M=None}, always.
|
|
801
826
|
|
|
802
827
|
@raise TypeError: Invalid B{C{ltp}}, B{C{Cartesian}} or
|
|
803
|
-
B{C{
|
|
828
|
+
B{C{name_Cartesian_kwds}}.
|
|
804
829
|
'''
|
|
805
|
-
ltp =
|
|
830
|
+
ltp, kwds, n = self._ltp_kwds_name3(ltp, name_Cartesian_kwds)
|
|
806
831
|
if Cartesian is None:
|
|
807
|
-
|
|
832
|
+
t = ltp._local2ecef(self, nine=True)
|
|
833
|
+
r = _xnamed(t, n) if n else t
|
|
808
834
|
else:
|
|
809
|
-
|
|
810
|
-
|
|
835
|
+
kwds = _xkwds(kwds, datum=ltp.datum)
|
|
836
|
+
x, y, z = ltp._local2ecef(self)
|
|
811
837
|
r = Cartesian(x, y, z, **kwds)
|
|
812
|
-
return
|
|
838
|
+
return r
|
|
813
839
|
|
|
814
|
-
def toEnu(self, Enu=None, **
|
|
840
|
+
def toEnu(self, Enu=None, **name_Enu_kwds):
|
|
815
841
|
'''Get the local I{East, North, Up} (ENU) components.
|
|
816
842
|
|
|
817
843
|
@kwarg Enu: Class to return ENU (L{Enu}) or C{None}.
|
|
818
|
-
@kwarg
|
|
819
|
-
|
|
844
|
+
@kwarg name_Enu_kwds: Optional C{B{name}=NN} (C{str}) and
|
|
845
|
+
optional, additional B{C{Enu}} keyword arguments,
|
|
846
|
+
ignored if C{B{Enu} is None}.
|
|
820
847
|
|
|
821
848
|
@return: ENU as an L{Enu} instance or if C{B{Enu} is None},
|
|
822
849
|
an L{Enu4Tuple}C{(east, north, up, ltp)}.
|
|
850
|
+
|
|
851
|
+
@raise TypeError: Invalid B{C{Enu}} or B{C{name_Enu_kwds}}.
|
|
823
852
|
'''
|
|
824
|
-
return self.enu4._toEnu(Enu,
|
|
853
|
+
return self.enu4._toEnu(Enu, name_Enu_kwds)
|
|
825
854
|
|
|
826
|
-
def toLatLon(self, LatLon=None, ltp=None, **
|
|
855
|
+
def toLatLon(self, LatLon=None, ltp=None, **name_LatLon_kwds):
|
|
827
856
|
'''Get the geodetic C{(lat, lon, height)} coordinates if this local.
|
|
828
857
|
|
|
829
858
|
@kwarg LatLon: Optional class to return C{(x, y, z)} (C{LatLon})
|
|
830
859
|
or C{None}.
|
|
831
860
|
@kwarg ltp: Optional I{local tangent plane} (LTP) (L{Ltp}),
|
|
832
861
|
overriding this ENU/NED/AER/XYZ's LTP.
|
|
833
|
-
@kwarg
|
|
834
|
-
|
|
862
|
+
@kwarg name_LatLon_kwds: Optional C{B{name}=NN} (C{str}) and
|
|
863
|
+
optional, additional B{C{LatLon}} keyword arguments,
|
|
864
|
+
ignored if C{B{LatLon} is None}.
|
|
835
865
|
|
|
836
866
|
@return: An B{C{LatLon}} instance of if C{B{LatLon} is None}, an
|
|
837
867
|
L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M,
|
|
838
868
|
datum)} with C{M=None}, always.
|
|
839
869
|
|
|
840
870
|
@raise TypeError: Invalid B{C{ltp}}, B{C{LatLon}} or
|
|
841
|
-
B{C{
|
|
871
|
+
B{C{name_LatLon_kwds}}.
|
|
842
872
|
'''
|
|
843
|
-
ltp =
|
|
844
|
-
|
|
873
|
+
ltp, kwds, n = self._ltp_kwds_name3(ltp, name_LatLon_kwds)
|
|
874
|
+
t = ltp._local2ecef(self, nine=True)
|
|
845
875
|
if LatLon is None:
|
|
846
|
-
r = _xnamed(
|
|
876
|
+
r = _xnamed(t, n) if n else t
|
|
847
877
|
else:
|
|
848
|
-
kwds = _xkwds(
|
|
849
|
-
|
|
850
|
-
r = LatLon(r.lat, r.lon, **kwds) # XXX ltp?
|
|
878
|
+
kwds = _xkwds(kwds, height=t.height, datum=t.datum)
|
|
879
|
+
r = LatLon(t.lat, t.lon, **kwds) # XXX ltp?
|
|
851
880
|
return r
|
|
852
881
|
|
|
853
|
-
def toLocal9Tuple(self, M=False, name
|
|
882
|
+
def toLocal9Tuple(self, M=False, **name):
|
|
854
883
|
'''Get this local as a C{Local9Tuple}.
|
|
855
884
|
|
|
856
885
|
@kwarg M: Optionally include the rotation matrix (C{bool}).
|
|
857
|
-
@kwarg name: Optional name (C{str}).
|
|
886
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
858
887
|
|
|
859
888
|
@return: L{Local9Tuple}C{(x, y, z, lat, lon, height, ltp,
|
|
860
889
|
ecef, M)} with C{ltp} this C{Ltp}, C{ecef} an
|
|
861
890
|
L{Ecef9Tuple} and C{M} L{EcefMatrix} or C{None}.
|
|
862
891
|
'''
|
|
863
892
|
ltp = self.ltp # see C{self.toLatLon}
|
|
864
|
-
t
|
|
893
|
+
t = ltp._local2ecef(self, nine=True, M=M)
|
|
865
894
|
return Local9Tuple(self.x, self.y, self.z, t.lat, t.lon, t.height,
|
|
866
|
-
ltp, t, t.M, name=
|
|
895
|
+
ltp, t, t.M, name=t._name__(name))
|
|
867
896
|
|
|
868
|
-
def toNed(self, Ned=None, **
|
|
897
|
+
def toNed(self, Ned=None, **name_Ned_kwds):
|
|
869
898
|
'''Get the local I{North, East, Down} (Ned) components.
|
|
870
899
|
|
|
871
900
|
@kwarg Ned: Class to return NED (L{Ned}) or C{None}.
|
|
872
|
-
@kwarg
|
|
873
|
-
|
|
901
|
+
@kwarg name_Ned_kwds: Optional C{B{name}=NN} (C{str}) and
|
|
902
|
+
optional, additional B{C{Ned}} keyword arguments,
|
|
903
|
+
ignored if C{B{Ned} is None}.
|
|
874
904
|
|
|
875
905
|
@return: NED as an L{Ned} instance or if C{B{Ned} is None},
|
|
876
906
|
an L{Ned4Tuple}C{(north, east, down, ltp)}.
|
|
907
|
+
|
|
908
|
+
@raise TypeError: Invalid B{C{Ned}} or B{C{name_Ned_kwds}}.
|
|
877
909
|
'''
|
|
878
|
-
return self.ned4._toNed(Ned,
|
|
910
|
+
return self.ned4._toNed(Ned, name_Ned_kwds)
|
|
879
911
|
|
|
880
|
-
def toXyz(self, Xyz=None, **
|
|
912
|
+
def toXyz(self, Xyz=None, **name_Xyz_kwds):
|
|
881
913
|
'''Get the local I{X, Y, Z} (XYZ) components.
|
|
882
914
|
|
|
883
915
|
@kwarg Xyz: Class to return XYZ (L{XyzLocal}, L{Enu},
|
|
884
916
|
L{Ned}, L{Aer}) or C{None}.
|
|
885
|
-
@kwarg
|
|
886
|
-
|
|
917
|
+
@kwarg name_Xyz_kwds: Optional C{B{name}=NN} (C{str}) and
|
|
918
|
+
optional, additional B{C{Xyz}} keyword arguments,
|
|
919
|
+
ignored if C{B{Xyz} is None}.
|
|
887
920
|
|
|
888
921
|
@return: XYZ as an B{C{Xyz}} instance or if C{B{Xyz} is None},
|
|
889
922
|
an L{Xyz4Tuple}C{(x, y, z, ltp)}.
|
|
923
|
+
|
|
924
|
+
@raise TypeError: Invalid B{C{Xyz}} or B{C{name_EXyz_kwds}}.
|
|
890
925
|
'''
|
|
891
|
-
return self.xyz4._toXyz(Xyz,
|
|
926
|
+
return self.xyz4._toXyz(Xyz, name_Xyz_kwds)
|
|
892
927
|
|
|
893
928
|
@Property_RO
|
|
894
929
|
def up(self):
|
|
@@ -942,10 +977,11 @@ class Xyz4Tuple(_NamedTuple):
|
|
|
942
977
|
def _toXyz(self, Cls, Cls_kwds):
|
|
943
978
|
'''(INTERNAL) Return C{Cls(..., **Cls_kwds)} instance.
|
|
944
979
|
'''
|
|
980
|
+
kwds = _name1__(Cls_kwds, _or_nameof=self)
|
|
945
981
|
if issubclassof(Cls, XyzLocal):
|
|
946
|
-
return
|
|
982
|
+
return Cls(*self, **kwds)
|
|
947
983
|
else:
|
|
948
|
-
return _4Tuple2Cls(self, Cls,
|
|
984
|
+
return _4Tuple2Cls(self, Cls, kwds)
|
|
949
985
|
|
|
950
986
|
@Property_RO
|
|
951
987
|
def xyzLocal(self):
|
|
@@ -962,7 +998,7 @@ class Enu(XyzLocal):
|
|
|
962
998
|
'''
|
|
963
999
|
_toStr = _enu_
|
|
964
1000
|
|
|
965
|
-
def __init__(self, east_enu, north=0, up=0, ltp=None, name
|
|
1001
|
+
def __init__(self, east_enu, north=0, up=0, ltp=None, **name):
|
|
966
1002
|
'''New L{Enu}.
|
|
967
1003
|
|
|
968
1004
|
@arg east_enu: Scalar East component (C{meter}) or a previous
|
|
@@ -975,27 +1011,28 @@ class Enu(XyzLocal):
|
|
|
975
1011
|
normal from the surface of the ellipsoid or sphere (C{meter}).
|
|
976
1012
|
@kwarg ltp: The I{local tangent plane}, (geodetic) origin (L{Ltp},
|
|
977
1013
|
L{LocalCartesian}).
|
|
978
|
-
@kwarg name: Optional name (C{str}).
|
|
1014
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
979
1015
|
|
|
980
1016
|
@raise TypeError: Invalid B{C{east_enu}} or B{C{ltp}}.
|
|
981
1017
|
|
|
982
1018
|
@raise UnitError: Invalid B{C{east_enu}}, B{C{north}} or B{C{up}}.
|
|
983
1019
|
'''
|
|
984
|
-
XyzLocal.__init__(self, east_enu, north, up, ltp=ltp, name
|
|
1020
|
+
XyzLocal.__init__(self, east_enu, north, up, ltp=ltp, **name)
|
|
985
1021
|
|
|
986
|
-
def toUvw(self, location, Uvw=None, **
|
|
1022
|
+
def toUvw(self, location, Uvw=None, **name_Uvw_kwds):
|
|
987
1023
|
'''Get the I{u, v, w} (UVW) components at a location.
|
|
988
1024
|
|
|
989
1025
|
@arg location: The geodetic (C{LatLon}) or geocentric (C{Cartesian},
|
|
990
1026
|
L{Vector3d}) location, like a Point-Of-View.
|
|
991
1027
|
@kwarg Uvw: Class to return UWV (L{Uvw}) or C{None}.
|
|
992
|
-
@kwarg
|
|
993
|
-
|
|
1028
|
+
@kwarg name_Uvw_kwds: Optional C{B{name}=NN} (C{str}) and optional,
|
|
1029
|
+
additional B{L{Uvw}} keyword arguments, ignored if
|
|
1030
|
+
C{B{Uvw} is None}.
|
|
994
1031
|
|
|
995
1032
|
@return: UVW as a L{Uvw} instance or if C{B{Uvw} is None}, a
|
|
996
1033
|
L{Uvw3Tuple}C{(u, v, w)}.
|
|
997
1034
|
|
|
998
|
-
@raise TypeError:
|
|
1035
|
+
@raise TypeError: Invalid B{C{location}} or B{C{name_Uvw_kwds}}.
|
|
999
1036
|
|
|
1000
1037
|
@see: Function U{lookAtSpheroid<https://PyPI.org/project/pymap3d>}.
|
|
1001
1038
|
'''
|
|
@@ -1009,8 +1046,10 @@ class Enu(XyzLocal):
|
|
|
1009
1046
|
U = cb * t - sb * e
|
|
1010
1047
|
V = cb * e + sb * t
|
|
1011
1048
|
W = ca * n + sa * u
|
|
1012
|
-
|
|
1013
|
-
|
|
1049
|
+
|
|
1050
|
+
n, kwds = _name2__(name_Uvw_kwds, _or_nameof=self)
|
|
1051
|
+
return Uvw3Tuple(U, V, W, name=n) if Uvw is None else \
|
|
1052
|
+
Uvw( U, V, W, name=n, **kwds)
|
|
1014
1053
|
|
|
1015
1054
|
@Property_RO
|
|
1016
1055
|
def xyzLocal(self):
|
|
@@ -1028,10 +1067,11 @@ class Enu4Tuple(_NamedTuple):
|
|
|
1028
1067
|
def _toEnu(self, Cls, Cls_kwds):
|
|
1029
1068
|
'''(INTERNAL) Return C{Cls(..., **Cls_kwds)} instance.
|
|
1030
1069
|
'''
|
|
1070
|
+
kwds = _name1__(Cls_kwds, _or_nameof=self)
|
|
1031
1071
|
if issubclassof(Cls, XyzLocal):
|
|
1032
|
-
return
|
|
1072
|
+
return Cls(*self, **kwds)
|
|
1033
1073
|
else:
|
|
1034
|
-
return _4Tuple2Cls(self, Cls,
|
|
1074
|
+
return _4Tuple2Cls(self, Cls, kwds)
|
|
1035
1075
|
|
|
1036
1076
|
@Property_RO
|
|
1037
1077
|
def xyzLocal(self):
|
|
@@ -1128,87 +1168,99 @@ class Local9Tuple(_NamedTuple):
|
|
|
1128
1168
|
'''
|
|
1129
1169
|
return self.xyzLocal.aer4.slantrange
|
|
1130
1170
|
|
|
1131
|
-
def toAer(self, Aer=None, **
|
|
1171
|
+
def toAer(self, Aer=None, **name_Aer_kwds):
|
|
1132
1172
|
'''Get the I{local} I{Azimuth, Elevation, slant Range} (AER) components.
|
|
1133
1173
|
|
|
1134
1174
|
@kwarg Aer: Class to return AER (L{Aer}) or C{None}.
|
|
1135
|
-
@kwarg
|
|
1136
|
-
|
|
1175
|
+
@kwarg name_Aer_kwds: Optional C{B{name}=NN} (C{str}) and optional,
|
|
1176
|
+
additional B{L{Aer}} keyword arguments, ignored if
|
|
1177
|
+
B{C{Aer}} is C{None}.
|
|
1137
1178
|
|
|
1138
|
-
@return: AER as an L{Aer} instance or if C{B{Aer} is None},
|
|
1139
|
-
|
|
1179
|
+
@return: AER as an L{Aer} instance or if C{B{Aer} is None}, an
|
|
1180
|
+
L{Aer4Tuple}C{(azimuth, elevation, slantrange, ltp)}.
|
|
1181
|
+
|
|
1182
|
+
@raise TypeError: Invalid B{C{Aer}} or B{C{name_Aer_kwds}}.
|
|
1140
1183
|
'''
|
|
1141
|
-
return self.xyzLocal.toAer(Aer=Aer, **
|
|
1184
|
+
return self.xyzLocal.toAer(Aer=Aer, **name_Aer_kwds)
|
|
1142
1185
|
|
|
1143
|
-
def toCartesian(self, Cartesian=None, **
|
|
1186
|
+
def toCartesian(self, Cartesian=None, **name_Cartesian_kwds):
|
|
1144
1187
|
'''Convert this I{local} to I{geocentric} C{(x, y, z)} (ECEF).
|
|
1145
1188
|
|
|
1146
1189
|
@kwarg Cartesian: Optional class to return C{(x, y, z)} (C{Cartesian})
|
|
1147
1190
|
or C{None}.
|
|
1148
|
-
@kwarg
|
|
1149
|
-
|
|
1191
|
+
@kwarg name_Cartesian_kwds: Optional C{B{name}=NN} (C{str}) and optional,
|
|
1192
|
+
additional B{C{Cartesian}} keyword arguments, ignored if
|
|
1193
|
+
C{B{Cartesian} is None}.
|
|
1150
1194
|
|
|
1151
|
-
@return: A C{B{Cartesian}(x, y, z, **B{Cartesian_kwds})} instance
|
|
1152
|
-
|
|
1195
|
+
@return: A C{B{Cartesian}(x, y, z, **B{Cartesian_kwds})} instance or
|
|
1196
|
+
if C{B{Cartesian} is None}, a L{Vector4Tuple}C{(x, y, z, h)} .
|
|
1153
1197
|
|
|
1154
|
-
@raise TypeError: Invalid B{C{Cartesian}} or B{C{
|
|
1155
|
-
argument.
|
|
1198
|
+
@raise TypeError: Invalid B{C{Cartesian}} or B{C{name_Cartesian_kwds}}.
|
|
1156
1199
|
'''
|
|
1157
|
-
return self.ecef.toCartesian(Cartesian=Cartesian, **
|
|
1200
|
+
return self.ecef.toCartesian(Cartesian=Cartesian, **name_Cartesian_kwds) # PYCHOK _Tuple
|
|
1158
1201
|
|
|
1159
|
-
def toEnu(self, Enu=None, **
|
|
1202
|
+
def toEnu(self, Enu=None, **name_Enu_kwds):
|
|
1160
1203
|
'''Get the I{local} I{East, North, Up} (ENU) components.
|
|
1161
1204
|
|
|
1162
1205
|
@kwarg Enu: Class to return ENU (L{Enu}) or C{None}.
|
|
1163
|
-
@kwarg
|
|
1164
|
-
|
|
1206
|
+
@kwarg name_Enu_kwds: Optional C{B{name}=NN} (C{str}) and optional,
|
|
1207
|
+
additional B{L{Enu}} keyword arguments, ignored if
|
|
1208
|
+
C{B{Enu} is None}.
|
|
1165
1209
|
|
|
1166
|
-
@return: ENU as an L{Enu} instance or if C{B{Enu} is None},
|
|
1167
|
-
|
|
1210
|
+
@return: ENU as an L{Enu} instance or if C{B{Enu} is None}, an
|
|
1211
|
+
L{Enu4Tuple}C{(east, north, up, ltp)}.
|
|
1212
|
+
|
|
1213
|
+
@raise TypeError: Invalid B{C{Enu}} or B{C{name_Enu_kwds}}.
|
|
1168
1214
|
'''
|
|
1169
|
-
return self.xyzLocal.toEnu(Enu=Enu, **
|
|
1215
|
+
return self.xyzLocal.toEnu(Enu=Enu, **name_Enu_kwds)
|
|
1170
1216
|
|
|
1171
|
-
def toLatLon(self, LatLon=None, **
|
|
1217
|
+
def toLatLon(self, LatLon=None, **name_LatLon_kwds):
|
|
1172
1218
|
'''Convert this I{local} to I{geodetic} C{(lat, lon, height)}.
|
|
1173
1219
|
|
|
1174
1220
|
@kwarg LatLon: Optional class to return C{(lat, lon, height)}
|
|
1175
1221
|
(C{LatLon}) or C{None}.
|
|
1176
|
-
@kwarg
|
|
1177
|
-
|
|
1222
|
+
@kwarg name_LatLon_kwds: Optional C{B{name}=NN} (C{str}) and optional,
|
|
1223
|
+
additional B{C{LatLon}} keyword arguments, ignored if
|
|
1224
|
+
C{B{LatLon} is None}.
|
|
1178
1225
|
|
|
1179
1226
|
@return: An instance of C{B{LatLon}(lat, lon, **B{LatLon_kwds})}
|
|
1180
1227
|
or if C{B{LatLon} is None}, a L{LatLon3Tuple}C{(lat, lon,
|
|
1181
1228
|
height)} respectively L{LatLon4Tuple}C{(lat, lon, height,
|
|
1182
1229
|
datum)} depending on whether C{datum} is un-/specified.
|
|
1183
1230
|
|
|
1184
|
-
@raise TypeError: Invalid B{C{LatLon}} or B{C{
|
|
1185
|
-
argument.
|
|
1231
|
+
@raise TypeError: Invalid B{C{LatLon}} or B{C{name_LatLon_kwds}}.
|
|
1186
1232
|
'''
|
|
1187
|
-
return self.ecef.toLatLon(LatLon=LatLon, **
|
|
1233
|
+
return self.ecef.toLatLon(LatLon=LatLon, **name_LatLon_kwds) # PYCHOK _Tuple
|
|
1188
1234
|
|
|
1189
|
-
def toNed(self, Ned=None, **
|
|
1235
|
+
def toNed(self, Ned=None, **name_Ned_kwds):
|
|
1190
1236
|
'''Get the I{local} I{North, East, Down} (NED) components.
|
|
1191
1237
|
|
|
1192
1238
|
@kwarg Ned: Class to return NED (L{Ned}) or C{None}.
|
|
1193
|
-
@kwarg
|
|
1194
|
-
|
|
1239
|
+
@kwarg name_Ned_kwds: Optional C{B{name}=NN} (C{str}) and optional,
|
|
1240
|
+
additional B{L{Ned}} keyword arguments, ignored if
|
|
1241
|
+
B{C{Ned}} is C{None}.
|
|
1195
1242
|
|
|
1196
|
-
@return: NED as an L{Ned} instance or if C{B{Ned} is None},
|
|
1197
|
-
|
|
1243
|
+
@return: NED as an L{Ned} instance or if C{B{Ned} is None}, an
|
|
1244
|
+
L{Ned4Tuple}C{(north, east, down, ltp)}.
|
|
1245
|
+
|
|
1246
|
+
@raise TypeError: Invalid B{C{Ned}} or B{C{name_Ned_kwds}}.
|
|
1198
1247
|
'''
|
|
1199
|
-
return self.xyzLocal.toNed(Ned=Ned, **
|
|
1248
|
+
return self.xyzLocal.toNed(Ned=Ned, **name_Ned_kwds)
|
|
1200
1249
|
|
|
1201
|
-
def toXyz(self, Xyz=None, **
|
|
1250
|
+
def toXyz(self, Xyz=None, **name_Xyz_kwds):
|
|
1202
1251
|
'''Get the I{local} I{X, Y, Z} (XYZ) components.
|
|
1203
1252
|
|
|
1204
1253
|
@kwarg Xyz: Class to return XYZ (L{XyzLocal}) or C{None}.
|
|
1205
|
-
@kwarg
|
|
1206
|
-
|
|
1254
|
+
@kwarg name_Xyz_kwds: Optional C{B{name}=NN} (C{str}) and optional,
|
|
1255
|
+
additional B{C{Xyz}} keyword arguments, ignored if
|
|
1256
|
+
C{B{Xyz} is None}.
|
|
1207
1257
|
|
|
1208
1258
|
@return: XYZ as an B{C{Xyz}} instance or if C{B{Xyz} is None},
|
|
1209
1259
|
an L{Xyz4Tuple}C{(x, y, z, ltp)}.
|
|
1260
|
+
|
|
1261
|
+
@raise TypeError: Invalid B{C{Xyz}} or B{C{name_Xyz_kwds}}.
|
|
1210
1262
|
'''
|
|
1211
|
-
return self.xyzLocal.toXyz(Xyz=Xyz, **
|
|
1263
|
+
return self.xyzLocal.toXyz(Xyz=Xyz, **name_Xyz_kwds)
|
|
1212
1264
|
|
|
1213
1265
|
@Property_RO
|
|
1214
1266
|
def up(self):
|
|
@@ -1238,34 +1290,35 @@ class Uvw(_Vector3d):
|
|
|
1238
1290
|
'''
|
|
1239
1291
|
_toStr = _uvw_
|
|
1240
1292
|
|
|
1241
|
-
def __init__(self, u_uvw, v=0, w=0, name
|
|
1293
|
+
def __init__(self, u_uvw, v=0, w=0, **name):
|
|
1242
1294
|
'''New L{Uvw}.
|
|
1243
1295
|
|
|
1244
1296
|
@arg u_uvw: Scalar U component (C{meter}) or a previous instance
|
|
1245
1297
|
(L{Uvw}, L{Uvw3Tuple}, L{Vector3d}).
|
|
1246
1298
|
@kwarg v: V component (C{meter}) only used with scalar B{C{u_uvw}}.
|
|
1247
1299
|
@kwarg w: W component (C{meter}) only used with scalar B{C{u_uvw}}.
|
|
1248
|
-
@kwarg name: Optional name (C{str}).
|
|
1300
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
1249
1301
|
|
|
1250
1302
|
@raise TypeError: Invalid B{C{east_enu}}.
|
|
1251
1303
|
|
|
1252
1304
|
@raise UnitError: Invalid B{C{east_enu}}, B{C{v}} or B{C{w}}.
|
|
1253
1305
|
'''
|
|
1254
|
-
Vector3d.__init__(self, u_uvw, v, w, name
|
|
1306
|
+
Vector3d.__init__(self, u_uvw, v, w, **name)
|
|
1255
1307
|
|
|
1256
|
-
def toEnu(self, location, Enu=Enu, **
|
|
1308
|
+
def toEnu(self, location, Enu=Enu, **name_Enu_kwds):
|
|
1257
1309
|
'''Get the I{East, North, Up} (ENU) components at a location.
|
|
1258
1310
|
|
|
1259
1311
|
@arg location: The geodetic (C{LatLon}) or geocentric (C{Cartesian},
|
|
1260
1312
|
L{Vector3d}) location from where to cast the L{Los}.
|
|
1261
1313
|
@kwarg Enu: Class to return ENU (L{Enu}) or C{None}.
|
|
1262
|
-
@kwarg
|
|
1263
|
-
|
|
1314
|
+
@kwarg name_Enu_kwds: Optional C{B{name}=NN} (C{str}) and optional,
|
|
1315
|
+
additional B{L{Enu}} keyword arguments, ignored if
|
|
1316
|
+
C{B{Enu} is None}.
|
|
1264
1317
|
|
|
1265
1318
|
@return: ENU as an L{Enu} instance or if C{B{Enu} is None}, an
|
|
1266
1319
|
L{Enu4Tuple}C{(east, north, up, ltp)} with C{ltp=None}.
|
|
1267
1320
|
|
|
1268
|
-
@raise TypeError:
|
|
1321
|
+
@raise TypeError: Invalid B{C{location}} or B{C{name_Enu_kwds}}.
|
|
1269
1322
|
|
|
1270
1323
|
@see: Function U{lookAtSpheroid<https://PyPI.org/project/pymap3d>}.
|
|
1271
1324
|
'''
|
|
@@ -1279,8 +1332,10 @@ class Uvw(_Vector3d):
|
|
|
1279
1332
|
E = cb * v - sb * u
|
|
1280
1333
|
N = ca * w - sa * t
|
|
1281
1334
|
U = ca * t + sa * w
|
|
1282
|
-
|
|
1283
|
-
|
|
1335
|
+
|
|
1336
|
+
n, kwds = _name2__(name_Enu_kwds, _or_nameof=self)
|
|
1337
|
+
return Enu4Tuple(E, N, U, name=n) if Enu is None else \
|
|
1338
|
+
Enu( E, N, U, name=n, **kwds)
|
|
1284
1339
|
|
|
1285
1340
|
u = Vector3d.x
|
|
1286
1341
|
|
|
@@ -1305,7 +1360,7 @@ class Los(Aer):
|
|
|
1305
1360
|
'''A Line-Of-Sight (LOS) from a C{LatLon} or C{Cartesian} location.
|
|
1306
1361
|
'''
|
|
1307
1362
|
|
|
1308
|
-
def __init__(self, azimuth_aer, elevation=0, name
|
|
1363
|
+
def __init__(self, azimuth_aer, elevation=0, **name):
|
|
1309
1364
|
'''New L{Los}.
|
|
1310
1365
|
|
|
1311
1366
|
@arg azimuth_aer: Scalar azimuth, bearing from North (compass C{degrees})
|
|
@@ -1314,16 +1369,16 @@ class Los(Aer):
|
|
|
1314
1369
|
@kwarg elevation: Scalar angle I{above} the horizon (C{degrees}, horizon
|
|
1315
1370
|
is 0, zenith +90, nadir -90), only used with scalar
|
|
1316
1371
|
B{C{azimuth_aer}}.
|
|
1317
|
-
@kwarg name: Optional name (C{str}).
|
|
1372
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
1318
1373
|
|
|
1319
1374
|
@raise TypeError: Invalid B{C{azimuth_aer}}.
|
|
1320
1375
|
|
|
1321
1376
|
@raise UnitError: Invalid B{C{azimuth_aer}} or B{C{elevation}}.
|
|
1322
1377
|
'''
|
|
1323
1378
|
t = Aer(azimuth_aer, elevation)
|
|
1324
|
-
Aer.__init__(self, t.azimuth, t.elevation, slantrange=_1_0, name
|
|
1379
|
+
Aer.__init__(self, t.azimuth, t.elevation, slantrange=_1_0, **name)
|
|
1325
1380
|
|
|
1326
|
-
def toUvw(self, location, Uvw=Uvw, **
|
|
1381
|
+
def toUvw(self, location, Uvw=Uvw, **name_Uvw_kwds):
|
|
1327
1382
|
'''Get this LOS' I{target} (UVW) components from a location.
|
|
1328
1383
|
|
|
1329
1384
|
@arg location: The geodetic (C{LatLon}) or geocentric (C{Cartesian},
|
|
@@ -1331,14 +1386,14 @@ class Los(Aer):
|
|
|
1331
1386
|
|
|
1332
1387
|
@see: Method L{Enu.toUvw} for further details.
|
|
1333
1388
|
'''
|
|
1334
|
-
return self.toEnu().toUvw(location, Uvw=Uvw, **
|
|
1389
|
+
return self.toEnu().toUvw(location, Uvw=Uvw, **name_Uvw_kwds)
|
|
1335
1390
|
|
|
1336
|
-
def toEnu(self, Enu=Enu, **
|
|
1391
|
+
def toEnu(self, Enu=Enu, **name_Enu_kwds):
|
|
1337
1392
|
'''Get this LOS as I{East, North, Up} (ENU) components.
|
|
1338
1393
|
|
|
1339
1394
|
@see: Method L{Aer.toEnu} for further details.
|
|
1340
1395
|
'''
|
|
1341
|
-
return Aer.toEnu(self, Enu=Enu, **
|
|
1396
|
+
return Aer.toEnu(self, Enu=Enu, **name_Enu_kwds)
|
|
1342
1397
|
|
|
1343
1398
|
|
|
1344
1399
|
class ChLV9Tuple(Local9Tuple):
|
|
@@ -1495,28 +1550,30 @@ class Footprint5Tuple(_NamedTuple):
|
|
|
1495
1550
|
_Names_ = (_center_, 'upperleft', 'upperight', 'loweright', 'lowerleft')
|
|
1496
1551
|
_Units_ = (_Pass, _Pass, _Pass, _Pass, _Pass)
|
|
1497
1552
|
|
|
1498
|
-
def toLatLon5(self, ltp=None, LatLon=None, **
|
|
1553
|
+
def toLatLon5(self, ltp=None, LatLon=None, **name_LatLon_kwds):
|
|
1499
1554
|
'''Convert this footprint's C{center} and 4 corners to I{geodetic}
|
|
1500
1555
|
C{LatLon(lat, lon, height)}s or C{LatLon3-} or C{-4Tuple}s.
|
|
1501
1556
|
|
|
1502
1557
|
@kwarg ltp: The I{local tangent plane} (L{Ltp}), overriding this
|
|
1503
1558
|
footprint's C{center} or C{frustrum} C{ltp}.
|
|
1504
1559
|
@kwarg LatLon: Optional I{geodetic} class (C{LatLon}) or C{None}.
|
|
1505
|
-
@kwarg
|
|
1506
|
-
|
|
1560
|
+
@kwarg name_LatLon_kwds: Optional C{B{name}=NN} (C{str}) and optional,
|
|
1561
|
+
additional B{C{LatLon}} keyword arguments, ignored if
|
|
1562
|
+
C{B{LatLon} is None}.
|
|
1507
1563
|
|
|
1508
1564
|
@return: A L{Footprint5Tuple} of 5 C{B{LatLon}(lat, lon,
|
|
1509
|
-
**B{
|
|
1565
|
+
**B{name_LatLon_kwds})} instances or if C{B{LatLon} is None},
|
|
1510
1566
|
5 L{LatLon3Tuple}C{(lat, lon, height)}s respectively
|
|
1511
1567
|
5 L{LatLon4Tuple}C{(lat, lon, height, datum)}s depending
|
|
1512
|
-
on keyword argument C{datum} is un-/specified.
|
|
1568
|
+
on whether keyword argument C{datum} is un-/specified.
|
|
1513
1569
|
|
|
1514
|
-
@raise TypeError: Invalid B{C{ltp}}, B{C{LatLon}} or B{C{
|
|
1570
|
+
@raise TypeError: Invalid B{C{ltp}}, B{C{LatLon}} or B{C{name_LatLon_kwds}}.
|
|
1515
1571
|
|
|
1516
1572
|
@see: Methods L{XyzLocal.toLatLon} and L{Footprint5Tuple.xyzLocal5}.
|
|
1517
1573
|
'''
|
|
1518
|
-
|
|
1519
|
-
|
|
1574
|
+
ltp = _MODS.ltp._xLtp(ltp, self.center.ltp) # PYCHOK .center
|
|
1575
|
+
kwds = _name1__(name_LatLon_kwds, _or_nameof=self)
|
|
1576
|
+
kwds = _xkwds(kwds, ltp=ltp, LatLon=LatLon)
|
|
1520
1577
|
return Footprint5Tuple(t.toLatLon(**kwds) for t in self.xyzLocal5())
|
|
1521
1578
|
|
|
1522
1579
|
def xyzLocal5(self, ltp=None):
|