pygeodesy 24.6.9__py2.py3-none-any.whl → 24.6.24__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 (84) hide show
  1. {PyGeodesy-24.6.9.dist-info → PyGeodesy-24.6.24.dist-info}/METADATA +2 -2
  2. PyGeodesy-24.6.24.dist-info/RECORD +117 -0
  3. pygeodesy/__init__.py +33 -32
  4. pygeodesy/albers.py +2 -2
  5. pygeodesy/auxilats/__init__.py +1 -1
  6. pygeodesy/auxilats/auxAngle.py +40 -39
  7. pygeodesy/auxilats/auxDLat.py +3 -2
  8. pygeodesy/auxilats/auxLat.py +16 -18
  9. pygeodesy/auxilats/auxily.py +1 -1
  10. pygeodesy/azimuthal.py +10 -10
  11. pygeodesy/basics.py +9 -1
  12. pygeodesy/booleans.py +4 -4
  13. pygeodesy/cartesianBase.py +11 -14
  14. pygeodesy/css.py +14 -18
  15. pygeodesy/datums.py +6 -6
  16. pygeodesy/deprecated/__init__.py +1 -1
  17. pygeodesy/deprecated/classes.py +16 -2
  18. pygeodesy/deprecated/datum.py +3 -3
  19. pygeodesy/deprecated/functions.py +6 -8
  20. pygeodesy/dms.py +23 -27
  21. pygeodesy/ecef.py +4 -4
  22. pygeodesy/elevations.py +4 -4
  23. pygeodesy/ellipsoidalBase.py +23 -28
  24. pygeodesy/ellipsoidalBaseDI.py +19 -23
  25. pygeodesy/ellipsoidalExact.py +3 -3
  26. pygeodesy/ellipsoidalGeodSolve.py +15 -23
  27. pygeodesy/ellipsoidalKarney.py +37 -60
  28. pygeodesy/ellipsoidalNvector.py +38 -44
  29. pygeodesy/ellipsoidalVincenty.py +11 -14
  30. pygeodesy/ellipsoids.py +107 -101
  31. pygeodesy/errors.py +100 -48
  32. pygeodesy/etm.py +32 -44
  33. pygeodesy/formy.py +55 -58
  34. pygeodesy/frechet.py +18 -20
  35. pygeodesy/fsums.py +3 -3
  36. pygeodesy/gars.py +3 -4
  37. pygeodesy/geodesici.py +909 -0
  38. pygeodesy/geodesicw.py +11 -13
  39. pygeodesy/geodesicx/__init__.py +4 -4
  40. pygeodesy/geodesicx/gx.py +18 -28
  41. pygeodesy/geodesicx/gxbases.py +20 -8
  42. pygeodesy/geodesicx/gxline.py +16 -22
  43. pygeodesy/geodsolve.py +80 -10
  44. pygeodesy/geohash.py +26 -34
  45. pygeodesy/geoids.py +28 -37
  46. pygeodesy/hausdorff.py +17 -18
  47. pygeodesy/heights.py +2 -2
  48. pygeodesy/internals.py +6 -0
  49. pygeodesy/interns.py +2 -2
  50. pygeodesy/karney.py +20 -4
  51. pygeodesy/ktm.py +13 -16
  52. pygeodesy/latlonBase.py +17 -19
  53. pygeodesy/lazily.py +7 -6
  54. pygeodesy/lcc.py +28 -31
  55. pygeodesy/ltp.py +7 -8
  56. pygeodesy/ltpTuples.py +68 -70
  57. pygeodesy/mgrs.py +8 -9
  58. pygeodesy/named.py +19 -10
  59. pygeodesy/nvectorBase.py +9 -10
  60. pygeodesy/osgr.py +9 -9
  61. pygeodesy/points.py +6 -6
  62. pygeodesy/rhumb/__init__.py +1 -1
  63. pygeodesy/rhumb/aux_.py +5 -5
  64. pygeodesy/rhumb/bases.py +30 -31
  65. pygeodesy/rhumb/ekx.py +3 -4
  66. pygeodesy/sphericalBase.py +10 -11
  67. pygeodesy/sphericalNvector.py +13 -13
  68. pygeodesy/sphericalTrigonometry.py +86 -97
  69. pygeodesy/streprs.py +4 -34
  70. pygeodesy/triaxials.py +48 -43
  71. pygeodesy/units.py +204 -271
  72. pygeodesy/unitsBase.py +115 -107
  73. pygeodesy/ups.py +26 -31
  74. pygeodesy/utily.py +8 -8
  75. pygeodesy/utm.py +35 -40
  76. pygeodesy/utmups.py +43 -46
  77. pygeodesy/utmupsBase.py +8 -9
  78. pygeodesy/vector3d.py +26 -27
  79. pygeodesy/vector3dBase.py +6 -7
  80. pygeodesy/webmercator.py +19 -21
  81. pygeodesy/wgrs.py +18 -20
  82. PyGeodesy-24.6.9.dist-info/RECORD +0 -116
  83. {PyGeodesy-24.6.9.dist-info → PyGeodesy-24.6.24.dist-info}/WHEEL +0 -0
  84. {PyGeodesy-24.6.9.dist-info → PyGeodesy-24.6.24.dist-info}/top_level.txt +0 -0
pygeodesy/lcc.py CHANGED
@@ -41,14 +41,14 @@ from pygeodesy.namedTuples import EasNor3Tuple, LatLonDatum3Tuple, \
41
41
  LatLon2Tuple, _LL4Tuple, PhiLam2Tuple
42
42
  from pygeodesy.props import deprecated_method, Property, Property_RO, _update_all
43
43
  from pygeodesy.streprs import Fmt, _fstrENH2, _xzipairs
