pygeodesy 24.6.9__py2.py3-none-any.whl → 24.7.7__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 (87) hide show
  1. {PyGeodesy-24.6.9.dist-info → PyGeodesy-24.7.7.dist-info}/METADATA +2 -2
  2. PyGeodesy-24.7.7.dist-info/RECORD +117 -0
  3. pygeodesy/__init__.py +39 -32
  4. pygeodesy/__main__.py +6 -1
  5. pygeodesy/albers.py +2 -2
  6. pygeodesy/auxilats/__init__.py +1 -1
  7. pygeodesy/auxilats/auxAngle.py +40 -39
  8. pygeodesy/auxilats/auxDLat.py +3 -2
  9. pygeodesy/auxilats/auxLat.py +16 -18
  10. pygeodesy/auxilats/auxily.py +1 -1
  11. pygeodesy/azimuthal.py +10 -10
  12. pygeodesy/basics.py +16 -4
  13. pygeodesy/booleans.py +4 -4
  14. pygeodesy/cartesianBase.py +11 -14
  15. pygeodesy/css.py +14 -18
  16. pygeodesy/datums.py +6 -6
  17. pygeodesy/deprecated/__init__.py +1 -1
  18. pygeodesy/deprecated/classes.py +25 -4
  19. pygeodesy/deprecated/datum.py +3 -3
  20. pygeodesy/deprecated/functions.py +6 -8
  21. pygeodesy/dms.py +23 -27
  22. pygeodesy/ecef.py +4 -4
  23. pygeodesy/elevations.py +4 -4
  24. pygeodesy/ellipsoidalBase.py +23 -28
  25. pygeodesy/ellipsoidalBaseDI.py +19 -23
  26. pygeodesy/ellipsoidalExact.py +3 -3
  27. pygeodesy/ellipsoidalGeodSolve.py +15 -23
  28. pygeodesy/ellipsoidalKarney.py +37 -60
  29. pygeodesy/ellipsoidalNvector.py +38 -44
  30. pygeodesy/ellipsoidalVincenty.py +11 -14
  31. pygeodesy/ellipsoids.py +107 -101
  32. pygeodesy/errors.py +109 -48
  33. pygeodesy/etm.py +32 -44
  34. pygeodesy/formy.py +55 -58
  35. pygeodesy/frechet.py +18 -20
  36. pygeodesy/fsums.py +3 -3
  37. pygeodesy/gars.py +3 -4
  38. pygeodesy/geodesici.py +1696 -0
  39. pygeodesy/geodesicw.py +15 -15
  40. pygeodesy/geodesicx/__init__.py +4 -4
  41. pygeodesy/geodesicx/gx.py +34 -55
  42. pygeodesy/geodesicx/gxbases.py +20 -8
  43. pygeodesy/geodesicx/gxline.py +93 -88
  44. pygeodesy/geodsolve.py +108 -59
  45. pygeodesy/geohash.py +26 -34
  46. pygeodesy/geoids.py +28 -37
  47. pygeodesy/hausdorff.py +17 -18
  48. pygeodesy/heights.py +2 -2
  49. pygeodesy/internals.py +46 -13
  50. pygeodesy/interns.py +2 -2
  51. pygeodesy/karney.py +78 -15
  52. pygeodesy/ktm.py +13 -16
  53. pygeodesy/latlonBase.py +17 -19
  54. pygeodesy/lazily.py +28 -25
  55. pygeodesy/lcc.py +28 -31
  56. pygeodesy/ltp.py +7 -8
  57. pygeodesy/ltpTuples.py +71 -73
  58. pygeodesy/mgrs.py +8 -9
  59. pygeodesy/named.py +19 -10
  60. pygeodesy/nvectorBase.py +9 -10
  61. pygeodesy/osgr.py +9 -9
  62. pygeodesy/points.py +6 -6
  63. pygeodesy/rhumb/__init__.py +1 -1
  64. pygeodesy/rhumb/aux_.py +5 -5
  65. pygeodesy/rhumb/bases.py +30 -31
  66. pygeodesy/rhumb/ekx.py +3 -4
  67. pygeodesy/rhumb/solve.py +21 -22
  68. pygeodesy/solveBase.py +177 -123
  69. pygeodesy/sphericalBase.py +10 -11
  70. pygeodesy/sphericalNvector.py +13 -13
  71. pygeodesy/sphericalTrigonometry.py +86 -97
  72. pygeodesy/streprs.py +4 -34
  73. pygeodesy/triaxials.py +48 -43
  74. pygeodesy/units.py +208 -275
  75. pygeodesy/unitsBase.py +115 -107
  76. pygeodesy/ups.py +26 -31
  77. pygeodesy/utily.py +8 -8
  78. pygeodesy/utm.py +35 -40
  79. pygeodesy/utmups.py +43 -46
  80. pygeodesy/utmupsBase.py +8 -9
  81. pygeodesy/vector3d.py +26 -27
  82. pygeodesy/vector3dBase.py +6 -7
  83. pygeodesy/webmercator.py +19 -21
  84. pygeodesy/wgrs.py +18 -20
  85. PyGeodesy-24.6.9.dist-info/RECORD +0 -116
  86. {PyGeodesy-24.6.9.dist-info → PyGeodesy-24.7.7.dist-info}/WHEEL +0 -0
  87. {PyGeodesy-24.6.9.dist-info → PyGeodesy-24.7.7.dist-info}/top_level.txt +0 -0
