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.
Files changed (71) hide show
  1. {PyGeodesy-24.5.24.dist-info → PyGeodesy-24.6.9.dist-info}/METADATA +6 -5
  2. PyGeodesy-24.6.9.dist-info/RECORD +116 -0
  3. pygeodesy/__init__.py +4 -4
  4. pygeodesy/auxilats/__init__.py +1 -1
  5. pygeodesy/auxilats/__main__.py +2 -2
  6. pygeodesy/auxilats/auxAngle.py +4 -4
  7. pygeodesy/basics.py +39 -5
  8. pygeodesy/booleans.py +54 -67
  9. pygeodesy/cartesianBase.py +138 -147
  10. pygeodesy/constants.py +3 -3
  11. pygeodesy/deprecated/functions.py +9 -3
  12. pygeodesy/ecef.py +67 -72
  13. pygeodesy/ellipsoidalBase.py +18 -56
  14. pygeodesy/ellipsoidalGeodSolve.py +2 -2
  15. pygeodesy/ellipsoidalKarney.py +3 -3
  16. pygeodesy/ellipsoidalNvector.py +7 -7
  17. pygeodesy/ellipsoids.py +6 -5
  18. pygeodesy/errors.py +20 -10
  19. pygeodesy/etm.py +16 -21
  20. pygeodesy/fmath.py +9 -20
  21. pygeodesy/formy.py +60 -74
  22. pygeodesy/frechet.py +13 -14
  23. pygeodesy/fsums.py +60 -26
  24. pygeodesy/geodesicx/__init__.py +1 -1
  25. pygeodesy/geodesicx/__main__.py +2 -2
  26. pygeodesy/geodesicx/gx.py +3 -5
  27. pygeodesy/geodsolve.py +24 -26
  28. pygeodesy/geohash.py +27 -40
  29. pygeodesy/geoids.py +1 -1
  30. pygeodesy/hausdorff.py +17 -18
  31. pygeodesy/heights.py +17 -30
  32. pygeodesy/internals.py +15 -14
  33. pygeodesy/interns.py +3 -9
  34. pygeodesy/iters.py +2 -2
  35. pygeodesy/karney.py +8 -7
  36. pygeodesy/latlonBase.py +189 -176
  37. pygeodesy/lazily.py +92 -56
  38. pygeodesy/lcc.py +2 -2
  39. pygeodesy/ltp.py +93 -55
  40. pygeodesy/ltpTuples.py +304 -240
  41. pygeodesy/mgrs.py +51 -24
  42. pygeodesy/named.py +159 -136
  43. pygeodesy/namedTuples.py +43 -14
  44. pygeodesy/nvectorBase.py +20 -23
  45. pygeodesy/osgr.py +40 -48
  46. pygeodesy/points.py +11 -11
  47. pygeodesy/props.py +29 -16
  48. pygeodesy/rhumb/aux_.py +13 -15
  49. pygeodesy/rhumb/bases.py +12 -5
  50. pygeodesy/rhumb/ekx.py +24 -18
  51. pygeodesy/rhumb/solve.py +20 -70
  52. pygeodesy/simplify.py +16 -16
  53. pygeodesy/solveBase.py +35 -32
  54. pygeodesy/sphericalBase.py +33 -31
  55. pygeodesy/sphericalTrigonometry.py +17 -17
  56. pygeodesy/streprs.py +6 -4
  57. pygeodesy/trf.py +11 -9
  58. pygeodesy/triaxials.py +71 -50
  59. pygeodesy/units.py +40 -65
  60. pygeodesy/unitsBase.py +2 -2
  61. pygeodesy/ups.py +66 -70
  62. pygeodesy/utily.py +7 -6
  63. pygeodesy/utm.py +152 -156
  64. pygeodesy/utmups.py +38 -38
  65. pygeodesy/utmupsBase.py +102 -106
  66. pygeodesy/vector3d.py +34 -36
  67. pygeodesy/vector3dBase.py +12 -9
  68. pygeodesy/webmercator.py +43 -51
  69. PyGeodesy-24.5.24.dist-info/RECORD +0 -116
  70. {PyGeodesy-24.5.24.dist-info → PyGeodesy-24.6.9.dist-info}/WHEEL +0 -0
  71. {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_, _Y_, _y_, _z_
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 _NamedBase, _NamedTuple, _Pass, _xnamed
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.05.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 _NamedAerNed(_NamedBase):
114
+ class _AbcBase(_NamedBase):
117
115
  '''(INTERNAL) Base class for classes C{Aer} and C{Ned}.
118
116
  '''
119
- _ltp = None # local tangent plane (C{Ltp}), origin
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, **Aer_kwds):
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 Aer_kwds: Optional, additional B{L{Aer}} keyword
132
- arguments, ignored if B{C{Aer}} is C{None}.
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, Aer_kwds)
138
+ return self.xyz4._toXyz(Aer, name_Aer_kwds)
138
139
 