44
- from pygeodesy.units import Easting, Height, _heigHt, Lam_, Northing, Phi_, \
44
+ from pygeodesy.units import Easting, Height, _heigHt, Lamd, Northing, Phid, \
45
45
  Scalar_
46
46
  from pygeodesy.utily import atan1, degrees90, degrees180, sincos2, tanPI_2_2
47
47
 
48
48
  from math import atan, fabs, log, radians, sin, sqrt
49
49
 
50
50
  __all__ = _ALL_LAZY.lcc
51
- __version__ = '24.06.09'
51
+ __version__ = '24.06.24'
52
52
 
53
53
  _E0_ = 'E0'
54
54
  _N0_ = 'N0'
@@ -107,8 +107,8 @@ class Conic(_NamedEnumItem):
107
107
  _xinstanceof(_LLEB, latlon0=latlon0)
108
108
  self._phi0, self._lam0 = latlon0.philam
109
109
 
110
- self._par1 = Phi_(par1=par1)
111
- self._par2 = self._par1 if par2 is None else Phi_(par2=par2)
110
+ self._par1 = Phid(par1=par1)
111
+ self._par2 = self._par1 if par2 is None else Phid(par2=par2)
112
112
 
113
113
  if k0 != 1:
114
114
  self._k0 = Scalar_(k0=k0)
@@ -117,7 +117,7 @@ class Conic(_NamedEnumItem):
117
117
  if N0:
118
118
  self._N0 = Easting(N0=N0, falsed=True)
119
119
  if opt3:
120
- self._opt3 = Lam_(opt3=opt3)
120
+ self._opt3 = Lamd(opt3=opt3)
121
121
 
122
122
  self.toDatum(latlon0.datum)._dup2(self)
123
123
  self._register(Conics, name)
@@ -278,20 +278,19 @@ class Conic(_NamedEnumItem):
278
278
 
279
279
  return c
280
280
 
281
- def toStr(self, prec=8, name=NN, **unused): # PYCHOK expected
281
+ def toStr(self, prec=8, **name): # PYCHOK expected
282
282
  '''Return this conic as a string.
283
283
 
284
284
  @kwarg prec: Number of (decimal) digits, unstripped (C{int}).
285
- @kwarg name: Overriding name (C{str}) or C{None} to exclude
286
- this conic's name.
285
+ @kwarg name: Overriding C{B{name}=NN} (C{str}) or C{None} to
286
+ exclude this conic's name.
287
287
 
288
288
  @return: Conic attributes (C{str}).
289
289
  '''
290
- a = [name, prec, _lat0_, _lon0_, _par1_, _par2_,
291
- _E0_, _N0_, _k0_, _SP_]
290
+ a = [_lat0_, _lon0_, _par1_, _par2_, _E0_, _N0_, _k0_, _SP_]
292
291
  if self._SP == 1:
293
292
  _ = a.pop(a.index(_par2_))
294
- return self._instr(datum=self.datum, *a)
293
+ return self._instr(datum=self.datum, prec=prec, *a, **name)
295
294
 
296
295
  def _dup2(self, c):
297
296
  '''(INTERNAL) Copy this conic to C{c}.
@@ -537,22 +536,21 @@ class Lcc(_NamedBase):
537
536
  def toLatLon(self, LatLon=None, datum=None, height=None, **LatLon_kwds):
538
537
  '''Convert this L{Lcc} to an (ellipsoidal) geodetic point.
539
538
 
540
- @kwarg LatLon: Optional, ellipsoidal class to return the
541
- geodetic point (C{LatLon}) or C{None}.
542
- @kwarg datum: Optional datum to use, otherwise use this
543
- B{C{Lcc}}'s conic.datum (L{Datum}, L{Ellipsoid},
544
- L{Ellipsoid2} or L{a_f2Tuple}).
545
- @kwarg height: Optional height for the point, overriding
546
- the default height (C{meter}).
547
- @kwarg LatLon_kwds: Optional, additional B{C{LatLon}} keyword
548
- arguments, ignored if C{B{LatLon} is None}.
539
+ @kwarg LatLon: Optional, ellipsoidal class to return the geodetic
540
+ point (C{LatLon}) or C{None}.
541
+ @kwarg datum: Optional datum to use, otherwise use this B{C{Lcc}}'s
542
+ conic.datum (L{Datum}, L{Ellipsoid}, L{Ellipsoid2} or
543
+ L{a_f2Tuple}).
544
+ @kwarg height: Optional height for the point, overriding the default height
545
+ (C{meter}).
546
+ @kwarg LatLon_kwds: Optional, additional B{C{LatLon}} keyword arguments,
547
+ ignored if C{B{LatLon} is None}.
549
548
 
550
- @return: The point (B{C{LatLon}}) or a
551
- L{LatLon4Tuple}C{(lat, lon, height, datum)}
552
- if B{C{LatLon}} is C{None}.
549
+ @return: The point (B{C{LatLon}}) or if C{B{LatLon} is None}, a
550
+ L{LatLon4Tuple}C{(lat, lon, height, datum)}.
553
551
 