pygeodesy/triaxials.py CHANGED
@@ -59,7 +59,7 @@ from pygeodesy.vector3d import _otherV3d, Vector3d, _ALL_LAZY, _MODS
59
59
  from math import atan2, fabs, sqrt
60
60
 
61
61
  __all__ = _ALL_LAZY.triaxials
62
- __version__ = '24.06.09'
62
+ __version__ = '24.06.24'
63
63
 
64
64
  _not_ordered_ = _not_('ordered')
65
65
  _omega_ = 'omega'
@@ -213,8 +213,7 @@ class Triaxial_(_NamedEnumItem):
213
213
  C{meter}) or an other L{Triaxial} or L{Triaxial_} instance.
214
214
  @kwarg b: Middle, C{Y} semi-axis (C{meter}, same units as B{C{a}}), required
215
215
  if C{B{a_triaxial} is scalar}, ignored otherwise.
216
- @kwarg c: Small, C{Z} semi-axis (C{meter}, same units as B{C{a}}), required
217
- if C{B{a_triaxial} is scalar}, ignored otherwise.
216
+ @kwarg c: Small, C{Z} semi-axis (C{meter}, B{C{b}}).
218
217
  @kwarg name: Optional C{B{name}=NN} (C{str}).
219
218
 
220
219
  @raise TriaxialError: Invalid semi-axis or -axes.
@@ -381,13 +380,14 @@ class Triaxial_(_NamedEnumItem):
381
380
 
382
381
  @arg x_xyz: X component (C{scalar}) or a cartesian (C{Cartesian}, L{Ecef9Tuple},
383
382
  L{Vector3d}, L{Vector3Tuple} or L{Vector4Tuple}).
384
- @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
385
- @kwarg z: Z component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
383
+ @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar}, ignored
384
+ otherwise.
385
+ @kwarg z: Z component (C{scalar}), like B{C{y}}.
386
386
  @kwarg normal: If C{True} the projection is the I{normal, plumb} to the surface of,
387
387
  otherwise the C{radial} line to the center of this triaxial (C{bool}).
388
388
  @kwarg eps: Tolerance for root finding and validation (C{scalar}), use a negative
389
389
  value to skip validation.
390
- @kwarg name: Optional, overriding C{B{name}="heigh4"} (C{str}).
390
+ @kwarg name: Optional C{B{name}="heigh4"} (C{str}).
391
391
 
392
392
  @return: L{Vector4Tuple}C{(x, y, z, h)} with the cartesian coordinates C{x}, C{y}
393
393
  and C{z} of the projection on or the intersection with and with the height
@@ -412,7 +412,7 @@ class Triaxial_(_NamedEnumItem):
412
412
  x, y, z = v.xyz
413
413
  try:
414
414
  if normal: # plumb to surface
415
- x, y, z, h, i = _normalTo5(x, y, z, self, eps=eps)
415
+ x, y, z, h, i = _plumbTo5(x, y, z, self, eps=eps)
416
416
  else: # radial to center
417
417
  x, y, z = self._radialTo3(z, hypot(x, y), y, x)
418
418
  h = v.minus_(x, y, z).length
@@ -420,8 +420,8 @@ class Triaxial_(_NamedEnumItem):
420
420
  raise TriaxialError(x=x, y=y, z=z, cause=e)
421
421
  if h > 0 and self.sideOf(v, eps=EPS0) < 0:
422
422
  h = -h # below the surface