139
- def toEnu(self, Enu=None, **Enu_kwds):
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 Enu_kwds: Optional, additional B{L{Enu}} keyword
144
- arguments, ignored if C{B{Enu} is None}.
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, Enu_kwds)
153
+ return self.xyz4._toXyz(Enu, name_Enu_kwds)
150
154
 
151
- def toNed(self, Ned=None, **Ned_kwds):
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 Ned_kwds: Optional, additional B{L{Ned}} keyword
156
- arguments, ignored if B{C{Ned}} is C{None}.
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, Ned_kwds)
168
+ return self.xyz4._toXyz(Ned, name_Ned_kwds)
162
169
 
163
- def toXyz(self, Xyz=None, **Xyz_kwds):
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 Xyz_kwds: Optional, additional B{C{Xyz}} keyword
169
- arguments, ignored if C{B{Xyz} is None}.
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, Xyz_kwds)
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 Aer(_NamedAerNed):
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=NN):
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
- self._azimuth = Bearing(azimuth=azimuth_aer)
228
- self._elevation = Degrees_(elevation=elevation, low=_N_90_0, high=_90_0)
229
- self._slantrange = Meter_(slantrange=slantrange)
230
- p, n = ltp, name
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 = _xyzLocal(Aer, Aer4Tuple, Ned, azimuth_aer=azimuth_aer)
233
- aer = p.toAer() if p else azimuth_aer
234
- self._azimuth, self._elevation, self._slantrange = \
235
- aer.azimuth, aer.elevation, aer.slantrange
236
- p = _xattr(aer, ltp=ltp)
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
- t = (toDMS(self.azimuth, form=F_D, prec=prec, ddd=0),
303
- toDMS(self.elevation, form=F_D, prec=prec, ddd=0),
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(_NamedTuple):
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
- if issubclassof(Cls, Aer):
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 _MODS.ltp.Attitude(self).tyr3d
436
+ return _ltp.Attitude(self).tyr3d
402
437
 
403
438
 
404
- class Ned(_NamedAerNed):
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=NN):
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
- self._north = Meter(north=north_ned or _0_0)
437
- self._east = Meter(east=east or _0_0)
438
- self._down = Meter(down=down or _0_0)
439
- p, n = ltp, name
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 = _xyzLocal(Ned, Ned4Tuple, Aer, north_ned=north_ned)
442
- ned = p.toNed() if p else north_ned
443
- self._north, self._east, self._down = ned.north, ned.east, ned.down
444
- p = _xattr(ned, ltp=ltp)
445
- n = name or _xattr(ned, name=name)
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(_NamedTuple):
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
- if issubclassof(Cls, Ned):
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=NN):
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
- self._x = Meter(x=x_xyz or _0_0)
670
- self._y = Meter(y=y or _0_0)
671
- self._z = Meter(z=z or _0_0)
672
- p, n = ltp, name
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
- self._x, self._y, self._z = xyz.x, xyz.y, xyz.z
676
- p = _xattr(xyz, ltp=ltp)
677
- n = name or _xattr(xyz, name=NN)
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 = _xkwds(kwds, ltp=self.ltp, name=self.name)
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, **Aer_kwds):
777
- '''Get the local I{Azimuth, Elevation, slantRange} components.
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 Aer_kwds: Optional, additional B{C{Aer}} keyword
781
- arguments, ignored if C{B{Aer} is None}.
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, Aer_kwds)
820
+ return self.aer4._toAer(Aer, name_Aer_kwds)
789
821
 
790
- def toCartesian(self, Cartesian=None, ltp=None, **Cartesian_kwds):
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 Cartesian_kwds: Optional, additional B{C{Cartesian}} keyword
798
- arguments, ignored if C{B{Cartesian} is None}.
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{Cartesian_kwds}} argument.
838
+ B{C{name_Cartesian_kwds}}.
806
839
  '''