554
- @raise TypeError: If B{C{LatLon}} or B{C{datum}} is
555
- not ellipsoidal or not valid.
552
+ @raise TypeError: If B{C{LatLon}} or B{C{datum}} is not ellipsoidal or
553
+ not valid.
556
554
  '''
557
555
  if LatLon:
558
556
  _xsubclassof(_LLEB, LatLon=LatLon)
@@ -622,13 +620,12 @@ def toLcc(latlon, conic=Conics.WRF_Lb, height=None, Lcc=Lcc,
622
620
  @kwarg height: Optional height for the point, overriding the
623
621
  default height (C{meter}).
624
622
  @kwarg Lcc: Class to return the I{Lambert} location (L{Lcc}).
625
- @kwarg name_Lcc_kwds: Optional C{B{name}=NN} (C{str}) for the
626
- location and optional, additional B{C{Lcc}} keyword
627
- arguments, ignored if B{C{Lcc}} is C{None}.
623
+ @kwarg name_Lcc_kwds: Optional C{B{name}=NN} (C{str}) and optional,
624
+ additional B{C{Lcc}} keyword arguments, ignored if
625
+ B{C{Lcc} is None}.
628
626
 
629
- @return: The I{Lambert} location (L{Lcc}) or an
630
- L{EasNor3Tuple}C{(easting, northing, height)} if
631
- C{B{Lcc} is None}.
627
+ @return: The I{Lambert} location (L{Lcc}) or if C{B{Lcc} is None},
628
+ an L{EasNor3Tuple}C{(easting, northing, height)}.
632
629
 
633
630
  @raise TypeError: If B{C{latlon}} is not ellipsoidal.
634
631
  '''
pygeodesy/ltp.py CHANGED
@@ -44,7 +44,7 @@ from pygeodesy.vector3d import _ALL_LAZY, Vector3d
44
44
  # from math import fabs, floor as _floor # from .fmath, .fsums
45
45
 
46
46
  __all__ = _ALL_LAZY.ltp
47
- __version__ = '24.06.07'
47
+ __version__ = '24.06.11'
48
48
 
49
49
  _height0_ = _height_ + _0_
50
50
  _narrow_ = 'narrow'
@@ -154,7 +154,7 @@ class Attitude(_NamedBase):
154
154
  additional B{C{Vector}} keyword arguments, ignored if
155
155
  C{B{Vector} is None}.
156
156
 
157
- @return: A named B{C{Vector}} instance or if B{C{Vector}} is C{None},
157
+ @return: A named B{C{Vector}} instance or if C{B{Vector} is None},
158
158
  a named L{Vector3Tuple}C{(x, y, z)}.
159
159
 
160
160
  @raise AttitudeError: Invalid B{C{x_xyz}}, B{C{y}} or B{C{z}}.
@@ -419,13 +419,12 @@ class LocalCartesian(_NamedBase):
419
419
  @kwarg latlonh0: The (geodetic) origin (C{LatLon}, L{LatLon4Tuple}, L{Ltp}
420
420
  L{LocalCartesian} or L{Ecef9Tuple}) or the C{scalar}
421
421
  latitude of the (goedetic) origin (C{degrees}).
422
- @kwarg lon0: Longitude of the (goedetic) origin (C{degrees}) for C{scalar}
423
- B{C{latlonh0}}, ignored otherwise.
422
+ @kwarg lon0: Longitude of the (goedetic) origin (C{degrees}), required if
423
+ B{C{latlonh0}} is C{scalar}, ignored otherwise.
424
424
  @kwarg height0: Optional height (C{meter}, conventionally) at the (goedetic)
425
425
  origin perpendicular to and above (or below) the ellipsoid's
426
- surface and for C{scalar} B{C{latlonh0}}, ignored otherwise.
427
- @kwarg ecef: An ECEF converter (L{EcefKarney} I{only}) for C{scalar}
428
- B{C{latlonh0}}, ignored otherwise.
426
+ surface, like B{C{lon0}}.
427
+ @kwarg ecef: An ECEF converter (L{EcefKarney} I{only}), like B{C{lon0}}.
429
428
  @kwarg lon00_name: Optional C{B{name}=NN} (C{str}) and keyword argument
430
429
  C{B{lon00}=B{lon0}} for the arbitrary I{polar} longitude
431
430
  (C{degrees}), see method C{reverse} and property C{lon00}
@@ -1104,7 +1103,7 @@ def tyr3d(tilt=INT0, yaw=INT0, roll=INT0, Vector=Vector3d, **name_Vector_kwds):
1104
1103
  additional B{C{Vector}} keyword arguments, ignored if
1105
1104
  C{B{Vector} is None}.
1106
1105
 
1107
- @return: A named B{C{Vector}} instance or if B{C{Vector}} is C{None},
1106
+ @return: A named B{C{Vector}} instance or if C{B{Vector} is None},
1108
1107
  a named L{Vector3Tuple}C{(x, y, z)}.
1109
1108
 
1110
1109
  @raise AttitudeError: Invalid B{C{tilt}}, B{C{yaw}} or B{C{roll}}.
pygeodesy/ltpTuples.py CHANGED
@@ -11,11 +11,11 @@ L{ChLVYX2Tuple}, L{ChLVyx2Tuple} and L{Footprint5Tuple}.
11
11
  @see: References in module L{ltp}.
12
12
  '''
13
13
 
14
- # from pygeodesy.basics import issubclassof # from .units
14
+ # from pygeodesy.basics import issubclassof # _MODS
15
15
  from pygeodesy.constants import _0_0, _1_0, _90_0, _N_90_0
16
16
  # from pygeodesy.dms import F_D, toDMS # _MODS
17
- from pygeodesy.errors import _TypeError, _TypesError, _xattr, \
18
- _xkwds, _xkwds_item2
17
+ from pygeodesy.errors import _TypeError, _TypesError, _xattr, _xkwds, \
18
+ _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_, \
@@ -29,14 +29,14 @@ from pygeodesy.props import deprecated_method, deprecated_Property_RO, \
29
29
  Property_RO, property_RO
30
30
  from pygeodesy.streprs import Fmt, fstr, strs, _xzipairs
31
31
  from pygeodesy.units import Bearing, Degrees, Degrees_, Height, _isDegrees, \
32
- _isMeter, Lat, Lon, Meter, Meter_, issubclassof
32
+ _isMeter, Lat, Lon, Meter, Meter_
33
33
  from pygeodesy.utily import atan2d, atan2b, sincos2_, sincos2d_, cos, radians
34
34
  from pygeodesy.vector3d import Vector3d
35
35
 
36
36
  # from math import cos, radians # from .utily
37
37
 
38
38
  __all__ = _ALL_LAZY.ltpTuples
39
- __version__ = '24.06.08'
39
+ __version__ = '24.06.15'
40
40
 
41
41
  _aer_ = 'aer'
42
42
  _alt_ = 'alt'
@@ -126,12 +126,12 @@ class _AbcBase(_NamedBase):
126
126
  '''Get the I{local} I{Azimuth, Elevation, slant Range} (AER) components.
