pygeodesy 24.5.24__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.5.24.dist-info → PyGeodesy-24.6.9.dist-info}/METADATA +6 -5
- PyGeodesy-24.6.9.dist-info/RECORD +116 -0
- 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 +54 -67
- pygeodesy/cartesianBase.py +138 -147
- pygeodesy/constants.py +3 -3
- pygeodesy/deprecated/functions.py +9 -3
- pygeodesy/ecef.py +67 -72
- pygeodesy/ellipsoidalBase.py +18 -56
- pygeodesy/ellipsoidalGeodSolve.py +2 -2
- pygeodesy/ellipsoidalKarney.py +3 -3
- pygeodesy/ellipsoidalNvector.py +7 -7
- pygeodesy/ellipsoids.py +6 -5
- pygeodesy/errors.py +20 -10
- pygeodesy/etm.py +16 -21
- pygeodesy/fmath.py +9 -20
- pygeodesy/formy.py +60 -74
- pygeodesy/frechet.py +13 -14
- pygeodesy/fsums.py +60 -26
- pygeodesy/geodesicx/__init__.py +1 -1
- pygeodesy/geodesicx/__main__.py +2 -2
- pygeodesy/geodesicx/gx.py +3 -5
- pygeodesy/geodsolve.py +24 -26
- pygeodesy/geohash.py +27 -40
- pygeodesy/geoids.py +1 -1
- pygeodesy/hausdorff.py +17 -18
- pygeodesy/heights.py +17 -30
- pygeodesy/internals.py +15 -14
- pygeodesy/interns.py +3 -9
- pygeodesy/iters.py +2 -2
- pygeodesy/karney.py +8 -7
- pygeodesy/latlonBase.py +189 -176
- pygeodesy/lazily.py +92 -56
- pygeodesy/lcc.py +2 -2
- pygeodesy/ltp.py +93 -55
- pygeodesy/ltpTuples.py +304 -240
- pygeodesy/mgrs.py +51 -24
- pygeodesy/named.py +159 -136
- pygeodesy/namedTuples.py +43 -14
- pygeodesy/nvectorBase.py +20 -23
- pygeodesy/osgr.py +40 -48
- pygeodesy/points.py +11 -11
- 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 +20 -70
- pygeodesy/simplify.py +16 -16
- pygeodesy/solveBase.py +35 -32
- pygeodesy/sphericalBase.py +33 -31
- pygeodesy/sphericalTrigonometry.py +17 -17
- pygeodesy/streprs.py +6 -4
- pygeodesy/trf.py +11 -9
- pygeodesy/triaxials.py +71 -50
- pygeodesy/units.py +40 -65
- pygeodesy/unitsBase.py +2 -2
- pygeodesy/ups.py +66 -70
- pygeodesy/utily.py +7 -6
- pygeodesy/utm.py +152 -156
- pygeodesy/utmups.py +38 -38
- pygeodesy/utmupsBase.py +102 -106
- pygeodesy/vector3d.py +34 -36
- pygeodesy/vector3dBase.py +12 -9
- pygeodesy/webmercator.py +43 -51
- PyGeodesy-24.5.24.dist-info/RECORD +0 -116
- {PyGeodesy-24.5.24.dist-info → PyGeodesy-24.6.9.dist-info}/WHEEL +0 -0
- {PyGeodesy-24.5.24.dist-info → PyGeodesy-24.6.9.dist-info}/top_level.txt +0 -0
pygeodesy/ltpTuples.py
CHANGED
|
@@ -13,28 +13,30 @@ L{ChLVYX2Tuple}, L{ChLVyx2Tuple} and L{Footprint5Tuple}.
|
|
|
13
13
|
|
|
14
14
|
# from pygeodesy.basics import issubclassof # from .units
|
|
15
15
|
from pygeodesy.constants import _0_0, _1_0, _90_0, _N_90_0
|
|
16
|
-
from pygeodesy.dms import F_D, toDMS
|
|
16
|
+
# from pygeodesy.dms import F_D, toDMS # _MODS
|
|
17
17
|
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
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
|
|
28
30
|
from pygeodesy.streprs import Fmt, fstr, strs, _xzipairs
|
|
29
31
|
from pygeodesy.units import Bearing, Degrees, Degrees_, Height, _isDegrees, \
|
|
30
32
|
_isMeter, Lat, Lon, Meter, Meter_, issubclassof
|
|
31
|
-
from pygeodesy.utily import atan2d, atan2b, sincos2_, sincos2d_
|
|
33
|
+
from pygeodesy.utily import atan2d, atan2b, sincos2_, sincos2d_, cos, radians
|
|
32
34
|
from pygeodesy.vector3d import Vector3d
|
|
33
35
|
|
|
34
|
-
from math import cos, radians
|
|
36
|
+
# from math import cos, radians # from .utily
|
|
35
37
|
|
|
36
38
|
__all__ = _ALL_LAZY.ltpTuples
|
|
37
|
-
__version__ = '24.
|
|
39
|
+
__version__ = '24.06.08'
|
|
38
40
|
|
|
39
41
|
_aer_ = 'aer'
|
|
40
42
|
_alt_ = 'alt'
|
|
@@ -42,6 +44,7 @@ _down_ = 'down'
|
|
|
42
44
|
_east_ = 'east'
|
|
43
45
|
_enu_ = 'enu'
|
|
44
46
|
_h__ = 'h_'
|
|
47
|
+
_ltp = _MODS.into(ltp=__name__)
|
|
45
48
|
_ned_ = 'ned'
|
|
46
49
|
_north_ = 'north'
|
|
47
50
|
_local_ = 'local'
|
|
@@ -59,6 +62,20 @@ def _er2gr(e, r):
|
|
|
59
62
|
return Meter_(groundrange=r * c)
|
|
60
63
|
|
|
61
64
|
|
|
65
|
+
def _init(inst, abc, ltp, name):
|
|
66
|
+
'''(INTERNAL) Complete C{__init__}.
|
|
67
|
+
'''
|
|
68
|
+
if abc is None:
|
|
69
|
+
n = _name__(**name)
|
|
70
|
+
else:
|
|
71
|
+
n = abc._name__(name)
|
|
72
|
+
ltp = _xattr(abc, ltp=ltp)
|
|
73
|
+
if ltp:
|
|
74
|
+
inst._ltp = _ltp._xLtp(ltp)
|
|
75
|
+
if n:
|
|
76
|
+
inst.name = n
|
|
77
|
+
|
|
78
|
+
|
|
62
79
|
def _toStr2(inst, prec=None, fmt=Fmt.SQUARE, sep=_COMMASPACE_):
|
|
63
80
|
'''(INTERNAL) Get attribute name and value strings, joined and bracketed.
|
|
64
81
|
'''
|
|
@@ -72,25 +89,6 @@ def _toStr2(inst, prec=None, fmt=Fmt.SQUARE, sep=_COMMASPACE_):
|
|
|
72
89
|
return a, t
|
|
73
90
|
|
|
74
91
|
|
|
75
|
-
def _4Tuple2Cls(inst, Cls, Cls_kwds):
|
|
76
|
-
'''(INTERNAL) Convert 4-Tuple to C{Cls} instance.
|
|
77
|
-
'''
|
|
78
|
-
if Cls is None:
|
|
79
|
-
return inst
|
|
80
|
-
elif issubclassof(Cls, Aer):
|
|
81
|
-
return inst.xyzLocal.toAer(Aer=Cls, **Cls_kwds)
|
|
82
|
-
elif issubclassof(Cls, Enu): # PYCHOK no cover
|
|
83
|
-
return inst.xyzLocal.toEnu(Enu=Cls, **Cls_kwds)
|
|
84
|
-
elif issubclassof(Cls, Ned):
|
|
85
|
-
return inst.xyzLocal.toNed(Ned=Cls, **Cls_kwds)
|
|
86
|
-
elif issubclassof(Cls, XyzLocal): # PYCHOK no cover
|
|
87
|
-
return inst.xyzLocal.toXyz(Xyz=Cls, **Cls_kwds)
|
|
88
|
-
elif Cls is Local9Tuple: # PYCHOK no cover
|
|
89
|
-
return inst.xyzLocal.toLocal9Tuple(**Cls_kwds)
|
|
90
|
-
n = inst.__class__.__name__[:3] # PYCHOK no cover
|
|
91
|
-
raise _TypesError(n, Cls, Aer, Enu, Ned, XyzLocal)
|
|
92
|
-
|
|
93
|
-
|
|
94
92
|
def _xyz2aer4(inst):
|
|
95
93
|
'''(INTERNAL) Convert C{(x, y, z}) to C{(A, E, R)}.
|
|
96
94
|
'''
|
|
@@ -113,10 +111,10 @@ def _xyzLocal(*Types, **name_inst):
|
|
|
113
111
|
raise _TypeError(n, inst, txt_not_=_local_)
|
|
114
112
|
|
|
115
113
|
|
|
116
|
-
class
|
|
114
|
+
class _AbcBase(_NamedBase):
|
|
117
115
|
'''(INTERNAL) Base class for classes C{Aer} and C{Ned}.
|
|
118
116
|
'''
|
|
119
|
-
_ltp =
|
|
117
|
+
_ltp = None # local tangent plane (C{Ltp}), origin
|
|
120
118
|
|
|
121
119
|
@Property_RO
|
|
122
120
|
def ltp(self):
|
|
@@ -124,56 +122,66 @@ class _NamedAerNed(_NamedBase):
|
|
|
124
122
|
'''
|
|
125
123
|
return self._ltp
|
|
126
124
|
|
|
127
|
-
def toAer(self, Aer=None, **
|
|
125
|
+
def toAer(self, Aer=None, **name_Aer_kwds):
|
|
128
126
|
'''Get the I{local} I{Azimuth, Elevation, slant Range} (AER) components.
|
|
129
127
|
|
|
130
128
|
@kwarg Aer: Class to return AER (L{Aer}) or C{None}.
|
|
131
|
-
@kwarg
|
|
132
|
-
|
|
129
|
+
@kwarg name_Aer_kwds: Optional C{B{name}=NN} (C{str}) and
|
|
130
|
+
optional, additional B{L{Aer}} keyword arguments,
|
|
131
|
+
ignored if B{C{Aer}} is C{None}.
|
|
133
132
|
|
|
134
133
|
@return: AER as an L{Aer} instance or if C{B{Aer} is None},
|
|
135
134
|
an L{Aer4Tuple}C{(azimuth, elevation, slantrange, ltp)}.
|
|
135
|
+
|
|
136
|
+
@raise TypeError: Invalid B{C{Aer}} or B{C{name_Aer_kwds}}.
|
|
136
137
|
'''
|
|
137
|
-
return self.xyz4._toXyz(Aer,
|
|
138
|
+
return self.xyz4._toXyz(Aer, name_Aer_kwds)
|
|
138
139
|
|
|
139
|
-
def toEnu(self, Enu=None, **
|
|
140
|
+
def toEnu(self, Enu=None, **name_Enu_kwds):
|
|
140
141
|
'''Get the I{local} I{East, North, Up} (ENU) components.
|
|
141
142
|
|
|
142
143
|
@kwarg Enu: Class to return ENU (L{Enu}) or C{None}.
|
|
143
|
-
@kwarg
|
|
144
|
-
|
|
144
|
+
@kwarg name_Enu_kwds: Optional C{B{name}=NN} (C{str}) and
|
|
145
|
+
optional, additional B{L{Enu}} keyword arguments,
|
|
146
|
+
ignored if C{B{Enu} is None}.
|
|
145
147
|
|
|
146
148
|
@return: ENU as an L{Enu} instance or if C{B{Enu} is None},
|
|
147
149
|
an L{Enu4Tuple}C{(east, north, up, ltp)}.
|
|
150
|
+
|
|
151
|
+
@raise TypeError: Invalid B{C{Enu}} or B{C{name_Enu_kwds}}.
|
|
148
152
|
'''
|
|
149
|
-
return self.xyz4._toXyz(Enu,
|
|
153
|
+
return self.xyz4._toXyz(Enu, name_Enu_kwds)
|
|
150
154
|
|
|
151
|
-
def toNed(self, Ned=None, **
|
|
155
|
+
def toNed(self, Ned=None, **name_Ned_kwds):
|
|
152
156
|
'''Get the I{local} I{North, East, Down} (NED) components.
|
|
153
157
|
|
|
154
158
|
@kwarg Ned: Class to return NED (L{Ned}) or C{None}.
|
|
155
|
-
@kwarg
|
|
156
|
-
|
|
159
|
+
@kwarg name_Ned_kwds: Optional C{B{name}=NN} (C{str}) and
|
|
160
|
+
optional, additional B{L{Ned}} keyword arguments,
|
|
161
|
+
ignored if B{C{Ned}} is C{None}.
|
|
157
162
|
|
|
158
163
|
@return: NED as an L{Ned} instance or if C{B{Ned} is None},
|
|
159
164
|
an L{Ned4Tuple}C{(north, east, down, ltp)}.
|
|
165
|
+
|
|
166
|
+
@raise TypeError: Invalid B{C{Ned}} or B{C{name_Ned_kwds}}.
|
|
160
167
|
'''
|
|
161
|
-
return self.xyz4._toXyz(Ned,
|
|
168
|
+
return self.xyz4._toXyz(Ned, name_Ned_kwds)
|
|
162
169
|
|
|
163
|
-
def toXyz(self, Xyz=None, **
|
|
170
|
+
def toXyz(self, Xyz=None, **name_Xyz_kwds):
|
|
164
171
|
'''Get the local I{X, Y, Z} (XYZ) components.
|
|
165
172
|
|
|
166
173
|
@kwarg Xyz: Class to return XYZ (L{XyzLocal}, L{Enu},
|
|
167
174
|
L{Ned}, L{Aer}) or C{None}.
|
|
168
|
-
@kwarg
|
|
169
|
-
|
|
175
|
+
@kwarg name_Xyz_kwds: Optional C{B{name}=NN} (C{str}) and
|
|
176
|
+
optional, additional B{C{Xyz}} keyword arguments,
|
|
177
|
+
ignored if C{B{Xyz} is None}.
|
|
170
178
|
|
|
171
179
|
@return: XYZ as an B{C{Xyz}} instance or if C{B{Xyz} is None},
|
|
172
180
|
an L{Xyz4Tuple}C{(x, y, z, ltp)}.
|
|
173
181
|
|
|
174
|
-
@raise TypeError: Invalid B{C{Xyz}}.
|
|
182
|
+
@raise TypeError: Invalid B{C{Xyz}} or B{C{name_Xyz_kwds}}.
|
|
175
183
|
'''
|
|
176
|
-
return self.xyz4._toXyz(Xyz,
|
|
184
|
+
return self.xyz4._toXyz(Xyz, name_Xyz_kwds)
|
|
177
185
|
|
|
178
186
|
@Property_RO
|
|
179
187
|
def xyz(self):
|
|
@@ -193,7 +201,42 @@ class _NamedAerNed(_NamedBase):
|
|
|
193
201
|
return XyzLocal(self.xyz4, name=self.name)
|
|
194
202
|
|
|
195
203
|
|
|
196
|
-
class
|
|
204
|
+
class _Abc4Tuple(_NamedTuple):
|
|
205
|
+
'''(INTERNAL) Base class for C{Aer4Tuple}, C{Enu4Tuple},
|
|
206
|
+
C{Ned4Tuple} and C{Xyz4Tuple}.
|
|
207
|
+
'''
|
|
208
|
+
def _2Cls(self, Abc, Cls, Cls_kwds):
|
|
209
|
+
'''(INTERNAL) Convert 4-Tuple to C{Cls} instance.
|
|
210
|
+
'''
|
|
211
|
+
kwds = _name1__(Cls_kwds, _or_nameof=self)
|
|
212
|
+
_is = issubclassof
|
|
213
|
+
if Cls is None:
|
|
214
|
+
n, _ = _name2__(Cls_kwds)
|
|
215
|
+
r = self.copy(name=n) if n else self
|
|
216
|
+
elif _is(Cls, Abc):
|
|
217
|
+
r = Cls(*self, **kwds)
|
|
218
|
+
elif _is(Cls, Aer):
|
|
219
|
+
r = self.xyzLocal.toAer(**_xkwds(kwds, Aer=Cls))
|
|
220
|
+
elif _is(Cls, Enu): # PYCHOK no cover
|
|
221
|
+
r = self.xyzLocal.toEnu(**_xkwds(kwds, Enu=Cls))
|
|
222
|
+
elif _is(Cls, Ned):
|
|
223
|
+
r = self.xyzLocal.toNed(**_xkwds(kwds, Ned=Cls))
|
|
224
|
+
elif _is(Cls, XyzLocal): # PYCHOK no cover
|
|
225
|
+
r = self.xyzLocal.toXyz(**_xkwds(kwds, Xyz=Cls))
|
|
226
|
+
elif Cls is Local9Tuple: # PYCHOK no cover
|
|
227
|
+
r = self.xyzLocal.toLocal9Tuple(**kwds)
|
|
228
|
+
else: # PYCHOK no cover
|
|
229
|
+
n = Abc.__name__[:3]
|
|
230
|
+
raise _TypesError(n, Cls, Aer, Enu, Ned, XyzLocal)
|
|
231
|
+
return r
|
|
232
|
+
|
|
233
|
+
@property_RO
|
|
234
|
+
def xyzLocal(self): # PYCHOK no cover
|
|
235
|
+
'''I{Must be overloaded}.'''
|
|
236
|
+
self._notOverloaded()
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
class Aer(_AbcBase):
|
|
197
240
|
'''Local C{Azimuth-Elevation-Range} (AER) in a I{local tangent plane}.
|
|
198
241
|
'''
|
|
199
242
|
_azimuth = _0_0 # bearing from North (C{degrees360})
|
|
@@ -202,7 +245,7 @@ class Aer(_NamedAerNed):
|
|
|
202
245
|
_slantrange = _0_0 # distance (C{Meter})
|
|
203
246
|
_toStr = _aer_
|
|
204
247
|
|
|
205
|
-
def __init__(self, azimuth_aer, elevation=0, slantrange=0, ltp=None, name
|
|
248
|
+
def __init__(self, azimuth_aer, elevation=0, slantrange=0, ltp=None, **name):
|
|
206
249
|
'''New L{Aer}.
|
|
207
250
|
|
|
208
251
|
@arg azimuth_aer: Scalar azimuth, bearing from North (compass C{degrees})
|
|
@@ -216,7 +259,7 @@ class Aer(_NamedAerNed):
|
|
|
216
259
|
B{C{azimuth_aer}}.
|
|
217
260
|
@kwarg ltp: The I{local tangent plane}, (geodetic) origin (L{Ltp},
|
|
218
261
|
L{LocalCartesian}).
|
|
219
|
-
@kwarg name: Optional name (C{str}).
|
|
262
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
220
263
|
|
|
221
264
|
@raise TypeError: Invalid B{C{azimuth_aer}} or B{C{ltp}}.
|
|
222
265
|
|
|
@@ -224,22 +267,16 @@ class Aer(_NamedAerNed):
|
|
|
224
267
|
or B{C{slantrange}}.
|
|
225
268
|
'''
|
|
226
269
|
if _isDegrees(azimuth_aer):
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
270
|
+
aer = None
|
|
271
|
+
t = (Bearing(azimuth=azimuth_aer),
|
|
272
|
+
Degrees_(elevation=elevation, low=_N_90_0, high=_90_0),
|
|
273
|
+
Meter_(slantrange=slantrange), ltp)
|
|
231
274
|
else: # PYCHOK no cover
|
|
232
|
-
p
|
|
233
|
-
aer =
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
n = name or _xattr(aer, name=name)
|
|
238
|
-
|
|
239
|
-
if p:
|
|
240
|
-
self._ltp = _MODS.ltp._xLtp(p)
|
|
241
|
-
if name:
|
|
242
|
-
self.name = n
|
|
275
|
+
p = _xyzLocal(Aer, Aer4Tuple, Ned, azimuth_aer=azimuth_aer)
|
|
276
|
+
aer = p.toAer() if p else azimuth_aer
|
|
277
|
+
t = aer.aer4
|
|
278
|
+
self._azimuth, self._elevation, self._slantrange, _ = t
|
|
279
|
+
_init(self, aer, ltp, name)
|
|
243
280
|
|
|
244
281
|
@Property_RO
|
|
245
282
|
def aer4(self):
|
|
@@ -299,8 +336,9 @@ class Aer(_NamedAerNed):
|
|
|
299
336
|
|
|
300
337
|
@return: This AER as "[A:degrees360, E:degrees90, R:meter]" (C{str}).
|
|
301
338
|
'''
|
|
302
|
-
|
|
303
|
-
|
|
339
|
+
m = _MODS.dms
|
|
340
|
+
t = (m.toDMS(self.azimuth, form=m.F_D, prec=prec, ddd=0),
|
|
341
|
+
m.toDMS(self.elevation, form=m.F_D, prec=prec, ddd=0),
|
|
304
342
|
fstr( self.slantrange, prec=3 if prec is None else prec))
|
|
305
343
|
return _xzipairs(self._toStr.upper(), t, sep=sep, fmt=fmt)
|
|
306
344
|
|
|
@@ -352,7 +390,7 @@ class Aer(_NamedAerNed):
|
|
|
352
390
|
return self.xyz4.z
|
|
353
391
|
|
|
354
392
|
|
|
355
|
-
class Aer4Tuple(
|
|
393
|
+
class Aer4Tuple(_Abc4Tuple):
|
|
356
394
|
'''4-Tuple C{(azimuth, elevation, slantrange, ltp)},
|
|
357
395
|
all in C{meter} except C{ltp}.
|
|
358
396
|
'''
|
|
@@ -362,10 +400,7 @@ class Aer4Tuple(_NamedTuple):
|
|
|
362
400
|
def _toAer(self, Cls, Cls_kwds):
|
|
363
401
|
'''(INTERNAL) Return C{Cls(..., **Cls_kwds)} instance.
|
|
364
402
|
'''
|
|
365
|
-
|
|
366
|
-
return Cls(*self, **_xkwds(Cls_kwds, name=self.name))
|
|
367
|
-
else:
|
|
368
|
-
return _4Tuple2Cls(self, Cls, Cls_kwds)
|
|
403
|
+
return self._2Cls(Aer, Cls, Cls_kwds)
|
|
369
404
|
|
|
370
405
|
@Property_RO
|
|
371
406
|
def groundrange(self):
|
|
@@ -398,10 +433,10 @@ class Attitude4Tuple(_NamedTuple):
|
|
|
398
433
|
def tyr3d(self):
|
|
399
434
|
'''Get this attitude's (3-D) directional vector (L{Vector3d}).
|
|
400
435
|
'''
|
|
401
|
-
return
|
|
436
|
+
return _ltp.Attitude(self).tyr3d
|
|
402
437
|
|
|
403
438
|
|
|
404
|
-
class Ned(
|
|
439
|
+
class Ned(_AbcBase):
|
|
405
440
|
'''Local C{North-Eeast-Down} (NED) location in a I{local tangent plane}.
|
|
406
441
|
|
|
407
442
|
@see: L{Enu} and L{Ltp}.
|
|
@@ -412,7 +447,7 @@ class Ned(_NamedAerNed):
|
|
|
412
447
|
_north = _0_0 # north, XyzLocal.x (C{meter})
|
|
413
448
|
_toStr = _ned_
|
|
414
449
|
|
|
415
|
-
def __init__(self, north_ned, east=0, down=0, ltp=None, name
|
|
450
|
+
def __init__(self, north_ned, east=0, down=0, ltp=None, **name):
|
|
416
451
|
'''New L{Ned} vector.
|
|
417
452
|
|
|
418
453
|
@arg north_ned: Scalar North component (C{meter}) or a previous
|
|
@@ -426,28 +461,23 @@ class Ned(_NamedAerNed):
|
|
|
426
461
|
scalar B{C{north_ned}}.
|
|
427
462
|
@kwarg ltp: The I{local tangent plane}, (geodetic) origin (L{Ltp},
|
|
428
463
|
L{LocalCartesian}).
|
|
429
|
-
@kwarg name: Optional name (C{str}).
|
|
464
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
430
465
|
|
|
431
466
|
@raise TypeError: Invalid B{C{north_ned}} or B{C{ltp}}.
|
|
432
467
|
|
|
433
468
|
@raise UnitError: Invalid B{C{north_ned}}, B{C{east}} or B{C{down}}.
|
|
434
469
|
'''
|
|
435
470
|
if _isMeter(north_ned):
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
471
|
+
ned = None
|
|
472
|
+
t = (Meter(north=north_ned or _0_0),
|
|
473
|
+
Meter(east=east or _0_0),
|
|
474
|
+
Meter(down=down or _0_0), ltp)
|
|
440
475
|
else: # PYCHOK no cover
|
|
441
|
-
p
|
|
442
|
-
ned =
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
if p:
|
|
448
|
-
self._ltp = _MODS.ltp._xLtp(p)
|
|
449
|
-
if n:
|
|
450
|
-
self.name = n
|
|
476
|
+
p = _xyzLocal(Ned, Ned4Tuple, Aer, north_ned=north_ned)
|
|
477
|
+
ned = p.toNed() if p else north_ned
|
|
478
|
+
t = ned.ned4
|
|
479
|
+
self._north, self._east, self._down, _ = t
|
|
480
|
+
_init(self, ned, ltp, name)
|
|
451
481
|
|
|
452
482
|
@Property_RO
|
|
453
483
|
def aer4(self):
|
|
@@ -585,7 +615,7 @@ class Ned(_NamedAerNed):
|
|
|
585
615
|
return Meter(z=-self._down) # negated
|
|
586
616
|
|
|
587
617
|
|
|
588
|
-
class Ned4Tuple(
|
|
618
|
+
class Ned4Tuple(_Abc4Tuple):
|
|
589
619
|
'''4-Tuple C{(north, east, down, ltp)}, all in C{meter} except C{ltp}.
|
|
590
620
|
'''
|
|
591
621
|
_Names_ = (_north_, _east_, _down_, _ltp_)
|
|
@@ -594,10 +624,7 @@ class Ned4Tuple(_NamedTuple):
|
|
|
594
624
|
def _toNed(self, Cls, Cls_kwds):
|
|
595
625
|
'''(INTERNAL) Return C{Cls(..., **Cls_kwds)} instance.
|
|
596
626
|
'''
|
|
597
|
-
|
|
598
|
-
return Cls(*self, **_xkwds(Cls_kwds, name=self.name))
|
|
599
|
-
else:
|
|
600
|
-
return _4Tuple2Cls(self, Cls, Cls_kwds)
|
|
627
|
+
return self._2Cls(Ned, Cls, Cls_kwds)
|
|
601
628
|
|
|
602
629
|
@Property_RO
|
|
603
630
|
def xyzLocal(self):
|
|
@@ -646,7 +673,7 @@ class XyzLocal(_Vector3d):
|
|
|
646
673
|
'''
|
|
647
674
|
_ltp = None # local tangent plane (C{Ltp}), origin
|
|
648
675
|
|
|
649
|
-
def __init__(self, x_xyz, y=0, z=0, ltp=None, name
|
|
676
|
+
def __init__(self, x_xyz, y=0, z=0, ltp=None, **name):
|
|
650
677
|
'''New L{XyzLocal}.
|
|
651
678
|
|
|
652
679
|
@arg x_xyz: Scalar X component (C{meter}), C{positive east} or a
|
|
@@ -660,26 +687,22 @@ class XyzLocal(_Vector3d):
|
|
|
660
687
|
used with scalar B{C{x_xyz}}.
|
|
661
688
|
@kwarg ltp: The I{local tangent plane}, (geodetic) origin (L{Ltp},
|
|
662
689
|
L{LocalCartesian}).
|
|
690
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
663
691
|
|
|
664
692
|
@raise TypeError: Invalid B{C{x_xyz}} or B{C{ltp}}.
|
|
665
693
|
|
|
666
694
|
@raise UnitError: Invalid scalar B{C{x_xyz}}, B{C{y}} or B{C{z}}.
|
|
667
695
|
'''
|
|
668
696
|
if _isMeter(x_xyz):
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
697
|
+
xyz = None
|
|
698
|
+
t = (Meter(x=x_xyz or _0_0),
|
|
699
|
+
Meter(y=y or _0_0),
|
|
700
|
+
Meter(z=z or _0_0), ltp)
|
|
673
701
|
else:
|
|
674
702
|
xyz = _xyzLocal(XyzLocal, Xyz4Tuple, Local9Tuple, x_xyz=x_xyz) or x_xyz
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
if p:
|
|
680
|
-
self._ltp = _MODS.ltp._xLtp(p)
|
|
681
|
-
if n:
|
|
682
|
-
self.name = n
|
|
703
|
+
t = xyz.xyz4 # xyz.x, xyz.y, xyz.z, xyz.ltp
|
|
704
|
+
self._x, self._y, self._z, _ = t
|
|
705
|
+
_init(self, xyz, ltp, name)
|
|
683
706
|
|
|
684
707
|
def __str__(self):
|
|
685
708
|
return self.toStr()
|
|
@@ -707,8 +730,8 @@ class XyzLocal(_Vector3d):
|
|
|
707
730
|
|
|
708
731
|
@return: New instance (C{self.__class__}).
|
|
709
732
|
'''
|
|
710
|
-
kwds =
|
|
711
|
-
return self.__class__(*args, **kwds)
|
|
733
|
+
kwds = _name1__(kwds, _or_nameof=self)
|
|
734
|
+
return self.__class__(*args, **_xkwds(kwds, ltp=self.ltp))
|
|
712
735
|
|
|
713
736
|
@Property_RO
|
|
714
737
|
def down(self):
|
|
@@ -755,6 +778,14 @@ class XyzLocal(_Vector3d):
|
|
|
755
778
|
'''
|
|
756
779
|
return self._ltp
|
|
757
780
|
|
|
781
|
+
def _ltp_kwds_name3(self, ltp, kwds):
|
|
782
|
+
'''(INTERNAL) Helper for methods C{toCartesian} and C{toLatLon}.
|
|
783
|
+
'''
|
|
784
|
+
ltp = _ltp._xLtp(ltp, self.ltp)
|
|
785
|
+
kwds = _name1__(kwds, _or_nameof=self)
|
|
786
|
+
kwds = _name1__(kwds, _or_nameof=ltp)
|
|
787
|
+
return ltp, kwds, kwds.get(_name_, NN)
|
|
788
|
+
|
|
758
789
|
@Property_RO
|
|
759
790
|
def ned4(self):
|
|
760
791
|
'''Get the C{(north, east, down, ltp)} components (L{Ned4Tuple}).
|
|
@@ -773,124 +804,137 @@ class XyzLocal(_Vector3d):
|
|
|
773
804
|
'''
|
|
774
805
|
return self.aer4.slantrange
|
|
775
806
|
|
|
776
|
-
def toAer(self, Aer=None, **
|
|
777
|
-
'''Get the local I{Azimuth, Elevation,
|
|
807
|
+
def toAer(self, Aer=None, **name_Aer_kwds):
|
|
808
|
+
'''Get the local I{Azimuth, Elevation, slant Range} components.
|
|
778
809
|
|
|
779
810
|
@kwarg Aer: Class to return AER (L{Aer}) or C{None}.
|
|
780
|
-
@kwarg
|
|
781
|
-
|
|
811
|
+
@kwarg name_Aer_kwds: Optional C{B{name}=NN} (C{str}) and
|
|
812
|
+
optional, additional B{C{Aer}} keyword arguments,
|
|
813
|
+
ignored if C{B{Aer} is None}.
|
|
782
814
|
|
|
783
815
|
@return: AER as an L{Aer} instance or if C{B{Aer} is None}, an
|
|
784
816
|
L{Aer4Tuple}C{(azimuth, elevation, slantrange, ltp)}.
|
|
785
817
|
|
|
786
|
-
@raise TypeError: Invalid B{C{Aer}}.
|
|
818
|
+
@raise TypeError: Invalid B{C{Aer}} or B{C{name_Aer_kwds}}.
|
|
787
819
|
'''
|
|
788
|
-
return self.aer4._toAer(Aer,
|
|
820
|
+
return self.aer4._toAer(Aer, name_Aer_kwds)
|
|
789
821
|
|
|
790
|
-
def toCartesian(self, Cartesian=None, ltp=None, **
|
|
822
|
+
def toCartesian(self, Cartesian=None, ltp=None, **name_Cartesian_kwds):
|
|
791
823
|
'''Get the geocentric C{(x, y, z)} (ECEF) coordinates of this local.
|
|
792
824
|
|
|
793
825
|
@kwarg Cartesian: Optional class to return C{(x, y, z)} (C{Cartesian})
|
|
794
826
|
or C{None}.
|
|
795
827
|
@kwarg ltp: Optional I{local tangent plane} (LTP) (L{Ltp}),
|
|
796
828
|
overriding this C{ltp}.
|
|
797
|
-
@kwarg
|
|
798
|
-
|
|
829
|
+
@kwarg name_Cartesian_kwds: Optional C{B{name}=NN} (C{str}) and
|
|
830
|
+
optional, additional B{C{Cartesian}} keyword arguments,
|
|
831
|
+
ignored if C{B{Cartesian} is None}.
|
|
799
832
|
|
|
800
833
|
@return: A B{C{Cartesian}} instance of if C{B{Cartesian} is None}, an
|
|
801
834
|
L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)}
|
|
802
835
|
with C{M=None}, always.
|
|
803
836
|
|
|
804
837
|
@raise TypeError: Invalid B{C{ltp}}, B{C{Cartesian}} or
|
|
805
|
-
B{C{
|
|
838
|
+
B{C{name_Cartesian_kwds}}.
|
|
806
839
|
'''
|
|
807
|
-
ltp =
|
|
840
|
+
ltp, kwds, n = self._ltp_kwds_name3(ltp, name_Cartesian_kwds)
|
|
808
841
|
if Cartesian is None:
|
|
809
|
-
|
|
842
|
+
t = ltp._local2ecef(self, nine=True)
|
|
843
|
+
r = _xnamed(t, n) if n else t
|
|
810
844
|
else:
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
r
|
|
814
|
-
return
|
|
845
|
+
kwds = _xkwds(kwds, datum=ltp.datum)
|
|
846
|
+
xyz = ltp._local2ecef(self) # [:3]
|
|
847
|
+
r = Cartesian(*xyz, **kwds)
|
|
848
|
+
return r
|
|
815
849
|
|
|
816
|
-
def toEnu(self, Enu=None, **
|
|
850
|
+
def toEnu(self, Enu=None, **name_Enu_kwds):
|
|
817
851
|
'''Get the local I{East, North, Up} (ENU) components.
|
|
818
852
|
|
|
819
853
|
@kwarg Enu: Class to return ENU (L{Enu}) or C{None}.
|
|
820
|
-
@kwarg
|
|
821
|
-
|
|
854
|
+
@kwarg name_Enu_kwds: Optional C{B{name}=NN} (C{str}) and
|
|
855
|
+
optional, additional B{C{Enu}} keyword arguments,
|
|
856
|
+
ignored if C{B{Enu} is None}.
|
|
822
857
|
|
|
823
858
|
@return: ENU as an L{Enu} instance or if C{B{Enu} is None},
|
|
824
859
|
an L{Enu4Tuple}C{(east, north, up, ltp)}.
|
|
860
|
+
|
|
861
|
+
@raise TypeError: Invalid B{C{Enu}} or B{C{name_Enu_kwds}}.
|
|
825
862
|
'''
|
|
826
|
-
return self.enu4._toEnu(Enu,
|
|
863
|
+
return self.enu4._toEnu(Enu, name_Enu_kwds)
|
|
827
864
|
|
|
828
|
-
def toLatLon(self, LatLon=None, ltp=None, **
|
|
865
|
+
def toLatLon(self, LatLon=None, ltp=None, **name_LatLon_kwds):
|
|
829
866
|
'''Get the geodetic C{(lat, lon, height)} coordinates if this local.
|
|
830
867
|
|
|
831
868
|
@kwarg LatLon: Optional class to return C{(x, y, z)} (C{LatLon})
|
|
832
869
|
or C{None}.
|
|
833
870
|
@kwarg ltp: Optional I{local tangent plane} (LTP) (L{Ltp}),
|
|
834
871
|
overriding this ENU/NED/AER/XYZ's LTP.
|
|
835
|
-
@kwarg
|
|
836
|
-
|
|
872
|
+
@kwarg name_LatLon_kwds: Optional C{B{name}=NN} (C{str}) and
|
|
873
|
+
optional, additional B{C{LatLon}} keyword arguments,
|
|
874
|
+
ignored if C{B{LatLon} is None}.
|
|
837
875
|
|
|
838
876
|
@return: An B{C{LatLon}} instance of if C{B{LatLon} is None}, an
|
|
839
877
|
L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M,
|
|
840
878
|
datum)} with C{M=None}, always.
|
|
841
879
|
|
|
842
880
|
@raise TypeError: Invalid B{C{ltp}}, B{C{LatLon}} or
|
|
843
|
-
B{C{
|
|
881
|
+
B{C{name_LatLon_kwds}}.
|
|
844
882
|
'''
|
|
845
|
-
ltp =
|
|
846
|
-
|
|
883
|
+
ltp, kwds, n = self._ltp_kwds_name3(ltp, name_LatLon_kwds)
|
|
884
|
+
t = ltp._local2ecef(self, nine=True)
|
|
847
885
|
if LatLon is None:
|
|
848
|
-
r = _xnamed(
|
|
886
|
+
r = _xnamed(t, n) if n else t
|
|
849
887
|
else:
|
|
850
|
-
kwds = _xkwds(
|
|
851
|
-
|
|
852
|
-
r = LatLon(r.lat, r.lon, **kwds) # XXX ltp?
|
|
888
|
+
kwds = _xkwds(kwds, height=t.height, datum=t.datum)
|
|
889
|
+
r = LatLon(t.lat, t.lon, **kwds) # XXX ltp?
|
|
853
890
|
return r
|
|
854
891
|
|
|
855
|
-
def toLocal9Tuple(self, M=False, name
|
|
892
|
+
def toLocal9Tuple(self, M=False, **name):
|
|
856
893
|
'''Get this local as a C{Local9Tuple}.
|
|
857
894
|
|
|
858
895
|
@kwarg M: Optionally include the rotation matrix (C{bool}).
|
|
859
|
-
@kwarg name: Optional name (C{str}).
|
|
896
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
860
897
|
|
|
861
898
|
@return: L{Local9Tuple}C{(x, y, z, lat, lon, height, ltp,
|
|
862
899
|
ecef, M)} with C{ltp} this C{Ltp}, C{ecef} an
|
|
863
900
|
L{Ecef9Tuple} and C{M} L{EcefMatrix} or C{None}.
|
|
864
901
|
'''
|
|
865
902
|
ltp = self.ltp # see C{self.toLatLon}
|
|
866
|
-
t
|
|
867
|
-
return Local9Tuple(self.x, self.y, self.z,
|
|
868
|
-
|
|
903
|
+
t = ltp._local2ecef(self, nine=True, M=M)
|
|
904
|
+
return Local9Tuple(self.x, self.y, self.z,
|
|
905
|
+
t.lat, t.lon, t.height,
|
|
906
|
+
ltp, t, t.M, name=t._name__(name))
|
|
869
907
|
|
|
870
|
-
def toNed(self, Ned=None, **
|
|
908
|
+
def toNed(self, Ned=None, **name_Ned_kwds):
|
|
871
909
|
'''Get the local I{North, East, Down} (Ned) components.
|
|
872
910
|
|
|
873
911
|
@kwarg Ned: Class to return NED (L{Ned}) or C{None}.
|
|
874
|
-
@kwarg
|
|
875
|
-
|
|
912
|
+
@kwarg name_Ned_kwds: Optional C{B{name}=NN} (C{str}) and
|
|
913
|
+
optional, additional B{C{Ned}} keyword arguments,
|
|
914
|
+
ignored if C{B{Ned} is None}.
|
|
876
915
|
|
|
877
916
|
@return: NED as an L{Ned} instance or if C{B{Ned} is None},
|
|
878
917
|
an L{Ned4Tuple}C{(north, east, down, ltp)}.
|
|
918
|
+
|
|
919
|
+
@raise TypeError: Invalid B{C{Ned}} or B{C{name_Ned_kwds}}.
|
|
879
920
|
'''
|
|
880
|
-
return self.ned4._toNed(Ned,
|
|
921
|
+
return self.ned4._toNed(Ned, name_Ned_kwds)
|
|
881
922
|
|
|
882
|
-
def toXyz(self, Xyz=None, **
|
|
923
|
+
def toXyz(self, Xyz=None, **name_Xyz_kwds):
|
|
883
924
|
'''Get the local I{X, Y, Z} (XYZ) components.
|
|
884
925
|
|
|
885
926
|
@kwarg Xyz: Class to return XYZ (L{XyzLocal}, L{Enu},
|
|
886
927
|
L{Ned}, L{Aer}) or C{None}.
|
|
887
|
-
@kwarg
|
|
888
|
-
|
|
928
|
+
@kwarg name_Xyz_kwds: Optional C{B{name}=NN} (C{str}) and
|
|
929
|
+
optional, additional B{C{Xyz}} keyword arguments,
|
|
930
|
+
ignored if C{B{Xyz} is None}.
|
|
889
931
|
|
|
890
932
|
@return: XYZ as an B{C{Xyz}} instance or if C{B{Xyz} is None},
|
|
891
933
|
an L{Xyz4Tuple}C{(x, y, z, ltp)}.
|
|
934
|
+
|
|
935
|
+
@raise TypeError: Invalid B{C{Xyz}} or B{C{name_EXyz_kwds}}.
|
|
892
936
|
'''
|
|
893
|
-
return self.xyz4._toXyz(Xyz,
|
|
937
|
+
return self.xyz4._toXyz(Xyz, name_Xyz_kwds)
|
|
894
938
|
|
|
895
939
|
@Property_RO
|
|
896
940
|
def up(self):
|
|
@@ -935,7 +979,7 @@ class XyzLocal(_Vector3d):
|
|
|
935
979
|
# return self._z
|
|
936
980
|
|
|
937
981
|
|
|
938
|
-
class Xyz4Tuple(
|
|
982
|
+
class Xyz4Tuple(_Abc4Tuple):
|
|
939
983
|
'''4-Tuple C{(x, y, z, ltp)}, all in C{meter} except C{ltp}.
|
|
940
984
|
'''
|
|
941
985
|
_Names_ = (_x_, _y_, _z_, _ltp_)
|
|
@@ -944,10 +988,13 @@ class Xyz4Tuple(_NamedTuple):
|
|
|
944
988
|
def _toXyz(self, Cls, Cls_kwds):
|
|
945
989
|
'''(INTERNAL) Return C{Cls(..., **Cls_kwds)} instance.
|
|
946
990
|
'''
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
991
|
+
return self._2Cls(XyzLocal, Cls, Cls_kwds)
|
|
992
|
+
|
|
993
|
+
@property_RO
|
|
994
|
+
def xyz4(self):
|
|
995
|
+
'''Get the C{(x, y, z, ltp)} components (L{Xyz4Tuple}).
|
|
996
|
+
'''
|
|
997
|
+
return self
|
|
951
998
|
|
|
952
999
|
@Property_RO
|
|
953
1000
|
def xyzLocal(self):
|
|
@@ -964,7 +1011,7 @@ class Enu(XyzLocal):
|
|
|
964
1011
|
'''
|
|
965
1012
|
_toStr = _enu_
|
|
966
1013
|
|
|
967
|
-
def __init__(self, east_enu, north=0, up=0, ltp=None, name
|
|
1014
|
+
def __init__(self, east_enu, north=0, up=0, ltp=None, **name):
|
|
968
1015
|
'''New L{Enu}.
|
|
969
1016
|
|
|
970
1017
|
@arg east_enu: Scalar East component (C{meter}) or a previous
|
|
@@ -977,27 +1024,28 @@ class Enu(XyzLocal):
|
|
|
977
1024
|
normal from the surface of the ellipsoid or sphere (C{meter}).
|
|
978
1025
|
@kwarg ltp: The I{local tangent plane}, (geodetic) origin (L{Ltp},
|
|
979
1026
|
L{LocalCartesian}).
|
|
980
|
-
@kwarg name: Optional name (C{str}).
|
|
1027
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
981
1028
|
|
|
982
1029
|
@raise TypeError: Invalid B{C{east_enu}} or B{C{ltp}}.
|
|
983
1030
|
|
|
984
1031
|
@raise UnitError: Invalid B{C{east_enu}}, B{C{north}} or B{C{up}}.
|
|
985
1032
|
'''
|
|
986
|
-
XyzLocal.__init__(self, east_enu, north, up, ltp=ltp, name
|
|
1033
|
+
XyzLocal.__init__(self, east_enu, north, up, ltp=ltp, **name)
|
|
987
1034
|
|
|
988
|
-
def toUvw(self, location, Uvw=None, **
|
|
1035
|
+
def toUvw(self, location, Uvw=None, **name_Uvw_kwds):
|
|
989
1036
|
'''Get the I{u, v, w} (UVW) components at a location.
|
|
990
1037
|
|
|
991
1038
|
@arg location: The geodetic (C{LatLon}) or geocentric (C{Cartesian},
|
|
992
1039
|
L{Vector3d}) location, like a Point-Of-View.
|
|
993
1040
|
@kwarg Uvw: Class to return UWV (L{Uvw}) or C{None}.
|
|
994
|
-
@kwarg
|
|
995
|
-
|
|
1041
|
+
@kwarg name_Uvw_kwds: Optional C{B{name}=NN} (C{str}) and optional,
|
|
1042
|
+
additional B{L{Uvw}} keyword arguments, ignored if
|
|
1043
|
+
C{B{Uvw} is None}.
|
|
996
1044
|
|
|
997
1045
|
@return: UVW as a L{Uvw} instance or if C{B{Uvw} is None}, a
|
|
998
1046
|
L{Uvw3Tuple}C{(u, v, w)}.
|
|
999
1047
|
|
|
1000
|
-
@raise TypeError:
|
|
1048
|
+
@raise TypeError: Invalid B{C{location}} or B{C{name_Uvw_kwds}}.
|
|
1001
1049
|
|
|
1002
1050
|
@see: Function U{lookAtSpheroid<https://PyPI.org/project/pymap3d>}.
|
|
1003
1051
|
'''
|
|
@@ -1011,8 +1059,10 @@ class Enu(XyzLocal):
|
|
|
1011
1059
|
U = cb * t - sb * e
|
|
1012
1060
|
V = cb * e + sb * t
|
|
1013
1061
|
W = ca * n + sa * u
|
|
1014
|
-
|
|
1015
|
-
|
|
1062
|
+
|
|
1063
|
+
n, kwds = _name2__(name_Uvw_kwds, _or_nameof=self)
|
|
1064
|
+
return Uvw3Tuple(U, V, W, name=n) if Uvw is None else \
|
|
1065
|
+
Uvw(U, V, W, name=n, **kwds)
|
|
1016
1066
|
|
|
1017
1067
|
@Property_RO
|
|
1018
1068
|
def xyzLocal(self):
|
|
@@ -1021,7 +1071,7 @@ class Enu(XyzLocal):
|
|
|
1021
1071
|
return XyzLocal(*self.xyz4, name=self.name)
|
|
1022
1072
|
|
|
1023
1073
|
|
|
1024
|
-
class Enu4Tuple(
|
|
1074
|
+
class Enu4Tuple(_Abc4Tuple):
|
|
1025
1075
|
'''4-Tuple C{(east, north, up, ltp)}, in C{meter} except C{ltp}.
|
|
1026
1076
|
'''
|
|
1027
1077
|
_Names_ = (_east_, _north_, _up_, _ltp_)
|
|
@@ -1030,10 +1080,7 @@ class Enu4Tuple(_NamedTuple):
|
|
|
1030
1080
|
def _toEnu(self, Cls, Cls_kwds):
|
|
1031
1081
|
'''(INTERNAL) Return C{Cls(..., **Cls_kwds)} instance.
|
|
1032
1082
|
'''
|
|
1033
|
-
|
|
1034
|
-
return Cls(*self, **_xkwds(Cls_kwds, name=self.name))
|
|
1035
|
-
else:
|
|
1036
|
-
return _4Tuple2Cls(self, Cls, Cls_kwds)
|
|
1083
|
+
return self._2Cls(Enu, Cls, Cls_kwds)
|
|
1037
1084
|
|
|
1038
1085
|
@Property_RO
|
|
1039
1086
|
def xyzLocal(self):
|
|
@@ -1130,87 +1177,99 @@ class Local9Tuple(_NamedTuple):
|
|
|
1130
1177
|
'''
|
|
1131
1178
|
return self.xyzLocal.aer4.slantrange
|
|
1132
1179
|
|
|
1133
|
-
def toAer(self, Aer=None, **
|
|
1180
|
+
def toAer(self, Aer=None, **name_Aer_kwds):
|
|
1134
1181
|
'''Get the I{local} I{Azimuth, Elevation, slant Range} (AER) components.
|
|
1135
1182
|
|
|
1136
1183
|
@kwarg Aer: Class to return AER (L{Aer}) or C{None}.
|
|
1137
|
-
@kwarg
|
|
1138
|
-
|
|
1184
|
+
@kwarg name_Aer_kwds: Optional C{B{name}=NN} (C{str}) and optional,
|
|
1185
|
+
additional B{L{Aer}} keyword arguments, ignored if
|
|
1186
|
+
B{C{Aer}} is C{None}.
|
|
1139
1187
|
|
|
1140
|
-
@return: AER as an L{Aer} instance or if C{B{Aer} is None},
|
|
1141
|
-
|
|
1188
|
+
@return: AER as an L{Aer} instance or if C{B{Aer} is None}, an
|
|
1189
|
+
L{Aer4Tuple}C{(azimuth, elevation, slantrange, ltp)}.
|
|
1190
|
+
|
|
1191
|
+
@raise TypeError: Invalid B{C{Aer}} or B{C{name_Aer_kwds}}.
|
|
1142
1192
|
'''
|
|
1143
|
-
return self.xyzLocal.toAer(Aer=Aer, **
|
|
1193
|
+
return self.xyzLocal.toAer(Aer=Aer, **name_Aer_kwds)
|
|
1144
1194
|
|
|
1145
|
-
def toCartesian(self, Cartesian=None, **
|
|
1195
|
+
def toCartesian(self, Cartesian=None, **name_Cartesian_kwds):
|
|
1146
1196
|
'''Convert this I{local} to I{geocentric} C{(x, y, z)} (ECEF).
|
|
1147
1197
|
|
|
1148
1198
|
@kwarg Cartesian: Optional class to return C{(x, y, z)} (C{Cartesian})
|
|
1149
1199
|
or C{None}.
|
|
1150
|
-
@kwarg
|
|
1151
|
-
|
|
1200
|
+
@kwarg name_Cartesian_kwds: Optional C{B{name}=NN} (C{str}) and optional,
|
|
1201
|
+
additional B{C{Cartesian}} keyword arguments, ignored if
|
|
1202
|
+
C{B{Cartesian} is None}.
|
|
1152
1203
|
|
|
1153
|
-
@return: A C{B{Cartesian}(x, y, z, **B{Cartesian_kwds})} instance
|
|
1154
|
-
|
|
1204
|
+
@return: A C{B{Cartesian}(x, y, z, **B{Cartesian_kwds})} instance or
|
|
1205
|
+
if C{B{Cartesian} is None}, a L{Vector4Tuple}C{(x, y, z, h)} .
|
|
1155
1206
|
|
|
1156
|
-
@raise TypeError: Invalid B{C{Cartesian}} or B{C{
|
|
1157
|
-
argument.
|
|
1207
|
+
@raise TypeError: Invalid B{C{Cartesian}} or B{C{name_Cartesian_kwds}}.
|
|
1158
1208
|
'''
|
|
1159
|
-
return self.ecef.toCartesian(Cartesian=Cartesian, **
|
|
1209
|
+
return self.ecef.toCartesian(Cartesian=Cartesian, **name_Cartesian_kwds) # PYCHOK _Tuple
|
|
1160
1210
|
|
|
1161
|
-
def toEnu(self, Enu=None, **
|
|
1211
|
+
def toEnu(self, Enu=None, **name_Enu_kwds):
|
|
1162
1212
|
'''Get the I{local} I{East, North, Up} (ENU) components.
|
|
1163
1213
|
|
|
1164
1214
|
@kwarg Enu: Class to return ENU (L{Enu}) or C{None}.
|
|
1165
|
-
@kwarg
|
|
1166
|
-
|
|
1215
|
+
@kwarg name_Enu_kwds: Optional C{B{name}=NN} (C{str}) and optional,
|
|
1216
|
+
additional B{L{Enu}} keyword arguments, ignored if
|
|
1217
|
+
C{B{Enu} is None}.
|
|
1167
1218
|
|
|
1168
|
-
@return: ENU as an L{Enu} instance or if C{B{Enu} is None},
|
|
1169
|
-
|
|
1219
|
+
@return: ENU as an L{Enu} instance or if C{B{Enu} is None}, an
|
|
1220
|
+
L{Enu4Tuple}C{(east, north, up, ltp)}.
|
|
1221
|
+
|
|
1222
|
+
@raise TypeError: Invalid B{C{Enu}} or B{C{name_Enu_kwds}}.
|
|
1170
1223
|
'''
|
|
1171
|
-
return self.xyzLocal.toEnu(Enu=Enu, **
|
|
1224
|
+
return self.xyzLocal.toEnu(Enu=Enu, **name_Enu_kwds)
|
|
1172
1225
|
|
|
1173
|
-
def toLatLon(self, LatLon=None, **
|
|
1226
|
+
def toLatLon(self, LatLon=None, **name_LatLon_kwds):
|
|
1174
1227
|
'''Convert this I{local} to I{geodetic} C{(lat, lon, height)}.
|
|
1175
1228
|
|
|
1176
1229
|
@kwarg LatLon: Optional class to return C{(lat, lon, height)}
|
|
1177
1230
|
(C{LatLon}) or C{None}.
|
|
1178
|
-
@kwarg
|
|
1179
|
-
|
|
1231
|
+
@kwarg name_LatLon_kwds: Optional C{B{name}=NN} (C{str}) and optional,
|
|
1232
|
+
additional B{C{LatLon}} keyword arguments, ignored if
|
|
1233
|
+
C{B{LatLon} is None}.
|
|
1180
1234
|
|
|
1181
1235
|
@return: An instance of C{B{LatLon}(lat, lon, **B{LatLon_kwds})}
|
|
1182
1236
|
or if C{B{LatLon} is None}, a L{LatLon3Tuple}C{(lat, lon,
|
|
1183
1237
|
height)} respectively L{LatLon4Tuple}C{(lat, lon, height,
|
|
1184
1238
|
datum)} depending on whether C{datum} is un-/specified.
|
|
1185
1239
|
|
|
1186
|
-
@raise TypeError: Invalid B{C{LatLon}} or B{C{
|
|
1187
|
-
argument.
|
|
1240
|
+
@raise TypeError: Invalid B{C{LatLon}} or B{C{name_LatLon_kwds}}.
|
|
1188
1241
|
'''
|
|
1189
|
-
return self.ecef.toLatLon(LatLon=LatLon, **
|
|
1242
|
+
return self.ecef.toLatLon(LatLon=LatLon, **name_LatLon_kwds) # PYCHOK _Tuple
|
|
1190
1243
|
|
|
1191
|
-
def toNed(self, Ned=None, **
|
|
1244
|
+
def toNed(self, Ned=None, **name_Ned_kwds):
|
|
1192
1245
|
'''Get the I{local} I{North, East, Down} (NED) components.
|
|
1193
1246
|
|
|
1194
1247
|
@kwarg Ned: Class to return NED (L{Ned}) or C{None}.
|
|
1195
|
-
@kwarg
|
|
1196
|
-
|
|
1248
|
+
@kwarg name_Ned_kwds: Optional C{B{name}=NN} (C{str}) and optional,
|
|
1249
|
+
additional B{L{Ned}} keyword arguments, ignored if
|
|
1250
|
+
B{C{Ned}} is C{None}.
|
|
1197
1251
|
|
|
1198
|
-
@return: NED as an L{Ned} instance or if C{B{Ned} is None},
|
|
1199
|
-
|
|
1252
|
+
@return: NED as an L{Ned} instance or if C{B{Ned} is None}, an
|
|
1253
|
+
L{Ned4Tuple}C{(north, east, down, ltp)}.
|
|
1254
|
+
|
|
1255
|
+
@raise TypeError: Invalid B{C{Ned}} or B{C{name_Ned_kwds}}.
|
|
1200
1256
|
'''
|
|
1201
|
-
return self.xyzLocal.toNed(Ned=Ned, **
|
|
1257
|
+
return self.xyzLocal.toNed(Ned=Ned, **name_Ned_kwds)
|
|
1202
1258
|
|
|
1203
|
-
def toXyz(self, Xyz=None, **
|
|
1259
|
+
def toXyz(self, Xyz=None, **name_Xyz_kwds):
|
|
1204
1260
|
'''Get the I{local} I{X, Y, Z} (XYZ) components.
|
|
1205
1261
|
|
|
1206
1262
|
@kwarg Xyz: Class to return XYZ (L{XyzLocal}) or C{None}.
|
|
1207
|
-
@kwarg
|
|
1208
|
-
|
|
1263
|
+
@kwarg name_Xyz_kwds: Optional C{B{name}=NN} (C{str}) and optional,
|
|
1264
|
+
additional B{C{Xyz}} keyword arguments, ignored if
|
|
1265
|
+
C{B{Xyz} is None}.
|
|
1209
1266
|
|
|
1210
1267
|
@return: XYZ as an B{C{Xyz}} instance or if C{B{Xyz} is None},
|
|
1211
1268
|
an L{Xyz4Tuple}C{(x, y, z, ltp)}.
|
|
1269
|
+
|
|
1270
|
+
@raise TypeError: Invalid B{C{Xyz}} or B{C{name_Xyz_kwds}}.
|
|
1212
1271
|
'''
|
|
1213
|
-
return self.xyzLocal.toXyz(Xyz=Xyz, **
|
|
1272
|
+
return self.xyzLocal.toXyz(Xyz=Xyz, **name_Xyz_kwds)
|
|
1214
1273
|
|
|
1215
1274
|
@Property_RO
|
|
1216
1275
|
def up(self):
|
|
@@ -1240,34 +1299,35 @@ class Uvw(_Vector3d):
|
|
|
1240
1299
|
'''
|
|
1241
1300
|
_toStr = _uvw_
|
|
1242
1301
|
|
|
1243
|
-
def __init__(self, u_uvw, v=0, w=0, name
|
|
1302
|
+
def __init__(self, u_uvw, v=0, w=0, **name):
|
|
1244
1303
|
'''New L{Uvw}.
|
|
1245
1304
|
|
|
1246
1305
|
@arg u_uvw: Scalar U component (C{meter}) or a previous instance
|
|
1247
1306
|
(L{Uvw}, L{Uvw3Tuple}, L{Vector3d}).
|
|
1248
1307
|
@kwarg v: V component (C{meter}) only used with scalar B{C{u_uvw}}.
|
|
1249
1308
|
@kwarg w: W component (C{meter}) only used with scalar B{C{u_uvw}}.
|
|
1250
|
-
@kwarg name: Optional name (C{str}).
|
|
1309
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
1251
1310
|
|
|
1252
1311
|
@raise TypeError: Invalid B{C{east_enu}}.
|
|
1253
1312
|
|
|
1254
1313
|
@raise UnitError: Invalid B{C{east_enu}}, B{C{v}} or B{C{w}}.
|
|
1255
1314
|
'''
|
|
1256
|
-
Vector3d.__init__(self, u_uvw, v, w, name
|
|
1315
|
+
Vector3d.__init__(self, u_uvw, v, w, **name)
|
|
1257
1316
|
|
|
1258
|
-
def toEnu(self, location, Enu=Enu, **
|
|
1317
|
+
def toEnu(self, location, Enu=Enu, **name_Enu_kwds):
|
|
1259
1318
|
'''Get the I{East, North, Up} (ENU) components at a location.
|
|
1260
1319
|
|
|
1261
1320
|
@arg location: The geodetic (C{LatLon}) or geocentric (C{Cartesian},
|
|
1262
1321
|
L{Vector3d}) location from where to cast the L{Los}.
|
|
1263
1322
|
@kwarg Enu: Class to return ENU (L{Enu}) or C{None}.
|
|
1264
|
-
@kwarg
|
|
1265
|
-
|
|
1323
|
+
@kwarg name_Enu_kwds: Optional C{B{name}=NN} (C{str}) and optional,
|
|
1324
|
+
additional B{L{Enu}} keyword arguments, ignored if
|
|
1325
|
+
C{B{Enu} is None}.
|
|
1266
1326
|
|
|
1267
1327
|
@return: ENU as an L{Enu} instance or if C{B{Enu} is None}, an
|
|
1268
1328
|
L{Enu4Tuple}C{(east, north, up, ltp)} with C{ltp=None}.
|
|
1269
1329
|
|
|
1270
|
-
@raise TypeError:
|
|
1330
|
+
@raise TypeError: Invalid B{C{location}} or B{C{name_Enu_kwds}}.
|
|
1271
1331
|
|
|
1272
1332
|
@see: Function U{lookAtSpheroid<https://PyPI.org/project/pymap3d>}.
|
|
1273
1333
|
'''
|
|
@@ -1281,8 +1341,10 @@ class Uvw(_Vector3d):
|
|
|
1281
1341
|
E = cb * v - sb * u
|
|
1282
1342
|
N = ca * w - sa * t
|
|
1283
1343
|
U = ca * t + sa * w
|
|
1284
|
-
|
|
1285
|
-
|
|
1344
|
+
|
|
1345
|
+
n, kwds = _name2__(name_Enu_kwds, _or_nameof=self)
|
|
1346
|
+
return Enu4Tuple(E, N, U, name=n) if Enu is None else \
|
|
1347
|
+
Enu(E, N, U, name=n, **kwds)
|
|
1286
1348
|
|
|
1287
1349
|
u = Vector3d.x
|
|
1288
1350
|
|
|
@@ -1307,7 +1369,7 @@ class Los(Aer):
|
|
|
1307
1369
|
'''A Line-Of-Sight (LOS) from a C{LatLon} or C{Cartesian} location.
|
|
1308
1370
|
'''
|
|
1309
1371
|
|
|
1310
|
-
def __init__(self, azimuth_aer, elevation=0, name
|
|
1372
|
+
def __init__(self, azimuth_aer, elevation=0, **name):
|
|
1311
1373
|
'''New L{Los}.
|
|
1312
1374
|
|
|
1313
1375
|
@arg azimuth_aer: Scalar azimuth, bearing from North (compass C{degrees})
|
|
@@ -1316,31 +1378,31 @@ class Los(Aer):
|
|
|
1316
1378
|
@kwarg elevation: Scalar angle I{above} the horizon (C{degrees}, horizon
|
|
1317
1379
|
is 0, zenith +90, nadir -90), only used with scalar
|
|
1318
1380
|
B{C{azimuth_aer}}.
|
|
1319
|
-
@kwarg name: Optional name (C{str}).
|
|
1381
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
1320
1382
|
|
|
1321
1383
|
@raise TypeError: Invalid B{C{azimuth_aer}}.
|
|
1322
1384
|
|
|
1323
1385
|
@raise UnitError: Invalid B{C{azimuth_aer}} or B{C{elevation}}.
|
|
1324
1386
|
'''
|
|
1325
1387
|
t = Aer(azimuth_aer, elevation)
|
|
1326
|
-
Aer.__init__(self, t.azimuth, t.elevation, slantrange=_1_0, name
|
|
1388
|
+
Aer.__init__(self, t.azimuth, t.elevation, slantrange=_1_0, **name)
|
|
1327
1389
|
|
|
1328
|
-
def toUvw(self, location, Uvw=Uvw, **
|
|
1390
|
+
def toUvw(self, location, Uvw=Uvw, **name_Uvw_kwds):
|
|
1329
1391
|
'''Get this LOS' I{target} (UVW) components from a location.
|
|
1330
1392
|
|
|
1331
1393
|
@arg location: The geodetic (C{LatLon}) or geocentric (C{Cartesian},
|
|
1332
|
-
L{Vector3d}) location from where to cast
|
|
1394
|
+
L{Vector3d}) location from where to cast this LOS.
|
|
1333
1395
|
|
|
1334
1396
|
@see: Method L{Enu.toUvw} for further details.
|
|
1335
1397
|
'''
|
|
1336
|
-
return self.toEnu().toUvw(location, Uvw=Uvw, **
|
|
1398
|
+
return self.toEnu().toUvw(location, Uvw=Uvw, **name_Uvw_kwds)
|
|
1337
1399
|
|
|
1338
|
-
def toEnu(self, Enu=Enu, **
|
|
1400
|
+
def toEnu(self, Enu=Enu, **name_Enu_kwds):
|
|
1339
1401
|
'''Get this LOS as I{East, North, Up} (ENU) components.
|
|
1340
1402
|
|
|
1341
1403
|
@see: Method L{Aer.toEnu} for further details.
|
|
1342
1404
|
'''
|
|
1343
|
-
return Aer.toEnu(self, Enu=Enu, **
|
|
1405
|
+
return Aer.toEnu(self, Enu=Enu, **name_Enu_kwds)
|
|
1344
1406
|
|
|
1345
1407
|
|
|
1346
1408
|
class ChLV9Tuple(Local9Tuple):
|
|
@@ -1361,7 +1423,7 @@ class ChLV9Tuple(Local9Tuple):
|
|
|
1361
1423
|
def EN2_LV95(self):
|
|
1362
1424
|
'''Get the I{falsed Swiss (E_LV95, N_LV95)} easting and northing (L{ChLVEN2Tuple}).
|
|
1363
1425
|
'''
|
|
1364
|
-
return ChLVEN2Tuple(*
|
|
1426
|
+
return ChLVEN2Tuple(*_ltp.ChLV.false2(self.Y, self.X, True), name=self.name)
|
|
1365
1427
|
|
|
1366
1428
|
@Property_RO
|
|
1367
1429
|
def h_LV03(self):
|
|
@@ -1379,19 +1441,19 @@ class ChLV9Tuple(Local9Tuple):
|
|
|
1379
1441
|
def isChLV(self):
|
|
1380
1442
|
'''Is this a L{ChLV}-generated L{ChLV9Tuple}?.
|
|
1381
1443
|
'''
|
|
1382
|
-
return self.ltp.__class__ is
|
|
1444
|
+
return self.ltp.__class__ is _ltp.ChLV
|
|
1383
1445
|
|
|
1384
1446
|
@property_RO
|
|
1385
1447
|
def isChLVa(self):
|
|
1386
1448
|
'''Is this a L{ChLVa}-generated L{ChLV9Tuple}?.
|
|
1387
1449
|
'''
|
|
1388
|
-
return self.ltp.__class__ is
|
|
1450
|
+
return self.ltp.__class__ is _ltp.ChLVa
|
|
1389
1451
|
|
|
1390
1452
|
@property_RO
|
|
1391
1453
|
def isChLVe(self):
|
|
1392
1454
|
'''Is this a L{ChLVe}-generated L{ChLV9Tuple}?.
|
|
1393
1455
|
'''
|
|
1394
|
-
return self.ltp.__class__ is
|
|
1456
|
+
return self.ltp.__class__ is _ltp.ChLVe
|
|
1395
1457
|
|
|
1396
1458
|
@Property_RO
|
|
1397
1459
|
def N_LV95(self):
|
|
@@ -1433,7 +1495,7 @@ class ChLV9Tuple(Local9Tuple):
|
|
|
1433
1495
|
def yx2_LV03(self):
|
|
1434
1496
|
'''Get the B{falsed} I{Swiss (y_LV03, x_LV03)} easting and northing (L{ChLVyx2Tuple}).
|
|
1435
1497
|
'''
|
|
1436
|
-
return ChLVyx2Tuple(*
|
|
1498
|
+
return ChLVyx2Tuple(*_ltp.ChLV.false2(self.Y, self.X, False), name=self.name)
|
|
1437
1499
|
|
|
1438
1500
|
@Property_RO
|
|
1439
1501
|
def z(self):
|
|
@@ -1454,7 +1516,7 @@ class ChLVYX2Tuple(_NamedTuple):
|
|
|
1454
1516
|
|
|
1455
1517
|
@see: Function L{ChLV.false2} for more information.
|
|
1456
1518
|
'''
|
|
1457
|
-
return
|
|
1519
|
+
return _ltp.ChLV.false2(*self, LV95=LV95, name=self.name)
|
|
1458
1520
|
|
|
1459
1521
|
|
|
1460
1522
|
class ChLVEN2Tuple(_NamedTuple):
|
|
@@ -1469,7 +1531,7 @@ class ChLVEN2Tuple(_NamedTuple):
|
|
|
1469
1531
|
|
|
1470
1532
|
@see: Function L{ChLV.unfalse2} for more information.
|
|
1471
1533
|
'''
|
|
1472
|
-
return
|
|
1534
|
+
return _ltp.ChLV.unfalse2(*self, LV95=True, name=self.name)
|
|
1473
1535
|
|
|
1474
1536
|
|
|
1475
1537
|
class ChLVyx2Tuple(_NamedTuple):
|
|
@@ -1484,7 +1546,7 @@ class ChLVyx2Tuple(_NamedTuple):
|
|
|
1484
1546
|
|
|
1485
1547
|
@see: Function L{ChLV.unfalse2} for more information.
|
|
1486
1548
|
'''
|
|
1487
|
-
return
|
|
1549
|
+
return _ltp.ChLV.unfalse2(*self, LV95=False, name=self.name)
|
|
1488
1550
|
|
|
1489
1551
|
|
|
1490
1552
|
class Footprint5Tuple(_NamedTuple):
|
|
@@ -1497,28 +1559,30 @@ class Footprint5Tuple(_NamedTuple):
|
|
|
1497
1559
|
_Names_ = (_center_, 'upperleft', 'upperight', 'loweright', 'lowerleft')
|
|
1498
1560
|
_Units_ = (_Pass, _Pass, _Pass, _Pass, _Pass)
|
|
1499
1561
|
|
|
1500
|
-
def toLatLon5(self, ltp=None, LatLon=None, **
|
|
1562
|
+
def toLatLon5(self, ltp=None, LatLon=None, **name_LatLon_kwds):
|
|
1501
1563
|
'''Convert this footprint's C{center} and 4 corners to I{geodetic}
|
|
1502
1564
|
C{LatLon(lat, lon, height)}s or C{LatLon3-} or C{-4Tuple}s.
|
|
1503
1565
|
|
|
1504
1566
|
@kwarg ltp: The I{local tangent plane} (L{Ltp}), overriding this
|
|
1505
1567
|
footprint's C{center} or C{frustrum} C{ltp}.
|
|
1506
1568
|
@kwarg LatLon: Optional I{geodetic} class (C{LatLon}) or C{None}.
|
|
1507
|
-
@kwarg
|
|
1508
|
-
|
|
1569
|
+
@kwarg name_LatLon_kwds: Optional C{B{name}=NN} (C{str}) and optional,
|
|
1570
|
+
additional B{C{LatLon}} keyword arguments, ignored if
|
|
1571
|
+
C{B{LatLon} is None}.
|
|
1509
1572
|
|
|
1510
1573
|
@return: A L{Footprint5Tuple} of 5 C{B{LatLon}(lat, lon,
|
|
1511
|
-
**B{
|
|
1574
|
+
**B{name_LatLon_kwds})} instances or if C{B{LatLon} is None},
|
|
1512
1575
|
5 L{LatLon3Tuple}C{(lat, lon, height)}s respectively
|
|
1513
1576
|
5 L{LatLon4Tuple}C{(lat, lon, height, datum)}s depending
|
|
1514
|
-
on keyword argument C{datum} is un-/specified.
|
|
1577
|
+
on whether keyword argument C{datum} is un-/specified.
|
|
1515
1578
|
|
|
1516
|
-
@raise TypeError: Invalid B{C{ltp}}, B{C{LatLon}} or B{C{
|
|
1579
|
+
@raise TypeError: Invalid B{C{ltp}}, B{C{LatLon}} or B{C{name_LatLon_kwds}}.
|
|
1517
1580
|
|
|
1518
1581
|
@see: Methods L{XyzLocal.toLatLon} and L{Footprint5Tuple.xyzLocal5}.
|
|
1519
1582
|
'''
|
|
1520
|
-
|
|
1521
|
-
|
|
1583
|
+
ltp = _ltp._xLtp(ltp, self.center.ltp) # PYCHOK .center
|
|
1584
|
+
kwds = _name1__(name_LatLon_kwds, _or_nameof=self)
|
|
1585
|
+
kwds = _xkwds(kwds, ltp=ltp, LatLon=LatLon)
|
|
1522
1586
|
return Footprint5Tuple(t.toLatLon(**kwds) for t in self.xyzLocal5())
|
|
1523
1587
|
|
|
1524
1588
|
def xyzLocal5(self, ltp=None):
|
|
@@ -1534,12 +1598,12 @@ class Footprint5Tuple(_NamedTuple):
|
|
|
1534
1598
|
if ltp is None:
|
|
1535
1599
|
p = self
|
|
1536
1600
|
else:
|
|
1537
|
-
p =
|
|
1601
|
+
p = _ltp._xLtp(ltp)
|
|
1538
1602
|
p = tuple(Xyz4Tuple(t.x, t.y, t.z, p) for t in self)
|
|
1539
1603
|
return Footprint5Tuple(t.xyzLocal for t in p)
|
|
1540
1604
|
|
|
1541
1605
|
|
|
1542
|
-
__all__ += _ALL_DOCS(
|
|
1606
|
+
__all__ += _ALL_DOCS(_AbcBase)
|
|
1543
1607
|
|
|
1544
1608
|
# **) MIT License
|
|
1545
1609
|
#
|