807
- ltp = _MODS.ltp._xLtp(ltp, self.ltp)
840
+ ltp, kwds, n = self._ltp_kwds_name3(ltp, name_Cartesian_kwds)
808
841
  if Cartesian is None:
809
- r = ltp._local2ecef(self, nine=True)
842
+ t = ltp._local2ecef(self, nine=True)
843
+ r = _xnamed(t, n) if n else t
810
844
  else:
811
- x, y, z = ltp._local2ecef(self)
812
- kwds = _xkwds(Cartesian_kwds, datum=ltp.datum)
813
- r = Cartesian(x, y, z, **kwds)
814
- return _xnamed(r, self.name or ltp.name)
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, **Enu_kwds):
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 Enu_kwds: Optional, additional B{C{Enu}} keyword
821
- arguments, ignored if C{B{Enu} is None}.
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, Enu_kwds)
863
+ return self.enu4._toEnu(Enu, name_Enu_kwds)
827
864
 
828
- def toLatLon(self, LatLon=None, ltp=None, **LatLon_kwds):
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 LatLon_kwds: Optional, additional B{C{LatLon}} keyword
836
- arguments, ignored if C{B{LatLon} is None}.
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{LatLon_kwds}} argument.
881
+ B{C{name_LatLon_kwds}}.
844
882
  '''
845
- ltp = _MODS.ltp._xLtp(ltp, self.ltp)
846
- r = ltp._local2ecef(self, nine=True)
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(r, self.name or ltp.name)
886
+ r = _xnamed(t, n) if n else t
849
887
  else:
850
- kwds = _xkwds(LatLon_kwds, height=r.height, datum=r.datum,
851
- name=self.name or ltp.name)
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=NN):
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 = ltp._local2ecef(self, nine=True, M=M)
867
- return Local9Tuple(self.x, self.y, self.z, t.lat, t.lon, t.height,
868
- ltp, t, t.M, name=name or t.name)
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, **Ned_kwds):
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 Ned_kwds: Optional, additional B{C{Ned}} keyword
875
- arguments, ignored if C{B{Ned} is None}.
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, Ned_kwds)
921
+ return self.ned4._toNed(Ned, name_Ned_kwds)
881
922
 
882
- def toXyz(self, Xyz=None, **Xyz_kwds):
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 Xyz_kwds: Optional, additional B{C{Xyz}} keyword
888
- arguments, ignored if C{B{Xyz} is None}.
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, Xyz_kwds)
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(_NamedTuple):
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
- if issubclassof(Cls, XyzLocal):
948
- return Cls(*self, **_xkwds(Cls_kwds, name=self.name))
949
- else:
950
- return _4Tuple2Cls(self, Cls, Cls_kwds)
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=NN):
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=name)
1033
+ XyzLocal.__init__(self, east_enu, north, up, ltp=ltp, **name)
987
1034
 
988
- def toUvw(self, location, Uvw=None, **Uvw_kwds):
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 Uvw_kwds: Optional, additional B{L{Uvw}} keyword
995
- arguments, ignored if C{B{Uvw} is None}.
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: InvalidB{C{location}}.
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
- return Uvw3Tuple(U, V, W, name=self.name) if Uvw is None else \
1015
- Uvw( U, V, W, **_xkwds(Uvw_kwds, name=self.name))
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(_NamedTuple):
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
- if issubclassof(Cls, XyzLocal):
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, **Aer_kwds):
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 Aer_kwds: Optional, additional B{L{Aer}} keyword
1138
- arguments, ignored if B{C{Aer}} is C{None}.
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
- an L{Aer4Tuple}C{(azimuth, elevation, slantrange, ltp)}.
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, **Aer_kwds)
1193
+ return self.xyzLocal.toAer(Aer=Aer, **name_Aer_kwds)
1144
1194
 
1145
- def toCartesian(self, Cartesian=None, **Cartesian_kwds):
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 Cartesian_kwds: Optional, additional B{C{Cartesian}} keyword
1151
- arguments, ignored if C{B{Cartesian} is None}.
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
- or a L{Vector4Tuple}C{(x, y, z, h)} if C{B{Cartesian} is None}.
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{Cartesian_kwds}}
1157
- argument.
1207
+ @raise TypeError: Invalid B{C{Cartesian}} or B{C{name_Cartesian_kwds}}.
1158
1208
  '''