127
127
 
128
128
  @kwarg Aer: Class to return AER (L{Aer}) or 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}.
129
+ @kwarg name_Aer_kwds: Optional C{B{name}=NN} (C{str}) and optional,
130
+ additional B{L{Aer}} keyword arguments, ignored if
131
+ C{B{Aer} is None}.
132
132
 
133
- @return: AER as an L{Aer} instance or if C{B{Aer} is None},
134
- an L{Aer4Tuple}C{(azimuth, elevation, slantrange, ltp)}.
133
+ @return: AER as an L{Aer} instance or if C{B{Aer} is None}, an
134
+ L{Aer4Tuple}C{(azimuth, elevation, slantrange, ltp)}.
135
135
 
136
136
  @raise TypeError: Invalid B{C{Aer}} or B{C{name_Aer_kwds}}.
137
137
  '''
@@ -141,12 +141,12 @@ class _AbcBase(_NamedBase):
141
141
  '''Get the I{local} I{East, North, Up} (ENU) components.
142
142
 
143
143
  @kwarg Enu: Class to return ENU (L{Enu}) or C{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}.
144
+ @kwarg name_Enu_kwds: Optional C{B{name}=NN} (C{str}) and optional,
145
+ additional B{L{Enu}} keyword arguments, ignored if
146
+ C{B{Enu} is None}.
147
147
 
148
- @return: ENU as an L{Enu} instance or if C{B{Enu} is None},
149
- an L{Enu4Tuple}C{(east, north, up, ltp)}.
148
+ @return: ENU as an L{Enu} instance or if C{B{Enu} is None}, an
149
+ L{Enu4Tuple}C{(east, north, up, ltp)}.
150
150
 
151
151
  @raise TypeError: Invalid B{C{Enu}} or B{C{name_Enu_kwds}}.
152
152
  '''
@@ -156,12 +156,12 @@ class _AbcBase(_NamedBase):
156
156
  '''Get the I{local} I{North, East, Down} (NED) components.
157
157
 
158
158
  @kwarg Ned: Class to return NED (L{Ned}) or 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}.
159
+ @kwarg name_Ned_kwds: Optional C{B{name}=NN} (C{str}) and optional,
160
+ additional B{L{Ned}} keyword arguments, ignored if
161
+ C{B{Ned} is None}.
162
162
 
163
- @return: NED as an L{Ned} instance or if C{B{Ned} is None},
164
- an L{Ned4Tuple}C{(north, east, down, ltp)}.
163
+ @return: NED as an L{Ned} instance or if C{B{Ned} is None}, an
164
+ L{Ned4Tuple}C{(north, east, down, ltp)}.
165
165
 
166
166
  @raise TypeError: Invalid B{C{Ned}} or B{C{name_Ned_kwds}}.
167
167
  '''
@@ -170,14 +170,14 @@ class _AbcBase(_NamedBase):
170
170
  def toXyz(self, Xyz=None, **name_Xyz_kwds):
171
171
  '''Get the local I{X, Y, Z} (XYZ) components.
172
172
 
173
- @kwarg Xyz: Class to return XYZ (L{XyzLocal}, L{Enu},
174
- L{Ned}, L{Aer}) or C{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}.
173
+ @kwarg Xyz: Class to return XYZ (L{XyzLocal}, L{Enu}, L{Ned}, L{Aer})
174
+ or C{None}.
175
+ @kwarg name_Xyz_kwds: Optional C{B{name}=NN} (C{str}) and optional,
176
+ additional B{C{Xyz}} keyword arguments, ignored if
177
+ C{B{Xyz} is None}.
178
178
 
179
- @return: XYZ as an B{C{Xyz}} instance or if C{B{Xyz} is None},
180
- an L{Xyz4Tuple}C{(x, y, z, ltp)}.
179
+ @return: XYZ as an B{C{Xyz}} instance or if C{B{Xyz} is None}, an
180
+ L{Xyz4Tuple}C{(x, y, z, ltp)}.
181
181
 
182
182
  @raise TypeError: Invalid B{C{Xyz}} or B{C{name_Xyz_kwds}}.
183
183
  '''
@@ -209,7 +209,7 @@ class _Abc4Tuple(_NamedTuple):
209
209
  '''(INTERNAL) Convert 4-Tuple to C{Cls} instance.
210
210
  '''
211
211
  kwds = _name1__(Cls_kwds, _or_nameof=self)
212
- _is = issubclassof
212
+ _is = _MODS.basics.issubclassof
213
213
  if Cls is None:
214
214
  n, _ = _name2__(Cls_kwds)
215
215
  r = self.copy(name=n) if n else self
@@ -824,18 +824,17 @@ class XyzLocal(_Vector3d):
824
824
 
825
825
  @kwarg Cartesian: Optional class to return C{(x, y, z)} (C{Cartesian})
826
826
  or C{None}.
827
- @kwarg ltp: Optional I{local tangent plane} (LTP) (L{Ltp}),
828
- overriding this C{ltp}.
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}.
827
+ @kwarg ltp: Optional I{local tangent plane} (LTP) (L{Ltp}), overriding
828
+ this C{ltp}.
829
+ @kwarg name_Cartesian_kwds: Optional C{B{name}=NN} (C{str}) and optional,
830
+ additional B{C{Cartesian}} keyword arguments, ignored if
831
+ C{B{Cartesian} is None}.
832
832
 
833
833
  @return: A B{C{Cartesian}} instance of if C{B{Cartesian} is None}, an
834
- L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)}
835
- with C{M=None}, always.
834
+ L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)} with
835
+ C{M=None}, always.
836
836
 
837
- @raise TypeError: Invalid B{C{ltp}}, B{C{Cartesian}} or
838
- B{C{name_Cartesian_kwds}}.
837
+ @raise TypeError: Invalid B{C{ltp}}, B{C{Cartesian}} or B{C{name_Cartesian_kwds}}.
839
838
  '''