423
- return Vector4Tuple(x, y, z, h, iteration=i,
424
- name=_name__(name, name__=self.height4))
423
+ n = _name__(name, name__=self.height4)
424
+ return Vector4Tuple(x, y, z, h, iteration=i, name=n)
425
425
 
426
426
  @Property_RO
427
427
  def isOrdered(self):
@@ -451,8 +451,9 @@ class Triaxial_(_NamedEnumItem):
451
451
 
452
452
  @arg x_xyz: X component (C{scalar}) or a cartesian (C{Cartesian},
453
453
  L{Ecef9Tuple}, L{Vector3d}, L{Vector3Tuple} or L{Vector4Tuple}).
454
- @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
455
- @kwarg z: Z component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
454
+ @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar}, ignored
455
+ otherwise.
456
+ @kwarg z: Z component (C{scalar}), like B{C{y}}.
456
457
  @kwarg length: Optional length and in-/outward direction (C{scalar}).
457
458
 
458
459
  @return: A C{Vector3d(x_, y_, z_)} normalized to B{C{length}}, pointing
@@ -499,7 +500,7 @@ class Triaxial_(_NamedEnumItem):
499
500
 
500
501
  @Property_RO
501
502
  def _ordered4(self):
502
- '''(INTERNAL) Helper for C{_hartzell3} and C{_normalTo5}.
503
+ '''(INTERNAL) Helper for C{_hartzell3} and C{_plumbTo5}.
503
504
  '''
504
505
  def _order2(reverse, a, b, c):
505
506
  '''(INTERNAL) Un-Order C{a}, C{b} and C{c}.
@@ -558,8 +559,9 @@ class Triaxial_(_NamedEnumItem):
558
559
 
559
560
  @arg x_xyz: X component (C{scalar}) or a cartesian (C{Cartesian},
560
561
  L{Ecef9Tuple}, L{Vector3d}, L{Vector3Tuple} or L{Vector4Tuple}).
561
- @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
562
- @kwarg z: Z component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
562
+ @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar},
563
+ ignored otherwise.
564
+ @kwarg z: Z component (C{scalar}), like B{C{y}}.
563
565
  @kwarg eps: Near-surface tolerance (C{scalar}, distance I{squared}).
564
566
 
565
567
  @return: C{INT0} if C{(B{x}, B{y}, B{z})} is near this triaxial's surface
@@ -593,7 +595,7 @@ class Triaxial_(_NamedEnumItem):
593
595
  raise TriaxialError(a=a, b=b, c=c, txt=t)
594
596
  return Ellipsoid(a, b=b, name=self._name__(name))
595
597
 
596
- def toStr(self, prec=9, name=NN, **unused): # PYCHOK signature
598
+ def toStr(self, prec=9, **name): # PYCHOK signature
597
599
  '''Return this C{Triaxial} as a string.
598
600
 
599
601
  @kwarg prec: Precision, number of decimal digits (0..9).
@@ -611,7 +613,7 @@ class Triaxial_(_NamedEnumItem):
611
613
  if isinstance(self, J):
612
614
  t += J.xyQ2,
613
615
  t += T.volume, T.area
614
- return self._instr(name, prec, props=t, area_p=self.area_p()) # __name__
616
+ return self._instr(area_p=self.area_p(), prec=prec, props=t, **name)
615
617
 
616
618
  @Property_RO
617
619
  def volume(self):
@@ -635,14 +637,13 @@ class Triaxial(Triaxial_):
635
637
  or an other L{Triaxial} or L{Triaxial_} instance.
636
638
  @kwarg b: Middle semi-axis (C{meter}, same units as B{C{a}}), required
637
639
  if C{B{a_triaxial} is scalar}, ignored otherwise.
638
- @kwarg c: Smallest semi-axis (C{meter}, same units as B{C{a}}), required
639
- if C{B{a_triaxial} is scalar}, ignored otherwise.
640
+ @kwarg c: Smallest semi-axis (C{meter}, like B{C{b}}).
640
641
  @kwarg name: Optional C{B{name}=NN} (C{str}).
641
642
 
642
643
  @note: The semi-axes must be ordered as C{B{a} >= B{b} >= B{c} > 0} and
643
644
  must be ellipsoidal, C{B{a} > B{c}}.
644
645
 
645
- @raise TriaxialError: Semi-axes not ordered, spherical or invalid.
646
+ @raise TriaxialError: Semi-axes unordered, spherical or invalid.
646
647
  '''