1159
- return self.ecef.toCartesian(Cartesian=Cartesian, **Cartesian_kwds) # PYCHOK _Tuple
1209
+ return self.ecef.toCartesian(Cartesian=Cartesian, **name_Cartesian_kwds) # PYCHOK _Tuple
1160
1210
 
1161
- def toEnu(self, Enu=None, **Enu_kwds):
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 Enu_kwds: Optional, additional B{L{Enu}} keyword
1166
- arguments, ignored if C{B{Enu} is None}.
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
- an L{Enu4Tuple}C{(east, north, up, ltp)}.
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, **Enu_kwds)
1224
+ return self.xyzLocal.toEnu(Enu=Enu, **name_Enu_kwds)
1172
1225
 
1173
- def toLatLon(self, LatLon=None, **LatLon_kwds):
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 LatLon_kwds: Optional, additional B{C{LatLon}} keyword
1179
- arguments, ignored if C{B{LatLon} is None}.
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{LatLon_kwds}}
1187
- argument.
1240
+ @raise TypeError: Invalid B{C{LatLon}} or B{C{name_LatLon_kwds}}.
1188
1241
  '''
1189
- return self.ecef.toLatLon(LatLon=LatLon, **LatLon_kwds) # PYCHOK _Tuple
1242
+ return self.ecef.toLatLon(LatLon=LatLon, **name_LatLon_kwds) # PYCHOK _Tuple
1190
1243
 
1191
- def toNed(self, Ned=None, **Ned_kwds):
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 Ned_kwds: Optional, additional B{L{Ned}} keyword
1196
- arguments, ignored if B{C{Ned}} is C{None}.
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
- an L{Ned4Tuple}C{(north, east, down, ltp)}.
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, **Ned_kwds)
1257
+ return self.xyzLocal.toNed(Ned=Ned, **name_Ned_kwds)
1202
1258
 
1203
- def toXyz(self, Xyz=None, **Xyz_kwds):
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 Xyz_kwds: Optional, additional B{C{Xyz}} keyword
1208
- arguments, ignored if C{B{Xyz} is None}.
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, **Xyz_kwds)
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=NN):
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=name)
1315
+ Vector3d.__init__(self, u_uvw, v, w, **name)
1257
1316
 
1258
- def toEnu(self, location, Enu=Enu, **Enu_kwds):
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 Enu_kwds: Optional, additional B{L{Enu}} keyword
1265
- arguments, ignored if C{B{Enu} is None}.
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: InvalidB{C{location}}.
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
- return Enu4Tuple(E, N, U, name=self.name) if Enu is None else \
1285
- Enu( E, N, U, **_xkwds(Enu_kwds, name=self.name))
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=NN):
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=name)
1388
+ Aer.__init__(self, t.azimuth, t.elevation, slantrange=_1_0, **name)
1327
1389
 
1328
- def toUvw(self, location, Uvw=Uvw, **Uvw_kwds):
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 the L{Los}.
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, **Uvw_kwds)
1398
+ return self.toEnu().toUvw(location, Uvw=Uvw, **name_Uvw_kwds)
1337
1399
 
1338
- def toEnu(self, Enu=Enu, **Enu_kwds):
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, **Enu_kwds)
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(*_MODS.ltp.ChLV.false2(self.Y, self.X, True), name=self.name)
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 _MODS.ltp.ChLV
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 _MODS.ltp.ChLVa
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 _MODS.ltp.ChLVe
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(*_MODS.ltp.ChLV.false2(self.Y, self.X, False), name=self.name)
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 _MODS.ltp.ChLV.false2(*self, LV95=LV95, name=self.name)
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 _MODS.ltp.ChLV.unfalse2(*self, LV95=True, name=self.name)
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 _MODS.ltp.ChLV.unfalse2(*self, LV95=False, name=self.name)
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, **LatLon_kwds):
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 LatLon_kwds: Optional, additional B{C{LatLon}} keyword
1508
- arguments, ignored if C{B{LatLon} is None}.
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{LatLon_kwds})} instances or if C{B{LatLon} is None},
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{LatLon_kwds}}.
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
- kwds = _xkwds(LatLon_kwds, ltp=_MODS.ltp._xLtp(ltp, self.center.ltp), # PYCHOK .center
1521
- LatLon=LatLon, name=self.name,)
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 = _MODS.ltp._xLtp(ltp)
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(_NamedAerNed)
1606
+ __all__ += _ALL_DOCS(_AbcBase)
1543
1607
 
1544
1608
  # **) MIT License
1545
1609
  #