840
839
  ltp, kwds, n = self._ltp_kwds_name3(ltp, name_Cartesian_kwds)
841
840
  if Cartesian is None:
@@ -851,12 +850,12 @@ class XyzLocal(_Vector3d):
851
850
  '''Get the local I{East, North, Up} (ENU) components.
852
851
 
853
852
  @kwarg Enu: Class to return ENU (L{Enu}) or C{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}.
853
+ @kwarg name_Enu_kwds: Optional C{B{name}=NN} (C{str}) and optional,
854
+ additional B{C{Enu}} keyword arguments, ignored if
855
+ C{B{Enu} is None}.
857
856
 
858
- @return: ENU as an L{Enu} instance or if C{B{Enu} is None},
859
- an L{Enu4Tuple}C{(east, north, up, ltp)}.
857
+ @return: ENU as an L{Enu} instance or if C{B{Enu} is None}, an
858
+ L{Enu4Tuple}C{(east, north, up, ltp)}.
860
859
 
861
860
  @raise TypeError: Invalid B{C{Enu}} or B{C{name_Enu_kwds}}.
862
861
  '''
@@ -865,20 +864,19 @@ class XyzLocal(_Vector3d):
865
864
  def toLatLon(self, LatLon=None, ltp=None, **name_LatLon_kwds):
866
865
  '''Get the geodetic C{(lat, lon, height)} coordinates if this local.
867
866
 
868
- @kwarg LatLon: Optional class to return C{(x, y, z)} (C{LatLon})
869
- or C{None}.
870
- @kwarg ltp: Optional I{local tangent plane} (LTP) (L{Ltp}),
871
- overriding this ENU/NED/AER/XYZ's LTP.
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}.
867
+ @kwarg LatLon: Optional class to return C{(x, y, z)} (C{LatLon}) or
868
+ C{None}.
869
+ @kwarg ltp: Optional I{local tangent plane} (LTP) (L{Ltp}), overriding
870
+ this ENU/NED/AER/XYZ's LTP.
871
+ @kwarg name_LatLon_kwds: Optional C{B{name}=NN} (C{str}) and optional,
872
+ additional B{C{LatLon}} keyword arguments, ignored if
873
+ C{B{LatLon} is None}.
875
874
 
876
875
  @return: An B{C{LatLon}} instance of if C{B{LatLon} is None}, an
877
- L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M,
878
- datum)} with C{M=None}, always.
876
+ L{Ecef9Tuple}C{(x, y, z, lat, lon, height, C, M, datum)} with
877
+ C{M=None}, always.
879
878
 
880
- @raise TypeError: Invalid B{C{ltp}}, B{C{LatLon}} or
881
- B{C{name_LatLon_kwds}}.
879
+ @raise TypeError: Invalid B{C{LatLon}}, B{C{ltp}} or B{C{name_LatLon_kwds}}.
882
880
  '''
883
881
  ltp, kwds, n = self._ltp_kwds_name3(ltp, name_LatLon_kwds)
884
882
  t = ltp._local2ecef(self, nine=True)
@@ -895,9 +893,9 @@ class XyzLocal(_Vector3d):
895
893
  @kwarg M: Optionally include the rotation matrix (C{bool}).
896
894
  @kwarg name: Optional C{B{name}=NN} (C{str}).
897
895
 
898
- @return: L{Local9Tuple}C{(x, y, z, lat, lon, height, ltp,
899
- ecef, M)} with C{ltp} this C{Ltp}, C{ecef} an
900
- L{Ecef9Tuple} and C{M} L{EcefMatrix} or C{None}.
896
+ @return: L{Local9Tuple}C{(x, y, z, lat, lon, height, ltp, ecef, M)}
897
+ with C{ltp} this C{Ltp}, C{ecef} an L{Ecef9Tuple} and C{M}
898
+ an L{EcefMatrix} or C{None}.
901
899
  '''
902
900
  ltp = self.ltp # see C{self.toLatLon}
903
901
  t = ltp._local2ecef(self, nine=True, M=M)
@@ -909,12 +907,12 @@ class XyzLocal(_Vector3d):
909
907
  '''Get the local I{North, East, Down} (Ned) components.
910
908
 
911
909
  @kwarg Ned: Class to return NED (L{Ned}) or C{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}.
910
+ @kwarg name_Ned_kwds: Optional C{B{name}=NN} (C{str}) and optional,
911
+ additional B{C{Ned}} keyword arguments, ignored if
912
+ C{B{Ned} is None}.
915
913
 
916
- @return: NED as an L{Ned} instance or if C{B{Ned} is None},
917
- an L{Ned4Tuple}C{(north, east, down, ltp)}.
914
+ @return: NED as an L{Ned} instance or if C{B{Ned} is None}, an
915
+ L{Ned4Tuple}C{(north, east, down, ltp)}.
918
916
 
919
917
  @raise TypeError: Invalid B{C{Ned}} or B{C{name_Ned_kwds}}.
920
918
  '''
@@ -923,14 +921,14 @@ class XyzLocal(_Vector3d):
923
921
  def toXyz(self, Xyz=None, **name_Xyz_kwds):
924
922
  '''Get the local I{X, Y, Z} (XYZ) components.
925
923
 