647
648
  Triaxial_.__init__(self, a_triaxial, b=b, c=c, **name)
648
649
 
@@ -740,8 +741,9 @@ class Triaxial(Triaxial_):
740
741
 
741
742
  @arg x_xyz: X component (C{scalar}) or a cartesian (C{Cartesian},
742
743
  L{Ecef9Tuple}, L{Vector3d}, L{Vector3Tuple} or L{Vector4Tuple}).
743
- @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
744
- @kwarg z: Z component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
744
+ @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar},
745
+ ignored otherwise.
746
+ @kwarg z: Z component (C{scalar}), like B{C{y}}.
745
747
  @kwarg normal_eps_name: Optional keyword arguments C{B{normal}=True},
746
748
  C{B{eps}=EPS} and overriding C{B{name}="height4"} (C{str}),
747
749
  see method L{Triaxial.height4}.
@@ -845,8 +847,9 @@ class Triaxial(Triaxial_):
845
847
 
846
848
  @arg x_xyz: X component (C{scalar}) or a cartesian (C{Cartesian},
847
849
  L{Ecef9Tuple}, L{Vector3d}, L{Vector3Tuple} or L{Vector4Tuple}).
848
- @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
849
- @kwarg z: Z component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
850
+ @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar},
851
+ ignored otherwise.
852
+ @kwarg z: Z component (C{scalar}), like B{C{y}}.
850
853
  @kwarg name: Optional C{B{name}=NN} (C{str}).
851
854
 
852
855
  @return: A L{BetaOmega3Tuple}C{(beta, omega, height)} with C{beta} and
@@ -866,8 +869,9 @@ class Triaxial(Triaxial_):
866
869
 
867
870
  @arg x_xyz: X component (C{scalar}) or a cartesian (C{Cartesian},
868
871
  L{Ecef9Tuple}, L{Vector3d}, L{Vector3Tuple} or L{Vector4Tuple}).
869
- @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
870
- @kwarg z: Z component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
872
+ @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar},
873
+ ignored otherwise.
874
+ @kwarg z: Z component (C{scalar}), like B{C{y}}.
871
875
  @arg h: Height above or below this triaxial's surface (C{meter}, same units
872
876
  as the axes).
873
877
  @kwarg normal: If C{True} the height is C{normal} to the surface, otherwise
@@ -899,8 +903,9 @@ class Triaxial(Triaxial_):
899
903
 
900
904
  @arg x_xyz: X component (C{scalar}) or a cartesian (C{Cartesian},
901
905
  L{Ecef9Tuple}, L{Vector3d}, L{Vector3Tuple} or L{Vector4Tuple}).
902
- @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
903
- @kwarg z: Z component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
906
+ @kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar},
907
+ ignored otherwise.
908
+ @kwarg z: Z component (C{scalar}), like B{C{y}}.
904
909
  @kwarg name: Optional C{B{name}=NN} (C{str}).
905
910
 
906
911
  @return: A L{LatLon3Tuple}C{(lat, lon, height)} with C{lat} and C{lon}
@@ -1192,7 +1197,7 @@ def _hartzell3(pov, los, Tun): # in .Ellipsoid.hartzell4, .formy.hartzell
1192
1197
 
1193
1198
  p3 = _otherV3d(pov=pov.toCartesian() if isLatLon(pov) else pov)
1194
1199
  if los is True: # normal
1195
- a, b, c, d, i = _normalTo5(p3.x, p3.y, p3.z, Tun)
1200
+ a, b, c, d, i = _plumbTo5(p3.x, p3.y, p3.z, Tun)
1196
1201
  return type(p3)(a, b, c), d, i
1197
1202
 
1198
1203
  u3 = p3.negate() if los is False or los is None else _toUvwV3d(los, pov)
@@ -1286,15 +1291,22 @@ def _hypot21(x, y, z=0):
1286
1291
  return fsumf_(_1_0, x**2, y**2, (z**2 if z else _0_0), _N_2_0)
1287
1292
 
1288
1293
 
