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