926
- @kwarg Xyz: Class to return XYZ (L{XyzLocal}, L{Enu},
927
- L{Ned}, L{Aer}) or C{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}.
924
+ @kwarg Xyz: Class to return XYZ (L{XyzLocal}, L{Enu}, L{Ned}, L{Aer})
925
+ or C{None}.
926
+ @kwarg name_Xyz_kwds: Optional C{B{name}=NN} (C{str}) and optional,
927
+ additional B{C{Xyz}} keyword arguments, ignored if
928
+ C{B{Xyz} is None}.
931
929
 
932
- @return: XYZ as an B{C{Xyz}} instance or if C{B{Xyz} is None},
933
- an L{Xyz4Tuple}C{(x, y, z, ltp)}.
930
+ @return: XYZ as an B{C{Xyz}} instance or if C{B{Xyz} is None}, an
931
+ L{Xyz4Tuple}C{(x, y, z, ltp)}.
934
932
 
935
933
  @raise TypeError: Invalid B{C{Xyz}} or B{C{name_EXyz_kwds}}.
936
934
  '''
@@ -1183,7 +1181,7 @@ class Local9Tuple(_NamedTuple):
1183
1181
  @kwarg Aer: Class to return AER (L{Aer}) or C{None}.
1184
1182
  @kwarg name_Aer_kwds: Optional C{B{name}=NN} (C{str}) and optional,
1185
1183
  additional B{L{Aer}} keyword arguments, ignored if
1186
- B{C{Aer}} is C{None}.
1184
+ C{B{Aer} is None}.
1187
1185
 
1188
1186
  @return: AER as an L{Aer} instance or if C{B{Aer} is None}, an
1189
1187
  L{Aer4Tuple}C{(azimuth, elevation, slantrange, ltp)}.
@@ -1247,7 +1245,7 @@ class Local9Tuple(_NamedTuple):
1247
1245
  @kwarg Ned: Class to return NED (L{Ned}) or C{None}.
1248
1246
  @kwarg name_Ned_kwds: Optional C{B{name}=NN} (C{str}) and optional,
1249
1247
  additional B{L{Ned}} keyword arguments, ignored if
1250
- B{C{Ned}} is C{None}.
1248
+ C{B{Ned} is None}.
1251
1249
 
1252
1250
  @return: NED as an L{Ned} instance or if C{B{Ned} is None}, an
1253
1251
  L{Ned4Tuple}C{(north, east, down, ltp)}.
pygeodesy/mgrs.py CHANGED
@@ -55,7 +55,7 @@ from pygeodesy.utm import toUtm8, _to3zBlat, Utm, _UTM_ZONE_MAX, _UTM_ZONE_MIN
55
55
  # from pygeodesy.utmupsBase import _UTM_ZONE_MAX, _UTM_ZONE_MIN # from .utm
56
56
 
57
57
  __all__ = _ALL_LAZY.mgrs
58
- __version__ = '24.06.04'
58
+ __version__ = '24.06.11'
59
59
 
60
60
  _AN_ = 'AN' # default south pole grid tile and band B
61
61
  _AtoPx_ = _AtoZnoIO_.tillP
@@ -596,18 +596,17 @@ def toMgrs(utmups, Mgrs=Mgrs, **name_Mgrs_kwds):
596
596
  @arg utmups: A UTM or UPS coordinate (L{Utm}, L{Etm} or L{Ups}).
597
597
  @kwarg Mgrs: Optional class to return the MGRS grid reference
598
598
  (L{Mgrs}) or C{None}.
599
- @kwarg name_Mgrs_kwds: Optional C{B{name}=NN} (C{str}) and
600
- optional, additional B{C{Mgrs}} keyword arguments,
601
- ignored if C{B{Mgrs} is None}.
599
+ @kwarg name_Mgrs_kwds: Optional C{B{name}=NN} (C{str}) and optional,
600
+ additional B{C{Mgrs}} keyword arguments, ignored if
601
+ C{B{Mgrs} is None}.
602
602
 
603
- @return: The MGRS grid reference as B{C{Mgrs}} or if C{B{Mgrs}
604
- is None} as an L{Mgrs6Tuple}C{(zone, EN, easting,
605
- northing, band, datum)}.
603
+ @return: The MGRS grid reference as B{C{Mgrs}} or if C{B{Mgrs} is
604
+ None} as an L{Mgrs6Tuple}C{(zone, EN, easting, northing,
605
+ band, datum)}.
606
606
 
607
607
  @raise MGRSError: Invalid B{C{utmups}}.
608
608
 
609
- @raise TypeError: If B{C{utmups}} is not L{Utm} nor L{Etm}
610
- nor L{Ups}.
609
+ @raise TypeError: If B{C{utmups}} is not L{Utm}, L{Etm} nor L{Ups}.
611
610
  '''
612
611
  # _MODS.utmups.utmupsValidate(utmups, MGRS=True, Error-MGRSError)
613
612
  _xinstanceof(Utm, Ups, utmups=utmups) # Utm, Etm, Ups
pygeodesy/named.py CHANGED
@@ -34,7 +34,7 @@ from pygeodesy.streprs import attrs, Fmt, lrstrip, pairs, reprs, unstr
34
34
  # from pygeodesy.units import _toUnit # _MODS
35
35
 
36
36
  __all__ = _ALL_LAZY.named
37
- __version__ = '24.06.10'
37
+ __version__ = '24.06.24'
38
38
 
39
39
  _COMMANL_ = _COMMA_ + _NL_
40
40
  _COMMASPACEDOT_ = _COMMASPACE_ + _DOT_