1289
- def _normalTo4(x, y, a, b, eps=EPS):
1294
+ def _otherV3d_(x_xyz, y, z, **name):
1295
+ '''(INTERNAL) Get a Vector3d from C{x_xyz}, C{y} and C{z}.
1296
+ '''
1297
+ return Vector3d(x_xyz, y, z, **name) if isscalar(x_xyz) else \
1298
+ _otherV3d(x_xyz=x_xyz, **name)
1299
+
1300
+
1301
+ def _plumbTo4(x, y, a, b, eps=EPS):
1290
1302
  '''(INTERNAL) Nearest point on and distance to a 2-D ellipse, I{unordered}.
1291
1303
 
1292
- @see: Function C{pygeodesy.ellipsoids._normalTo3} and I{Eberly}'s U{Distance
1304
+ @see: Function C{pygeodesy.ellipsoids._plumbTo3} and I{Eberly}'s U{Distance
1293
1305
  from a Point to ... an Ellipse ...<https://www.GeometricTools.com/
1294
1306
  Documentation/DistancePointEllipseEllipsoid.pdf>}.
1295
1307
  '''
1296
1308
  if b > a:
1297
- b, a, d, i = _normalTo4(y, x, b, a, eps=eps)
1309
+ b, a, d, i = _plumbTo4(y, x, b, a, eps=eps)
1298
1310
  return a, b, d, i
1299
1311
 
1300
1312
  if not (b > 0 and isfinite(a)):
@@ -1339,7 +1351,7 @@ def _normalTo4(x, y, a, b, eps=EPS):
1339
1351
  return a, b, d, i
1340
1352
 
1341
1353
 
1342
- def _normalTo5(x, y, z, Tun, eps=EPS): # MCCABE 19
1354
+ def _plumbTo5(x, y, z, Tun, eps=EPS): # MCCABE 19 in .testTriaxials
1343
1355
  '''(INTERNAL) Nearest point on and distance to an I{un-/ordered} triaxial.
1344
1356
 
1345
1357
  @see: I{Eberly}'s U{Distance from a Point to ... an Ellipsoid ...<https://
@@ -1348,7 +1360,7 @@ def _normalTo5(x, y, z, Tun, eps=EPS): # MCCABE 19
1348
1360
  a, b, c, T = Tun._ordered4
1349
1361
  if Tun is not T: # T is ordered, Tun isn't
1350
1362
  t = T._order3(x, y, z) + (T,)
1351
- a, b, c, d, i = _normalTo5(*t, eps=eps)
1363
+ a, b, c, d, i = _plumbTo5(*t, eps=eps)
1352
1364
  return T._order3(a, b, c, reverse=True) + (d, i)
1353
1365
 
1354
1366
  if not (c > 0 and isfinite(a)):
@@ -1379,10 +1391,10 @@ def _normalTo5(x, y, z, Tun, eps=EPS): # MCCABE 19
1379
1391
  d = hypot_(x - a, y - b, z - c)
1380
1392
  else: # x == 0
1381
1393
  a = x # 0
1382
- b, c, d, i = _normalTo4(y, z, b, c, eps=eps)
1394
+ b, c, d, i = _plumbTo4(y, z, b, c, eps=eps)
1383
1395
  elif x: # y == 0
1384
1396
  b = y # 0
1385
- a, c, d, i = _normalTo4(x, z, a, c, eps=eps)
1397
+ a, c, d, i = _plumbTo4(x, z, a, c, eps=eps)
1386
1398
  else: # x == y == 0
1387
1399
  if z < 0:
1388
1400
  c = -c
@@ -1407,7 +1419,7 @@ def _normalTo5(x, y, z, Tun, eps=EPS): # MCCABE 19
1407
1419
  t = False
1408
1420
  if t:
1409
1421
  c = z # signed-0
1410
- a, b, d, i = _normalTo4(x, y, a, b, eps=eps)
1422
+ a, b, d, i = _plumbTo4(x, y, a, b, eps=eps)
1411
1423
 
1412
1424
  if val > 0: # validate
1413
1425
  e = T.sideOf(a, b, c, eps=val)
@@ -1426,13 +1438,6 @@ def _normalTo5(x, y, z, Tun, eps=EPS): # MCCABE 19
1426
1438
  return a, b, c, d, i
1427
1439
 
1428
1440
 
1429
- def _otherV3d_(x_xyz, y, z, **name):
1430
- '''(INTERNAL) Get a Vector3d from C{x_xyz}, C{y} and C{z}.
1431
- '''
1432
- return Vector3d(x_xyz, y, z, **name) if isscalar(x_xyz) else \
1433
- _otherV3d(x_xyz=x_xyz)
1434
-
1435
-
1436
1441
  def _rootXd(r, s, u, v, w, g, eps):
1437
1442
  '''(INTERNAL) Robust 2d- or 3d-root finder: 2d- if C{s == v == 0} else 3d-root.
1438
1443