@@ -72,6 +72,15 @@ class ADict(dict):
72
72
  '''
73
73
  return self.toRepr()
74
74
 
75
+ def __setattr__(self, name, value):
76
+ '''Set the value of a I{known} item by B{C{name}}.
77
+ '''
78
+ try:
79
+ if self[name] != value:
80
+ self[name] = value
81
+ except KeyError:
82
+ dict.__setattr__(self, name, value)
83
+
75
84
  def __str__(self):
76
85
  '''Default C{str(self)}.
77
86
  '''
@@ -241,15 +250,16 @@ class _Named(object):
241
250
  # _update_all(d)
242
251
  return d
243
252
 
244
- def _instr(self, name, prec, *attrs, **fmt_props_kwds):
245
- '''(INTERNAL) Format, used by C{Conic}, C{Ellipsoid}, C{Transform}, C{Triaxial}.
253
+ def _instr(self, *attrs, **fmt_prec_props_sep_name__kwds):
254
+ '''(INTERNAL) Format, used by C{Conic}, C{Ellipsoid}, C{Geodesic...}, C{Transform}, C{Triaxial}.
246
255
  '''
247
- def _fmt_props_kwds(fmt=Fmt.F, props=(), **kwds):
248
- return fmt, props, kwds
256
+ def _fmt_prec_props_kwds(fmt=Fmt.F, prec=6, props=(), sep=_COMMASPACE_, **kwds):
257
+ return fmt, prec, props, sep, kwds
249
258
 
250
- fmt, props, kwds = _fmt_props_kwds(**fmt_props_kwds)
259
+ name, kwds = _name2__(**fmt_prec_props_sep_name__kwds)
260
+ fmt, prec, props, sep, kwds = _fmt_prec_props_kwds(**kwds)
251
261
 
252
- t = () if name is None else (Fmt.EQUAL(name=repr(self._name__(name))),)
262
+ t = () if name is None else (Fmt.EQUAL(name=repr(name or self.name)),)
253
263
  if attrs:
254
264
  t += pairs(((a, getattr(self, a)) for a in attrs),
255
265
  prec=prec, ints=True, fmt=fmt)
@@ -258,7 +268,7 @@ class _Named(object):
258
268
  prec=prec, ints=True)
259
269
  if kwds:
260
270
  t += pairs(kwds, prec=prec)
261
- return _COMMASPACE_.join(t)
271
+ return sep.join(t) if sep else t
262
272
 
263
273
  @property_RO
264
274
  def iteration(self): # see .karney.GDict
@@ -1090,8 +1100,7 @@ class _NamedTuple(tuple, _Named):
1090
1100
  '''Yield the items, each as a C{2-tuple (name, value}) with the
1091
1101
  value wrapped as an instance of its L{units} class.
1092
1102
 
1093
- @kwarg Error: Optional C{B{Error}=UnitError} to raise for
1094
- L{units} issues.
1103
+ @kwarg Error: Optional C{B{Error}=UnitError} to raise.
1095
1104
 
1096
1105
  @raise Error: Invalid C{Named-Tuple} item or L{units} class.
1097
1106
 
pygeodesy/nvectorBase.py CHANGED
@@ -14,7 +14,7 @@ and published under the same MIT Licence**, see U{Vector-based geodesy
14
14
  from pygeodesy.constants import EPS, EPS1, EPS_2, R_M, _2_0, _N_2_0
15
15
  # from pygeodesy.datums import _spherical_datum # from .formy
16
16
  from pygeodesy.errors import IntersectionError, _ValueError, VectorError, \
17
- _xkwds, _xkwds_pop2
17
+ _xattrs, _xkwds, _xkwds_pop2
18
18
  from pygeodesy.fmath import fdot, fidw, hypot_ # PYCHOK fdot shared
19
19
  from pygeodesy.fsums import Fsum, fsumf_
20
20
  from pygeodesy.formy import _isequalTo, n_xyz2latlon, n_xyz2philam, \
@@ -30,7 +30,7 @@ from pygeodesy.namedTuples import Trilaterate5Tuple, Vector3Tuple, \
30
30
  Vector4Tuple, map1
31
31
  from pygeodesy.props import deprecated_method, Property_RO, property_doc_, \
32
32
  property_RO, _update_all
33
- from pygeodesy.streprs import Fmt, hstr, unstr, _xattrs
33
+ from pygeodesy.streprs import Fmt, hstr, unstr
34
34
  from pygeodesy.units import Bearing, Height, Radius_, Scalar
35
35
  from pygeodesy.utily import sincos2d, _unrollon, _unrollon3
36
36
  from pygeodesy.vector3d import Vector3d, _xyzhdlln4
@@ -38,7 +38,7 @@ from pygeodesy.vector3d import Vector3d, _xyzhdlln4
38
38
  from math import fabs, sqrt
39
39
 
40
40
  __all__ = _ALL_LAZY.nvectorBase
41
- __version__ = '24.06.06'
41
+ __version__ = '24.06.12'
42
42
 
43
43
 
44
44
  class NvectorBase(Vector3d): # XXX kept private
@@ -53,10 +53,9 @@ class NvectorBase(Vector3d): # XXX kept private
53
53
 
54
54
  @arg x_xyz: X component of vector (C{scalar}) or (3-D) vector
55
55
  (C{Nvector}, L{Vector3d}, L{Vector3Tuple} or L{Vector4Tuple}).
56
- @kwarg y: Y component of vector (C{scalar}), ignored if B{C{x_xyz}} is not
57
- C{scalar}, otherwise same units as B{C{x_xyz}}.
58
- @kwarg z: Z component of vector (C{scalar}), ignored if B{C{x_xyz}} is not
59
- C{scalar}, otherwise same units as B{C{x_xyz}}.
56
+ @kwarg y: Y component of vector (C{scalar}), required if B{C{x_xyz}} is
57
+ C{scalar} and same units as B{C{x_xyz}}, ignored otherwise.
58
+ @kwarg z: Z component of vector (C{scalar}), like B{C{y}}.
60
59
  @kwarg h: Optional height above surface (C{meter}).
61
60
  @kwarg datum: Optional, I{pass-thru} datum (L{Datum}).
62
61
  @kwarg ll_name: Optional C{B{name}=NN} (C{str}) and optional, original
@@ -346,7 +345,7 @@ class NvectorBase(Vector3d): # XXX kept private
346
345
  def toVector3d(self, norm=True):
347
346
  '''Convert this n-vector to a 3-D vector, I{ignoring height}.
348
347
 
349
- @kwarg norm: Normalize the 3-D vector (C{bool}).
348
+ @kwarg norm: If C{True}, normalize the 3-D vector (C{bool}).
350
349
 
351
350
  @return: The (normalized) vector (L{Vector3d}).
352
351
  '''
@@ -366,7 +365,7 @@ class NvectorBase(Vector3d): # XXX kept private
366
365
 
367
366
  @return: Normalized vector (C{Nvector}).
368
367
  '''
369
- return _xattrs(Vector3d.unit(self, ll=ll), _under(_h_))
368
+ return _xattrs(Vector3d.unit(self, ll=ll), self, _under(_h_))
370
369
 
371
370
  @Property_RO
372
371
  def xyzh(self):
@@ -572,7 +571,7 @@ def sumOf(nvectors, Vector=None, h=None, **Vector_kwds):
572
571
  arguments, ignored if C{B{Vector} is None}.
573
572
 
574
573
  @return: Vectorial sum (B{C{Vector}}) or a L{Vector4Tuple}C{(x, y,
575
- z, h)} if B{C{Vector}} is C{None}.
574
+ z, h)} if C{B{Vector} is None}.
576
575
 
577
576
  @raise VectorError: No B{C{nvectors}}.
578
577
  '''
pygeodesy/osgr.py CHANGED
@@ -46,14 +46,14 @@ from pygeodesy.namedTuples import EasNor2Tuple, LatLon2Tuple, \
46
46
  from pygeodesy.props import Property_RO, property_RO
47
47
  from pygeodesy.streprs import _EN_WIDE, enstr2, _enstr2m3, Fmt, \
48
48
  _resolution10, unstr, _xzipairs
49
- from pygeodesy.units import Easting, Lam_, Lat, Lon, Northing, \
50
- Phi_, Scalar, _10um, _100km
49
+ from pygeodesy.units import Easting, Lamd, Lat, Lon, Northing, \
50
+ Phid, Scalar, _10um, _100km
51
51
  from pygeodesy.utily import degrees90, degrees180, sincostan3, truncate
52
52
 
53
53
  from math import cos, fabs, radians, sin, sqrt
54
54
 
55
55
  __all__ = _ALL_LAZY.osgr
56
- __version__ = '24.05.31'
56
+ __version__ = '24.06.15'
57
57
 
58
58
  _equivalent_ = 'equivalent'
59
59
  _OSGR_ = 'OSGR'
@@ -108,7 +108,7 @@ class _NG(object):
108
108
 
109
109
  @Property_RO
110
110
  def lam0(self): # True origin longitude C{radians}
111
- return Lam_(self.lon0)
111
+ return Lamd(self.lon0)
112
112
 
113
113
  @Property_RO
114
114
  def lat0(self): # True origin latitude, 49°N
@@ -160,7 +160,7 @@ class _NG(object):
160
160
 
161
161
  @Property_RO
162
162
  def phi0(self): # True origin latitude C{radians}
163
- return Phi_(self.lat0)
163
+ return Phid(self.lat0)
164
164
 
165
165
  def reverse(self, osgr): # convert C{osgr} to (ellipsoidal} LatLon, as I{Karney}'s
166
166
  # U{Reverse<https://GeographicLib.SourceForge.io/C++/doc/OSGB_8hpp_source.html>}
@@ -296,7 +296,7 @@ class Osgr(_NamedBase):
296
296
  @kwarg LatLon_kwds: Optional, additional B{C{LatLon}} keyword
297
297
  arguments, ignored if C{B{LatLon} is None}.
298
298
 
299
- @return: A B{C{LatLon}} instance or if B{C{LatLon}} is C{None}
299
+ @return: A B{C{LatLon}} instance or if C{B{LatLon} is None}
300
300
  a L{LatLonDatum3Tuple}C{(lat, lon, datum)}.
301
301
 
302
302
  @note: While OS grid references are based on the OSGB36 datum,
@@ -520,8 +520,8 @@ def parseOSGR(strOSGR, Osgr=Osgr, **name_Osgr_kwds):
520
520
  optional, additional B{C{Osgr}} keyword arguments,
521
521
  ignored if C{B{Osgr} is None}.
522
522
 
523
- @return: An (B{C{Osgr}}) instance or if B{C{Osgr}} is
524
- C{None} an L{EasNor2Tuple}C{(easting, northing)}.
523
+ @return: An (B{C{Osgr}}) instance or if C{B{Osgr} is None}, an
524
+ L{EasNor2Tuple}C{(easting, northing)}.
525
525
 
526
526
  @raise OSGRError: Invalid B{C{strOSGR}}.
527
527
  '''
@@ -598,7 +598,7 @@ def toOsgr(latlon, lon=None, kTM=False, datum=_WGS84, Osgr=Osgr, # MCCABE 14
598
598
  and additional B{C{Osgr}} keyword arguments,
599
599
  ignored if C{B{Osgr} is None}.
600
600
 
601
- @return: An (B{C{Osgr}}) instance or if B{C{Osgr}} is C{None}
601
+ @return: An (B{C{Osgr}}) instance or if C{B{Osgr} is None}
602
602
  an L{EasNor2Tuple}C{(easting, northing)}.
603
603
 
604
604
  @note: If L{isint}C{(B{prec})} both easting and northing are