pygeodesy 24.5.8__py2.py3-none-any.whl → 24.5.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.
- {PyGeodesy-24.5.8.dist-info → PyGeodesy-24.5.24.dist-info}/METADATA +2 -2
- PyGeodesy-24.5.24.dist-info/RECORD +116 -0
- pygeodesy/__init__.py +16 -12
- pygeodesy/__main__.py +9 -10
- pygeodesy/albers.py +42 -42
- pygeodesy/auxilats/__init__.py +1 -1
- pygeodesy/auxilats/__main__.py +7 -10
- pygeodesy/auxilats/auxAngle.py +32 -31
- pygeodesy/auxilats/auxLat.py +81 -51
- pygeodesy/azimuthal.py +123 -124
- pygeodesy/basics.py +165 -176
- pygeodesy/booleans.py +14 -15
- pygeodesy/cartesianBase.py +25 -23
- pygeodesy/clipy.py +3 -3
- pygeodesy/constants.py +8 -6
- pygeodesy/css.py +50 -42
- pygeodesy/datums.py +50 -48
- pygeodesy/dms.py +6 -6
- pygeodesy/ecef.py +27 -27
- pygeodesy/elevations.py +2 -2
- pygeodesy/ellipsoidalBase.py +28 -27
- pygeodesy/ellipsoidalBaseDI.py +8 -7
- pygeodesy/ellipsoidalNvector.py +11 -12
- pygeodesy/ellipsoids.py +41 -35
- pygeodesy/elliptic.py +12 -10
- pygeodesy/epsg.py +4 -3
- pygeodesy/errors.py +35 -13
- pygeodesy/etm.py +62 -53
- pygeodesy/fmath.py +48 -41
- pygeodesy/formy.py +93 -65
- pygeodesy/frechet.py +117 -102
- pygeodesy/fstats.py +52 -46
- pygeodesy/fsums.py +169 -145
- pygeodesy/gars.py +10 -9
- pygeodesy/geodesicw.py +32 -30
- pygeodesy/geodesicx/__init__.py +1 -1
- pygeodesy/geodesicx/__main__.py +4 -4
- pygeodesy/geodesicx/gx.py +40 -32
- pygeodesy/geodesicx/gxarea.py +15 -12
- pygeodesy/geodesicx/gxbases.py +3 -4
- pygeodesy/geodesicx/gxline.py +6 -8
- pygeodesy/geodsolve.py +28 -26
- pygeodesy/geohash.py +47 -44
- pygeodesy/geoids.py +37 -35
- pygeodesy/hausdorff.py +112 -99
- pygeodesy/heights.py +136 -129
- pygeodesy/internals.py +576 -0
- pygeodesy/interns.py +6 -207
- pygeodesy/iters.py +22 -19
- pygeodesy/karney.py +18 -15
- pygeodesy/ktm.py +31 -24
- pygeodesy/latlonBase.py +12 -11
- pygeodesy/lazily.py +140 -218
- pygeodesy/lcc.py +24 -25
- pygeodesy/ltp.py +83 -71
- pygeodesy/ltpTuples.py +7 -5
- pygeodesy/mgrs.py +5 -4
- pygeodesy/named.py +136 -49
- pygeodesy/namedTuples.py +33 -25
- pygeodesy/nvectorBase.py +10 -9
- pygeodesy/osgr.py +14 -12
- pygeodesy/points.py +13 -13
- pygeodesy/props.py +7 -7
- pygeodesy/rhumb/__init__.py +1 -1
- pygeodesy/rhumb/bases.py +3 -2
- pygeodesy/rhumb/solve.py +2 -2
- pygeodesy/solveBase.py +8 -7
- pygeodesy/sphericalTrigonometry.py +5 -5
- pygeodesy/streprs.py +8 -7
- pygeodesy/trf.py +8 -8
- pygeodesy/triaxials.py +67 -63
- pygeodesy/units.py +48 -50
- pygeodesy/unitsBase.py +24 -11
- pygeodesy/ups.py +7 -6
- pygeodesy/utily.py +4 -4
- pygeodesy/utm.py +53 -52
- pygeodesy/utmupsBase.py +11 -8
- pygeodesy/vector2d.py +6 -7
- pygeodesy/vector3d.py +16 -17
- pygeodesy/vector3dBase.py +5 -5
- PyGeodesy-24.5.8.dist-info/RECORD +0 -115
- {PyGeodesy-24.5.8.dist-info → PyGeodesy-24.5.24.dist-info}/WHEEL +0 -0
- {PyGeodesy-24.5.8.dist-info → PyGeodesy-24.5.24.dist-info}/top_level.txt +0 -0
pygeodesy/triaxials.py
CHANGED
|
@@ -46,8 +46,8 @@ from pygeodesy.interns import NN, _a_, _b_, _beta_, _c_, _distant_, _finite_, \
|
|
|
46
46
|
_NOTEQUAL_, _null_, _opposite_, _outside_, _SPACE_, \
|
|
47
47
|
_spherical_, _too_, _x_, _y_
|
|
48
48
|
# from pygeodesy.lazily import _ALL_LAZY, _ALL_MODS as _MODS # from .vector3d
|
|
49
|
-
from pygeodesy.named import
|
|
50
|
-
|
|
49
|
+
from pygeodesy.named import _lazyNamedEnumItem as _lazy, _name__, _NamedEnum, \
|
|
50
|
+
_NamedEnumItem, _NamedTuple, _Pass
|
|
51
51
|
from pygeodesy.namedTuples import LatLon3Tuple, Vector3Tuple, Vector4Tuple
|
|
52
52
|
from pygeodesy.props import Property_RO, property_RO
|
|
53
53
|
# from pygeodesy.streprs import Fmt # from .datums
|
|
@@ -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.
|
|
62
|
+
__version__ = '24.05.21'
|
|
63
63
|
|
|
64
64
|
_not_ordered_ = _not_('ordered')
|
|
65
65
|
_omega_ = 'omega'
|
|
@@ -185,7 +185,7 @@ class Triaxial_(_NamedEnumItem):
|
|
|
185
185
|
_ijk = _kji = None
|
|
186
186
|
_unordered = True
|
|
187
187
|
|
|
188
|
-
def __init__(self, a_triaxial, b=None, c=None, name
|
|
188
|
+
def __init__(self, a_triaxial, b=None, c=None, **name):
|
|
189
189
|
'''New I{unordered} L{Triaxial_}.
|
|
190
190
|
|
|
191
191
|
@arg a_triaxial: Large, C{X} semi-axis (C{scalar}, conventionally in
|
|
@@ -194,14 +194,16 @@ class Triaxial_(_NamedEnumItem):
|
|
|
194
194
|
if C{B{a_triaxial} is scalar}, ignored otherwise.
|
|
195
195
|
@kwarg c: Small, C{Z} semi-axis (C{meter}, same units as B{C{a}}), required
|
|
196
196
|
if C{B{a_triaxial} is scalar}, ignored otherwise.
|
|
197
|
-
@kwarg name: Optional name (C{str}).
|
|
197
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
198
198
|
|
|
199
199
|
@raise TriaxialError: Invalid semi-axis or -axes.
|
|
200
200
|
'''
|
|
201
201
|
try:
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
try:
|
|
203
|
+
a = a_triaxial
|
|
204
|
+
t = a._abc3
|
|
205
|
+
except AttributeError:
|
|
206
|
+
t = Radius(a=a), Radius(b=b), Radius(c=c)
|
|
205
207
|
except (TypeError, ValueError) as x:
|
|
206
208
|
raise TriaxialError(a=a, b=b, c=c, cause=x)
|
|
207
209
|
if name:
|
|
@@ -345,15 +347,15 @@ class Triaxial_(_NamedEnumItem):
|
|
|
345
347
|
Triaxial_._Elliptic = E = _MODS.elliptic.Elliptic # overwrite property_RO
|
|
346
348
|
return E
|
|
347
349
|
|
|
348
|
-
def hartzell4(self, pov, los=False, name
|
|
350
|
+
def hartzell4(self, pov, los=False, **name):
|
|
349
351
|
'''Compute the intersection of this triaxial's surface with a Line-Of-Sight
|
|
350
352
|
from a Point-Of-View in space.
|
|
351
353
|
|
|
352
354
|
@see: Function L{hartzell4<triaxials.hartzell4>} for further details.
|
|
353
355
|
'''
|
|
354
|
-
return hartzell4(pov, los=los, tri_biax=self, name
|
|
356
|
+
return hartzell4(pov, los=los, tri_biax=self, **name)
|
|
355
357
|
|
|
356
|
-
def height4(self, x_xyz, y=None, z=None, normal=True, eps=EPS):
|
|
358
|
+
def height4(self, x_xyz, y=None, z=None, normal=True, eps=EPS, **name):
|
|
357
359
|
'''Compute the projection on and the height above or below this triaxial's surface.
|
|
358
360
|
|
|
359
361
|
@arg x_xyz: X component (C{scalar}) or a cartesian (C{Cartesian}, L{Ecef9Tuple},
|
|
@@ -364,6 +366,7 @@ class Triaxial_(_NamedEnumItem):
|
|
|
364
366
|
otherwise the C{radial} line to the center of this triaxial (C{bool}).
|
|
365
367
|
@kwarg eps: Tolerance for root finding and validation (C{scalar}), use a negative
|
|
366
368
|
value to skip validation.
|
|
369
|
+
@kwarg name: Optional, overriding C{B{name}="heigh4"} (C{str}).
|
|
367
370
|
|
|
368
371
|
@return: L{Vector4Tuple}C{(x, y, z, h)} with the cartesian coordinates C{x}, C{y}
|
|
369
372
|
and C{z} of the projection on or the intersection with and with the height
|
|
@@ -396,7 +399,8 @@ class Triaxial_(_NamedEnumItem):
|
|
|
396
399
|
raise TriaxialError(x=x, y=y, z=z, cause=e)
|
|
397
400
|
if h > 0 and self.sideOf(v, eps=EPS0) < 0:
|
|
398
401
|
h = -h # below the surface
|
|
399
|
-
return Vector4Tuple(x, y, z, h, iteration=i,
|
|
402
|
+
return Vector4Tuple(x, y, z, h, iteration=i,
|
|
403
|
+
name=_name__(name, name__=self.height4))
|
|
400
404
|
|
|
401
405
|
@Property_RO
|
|
402
406
|
def isOrdered(self):
|
|
@@ -453,7 +457,7 @@ class Triaxial_(_NamedEnumItem):
|
|
|
453
457
|
'''
|
|
454
458
|
d = max(self._abc3)
|
|
455
459
|
t = tuple(((d / x)**2 if x != d else _1_0) for x in self._abc3)
|
|
456
|
-
return Vector3d(*t,
|
|
460
|
+
return Vector3d(*t, name__=self.normal3d)
|
|
457
461
|
|
|
458
462
|
def _order3(self, *abc, **reverse): # reverse=False
|
|
459
463
|
'''(INTERNAL) Un-/Order C{a}, C{b} and C{c}.
|
|
@@ -546,9 +550,11 @@ class Triaxial_(_NamedEnumItem):
|
|
|
546
550
|
'''
|
|
547
551
|
return _sideOf(_otherV3d_(x_xyz, y, z).xyz, self._abc3, eps=eps)
|
|
548
552
|
|
|
549
|
-
def toEllipsoid(self, name
|
|
553
|
+
def toEllipsoid(self, **name):
|
|
550
554
|
'''Convert this triaxial to an L{Ellipsoid}, provided 2 axes match.
|
|
551
555
|
|
|
556
|
+
@kwarg name: Optional, overriding C{B{name}=NN} (C{str})=.
|
|
557
|
+
|
|
552
558
|
@return: An L{Ellipsoid} with north along this C{Z} axis if C{a == b},
|
|
553
559
|
this C{Y} axis if C{a == c} or this C{X} axis if C{b == c}.
|
|
554
560
|
|
|
@@ -564,14 +570,14 @@ class Triaxial_(_NamedEnumItem):
|
|
|
564
570
|
elif a != c: # N = b-Y
|
|
565
571
|
t = _SPACE_(_a_, _NOTEQUAL_, _b_, _NOTEQUAL_, _c_)
|
|
566
572
|
raise TriaxialError(a=a, b=b, c=c, txt=t)
|
|
567
|
-
return Ellipsoid(a, b=b, name=
|
|
573
|
+
return Ellipsoid(a, b=b, name=self._name__(name))
|
|
568
574
|
|
|
569
575
|
def toStr(self, prec=9, name=NN, **unused): # PYCHOK signature
|
|
570
576
|
'''Return this C{Triaxial} as a string.
|
|
571
577
|
|
|
572
578
|
@kwarg prec: Precision, number of decimal digits (0..9).
|
|
573
|
-
@kwarg name:
|
|
574
|
-
this triaxial's name.
|
|
579
|
+
@kwarg name: Optional, overriding C{B{name}=NN} (C{str})
|
|
580
|
+
or C{None} to exclude this triaxial's name.
|
|
575
581
|
|
|
576
582
|
@return: This C{Triaxial}'s attributes (C{str}).
|
|
577
583
|
'''
|
|
@@ -584,7 +590,7 @@ class Triaxial_(_NamedEnumItem):
|
|
|
584
590
|
if isinstance(self, J):
|
|
585
591
|
t += J.xyQ2,
|
|
586
592
|
t += T.volume, T.area
|
|
587
|
-
return self._instr(name, prec, props=t, area_p=self.area_p())
|
|
593
|
+
return self._instr(name, prec, props=t, area_p=self.area_p()) # __name__
|
|
588
594
|
|
|
589
595
|
@Property_RO
|
|
590
596
|
def volume(self):
|
|
@@ -601,7 +607,7 @@ class Triaxial(Triaxial_):
|
|
|
601
607
|
'''
|
|
602
608
|
_unordered = False
|
|
603
609
|
|
|
604
|
-
def __init__(self, a_triaxial, b=None, c=None, name
|
|
610
|
+
def __init__(self, a_triaxial, b=None, c=None, **name):
|
|
605
611
|
'''New I{ordered} L{Triaxial}.
|
|
606
612
|
|
|
607
613
|
@arg a_triaxial: Largest semi-axis (C{scalar}, conventionally in C{meter})
|
|
@@ -610,14 +616,14 @@ class Triaxial(Triaxial_):
|
|
|
610
616
|
if C{B{a_triaxial} is scalar}, ignored otherwise.
|
|
611
617
|
@kwarg c: Smallest semi-axis (C{meter}, same units as B{C{a}}), required
|
|
612
618
|
if C{B{a_triaxial} is scalar}, ignored otherwise.
|
|
613
|
-
@kwarg name: Optional name (C{str}).
|
|
619
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
614
620
|
|
|
615
621
|
@note: The semi-axes must be ordered as C{B{a} >= B{b} >= B{c} > 0} and
|
|
616
622
|
must be ellipsoidal, C{B{a} > B{c}}.
|
|
617
623
|
|
|
618
624
|
@raise TriaxialError: Semi-axes not ordered, spherical or invalid.
|
|
619
625
|
'''
|
|
620
|
-
Triaxial_.__init__(self, a_triaxial, b=b, c=c, name
|
|
626
|
+
Triaxial_.__init__(self, a_triaxial, b=b, c=c, **name)
|
|
621
627
|
|
|
622
628
|
@Property_RO
|
|
623
629
|
def _a2b2_a2c2(self):
|
|
@@ -656,7 +662,7 @@ class Triaxial(Triaxial_):
|
|
|
656
662
|
x = y = u = _0_0
|
|
657
663
|
return x, y, u
|
|
658
664
|
|
|
659
|
-
def forwardBetaOmega(self, beta, omega, height=0, name
|
|
665
|
+
def forwardBetaOmega(self, beta, omega, height=0, **name):
|
|
660
666
|
'''Convert I{ellipsoidal} lat- and longitude C{beta}, C{omega}
|
|
661
667
|
and height to cartesian.
|
|
662
668
|
|
|
@@ -664,7 +670,7 @@ class Triaxial(Triaxial_):
|
|
|
664
670
|
@arg omega: Ellipsoidal longitude (C{radians} or L{Degrees}).
|
|
665
671
|
@arg height: Height above or below the ellipsoid's surface (C{meter}, same
|
|
666
672
|
units as this triaxial's C{a}, C{b} and C{c} semi-axes).
|
|
667
|
-
@kwarg name: Optional name (C{str}).
|
|
673
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
668
674
|
|
|
669
675
|
@return: A L{Vector3Tuple}C{(x, y, z)}.
|
|
670
676
|
|
|
@@ -684,9 +690,9 @@ class Triaxial(Triaxial_):
|
|
|
684
690
|
x *= cb * sqrt0(ca**2 + r * sa**2, Error=TriaxialError)
|
|
685
691
|
y *= ca * sb
|
|
686
692
|
z *= sa * sqrt0(_1_0 - r * cb**2, Error=TriaxialError)
|
|
687
|
-
return Vector3Tuple(x, y, z, name
|
|
693
|
+
return Vector3Tuple(x, y, z, **name)
|
|
688
694
|
|
|
689
|
-
def forwardBetaOmega_(self, sbeta, cbeta, somega, comega, name
|
|
695
|
+
def forwardBetaOmega_(self, sbeta, cbeta, somega, comega, **name):
|
|
690
696
|
'''Convert I{ellipsoidal} lat- and longitude C{beta} and C{omega}
|
|
691
697
|
to cartesian coordinates I{on the triaxial's surface}.
|
|
692
698
|
|
|
@@ -694,7 +700,7 @@ class Triaxial(Triaxial_):
|
|
|
694
700
|
@arg cbeta: Ellipsoidal latitude C{cos(beta)} (C{scalar}).
|
|
695
701
|
@arg somega: Ellipsoidal longitude C{sin(omega)} (C{scalar}).
|
|
696
702
|
@arg comega: Ellipsoidal longitude C{cos(omega)} (C{scalar}).
|
|
697
|
-
@kwarg name: Optional name (C{str}).
|
|
703
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
698
704
|
|
|
699
705
|
@return: A L{Vector3Tuple}C{(x, y, z)} on the surface.
|
|
700
706
|
|
|
@@ -706,34 +712,32 @@ class Triaxial(Triaxial_):
|
|
|
706
712
|
www.Topo.Auth.GR/wp-content/uploads/sites/111/2021/12/09_Panou.pdf>}.
|
|
707
713
|
'''
|
|
708
714
|
t = self._radialTo3(sbeta, cbeta, somega, comega)
|
|
709
|
-
return Vector3Tuple(*t, name
|
|
715
|
+
return Vector3Tuple(*t, **name)
|
|
710
716
|
|
|
711
|
-
def forwardCartesian(self, x_xyz, y=None, z=None,
|
|
717
|
+
def forwardCartesian(self, x_xyz, y=None, z=None, **normal_eps_name):
|
|
712
718
|
'''Project a cartesian on this triaxial.
|
|
713
719
|
|
|
714
720
|
@arg x_xyz: X component (C{scalar}) or a cartesian (C{Cartesian},
|
|
715
721
|
L{Ecef9Tuple}, L{Vector3d}, L{Vector3Tuple} or L{Vector4Tuple}).
|
|
716
722
|
@kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
|
|
717
723
|
@kwarg z: Z component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
|
|
718
|
-
@kwarg
|
|
719
|
-
|
|
720
|
-
|
|
724
|
+
@kwarg normal_eps_name: Optional keyword arguments C{B{normal}=True},
|
|
725
|
+
C{B{eps}=EPS} and overriding C{B{name}="height4"} (C{str}),
|
|
726
|
+
see method L{Triaxial.height4}.
|
|
721
727
|
|
|
722
728
|
@see: Method L{Triaxial.height4} for further information and method
|
|
723
729
|
L{Triaxial.reverseCartesian} to reverse the projection.
|
|
724
730
|
'''
|
|
725
|
-
|
|
726
|
-
_ = t.rename(name)
|
|
727
|
-
return t
|
|
731
|
+
return self.height4(x_xyz, y, z, **normal_eps_name)
|
|
728
732
|
|
|
729
|
-
def forwardLatLon(self, lat, lon, height=0, name
|
|
733
|
+
def forwardLatLon(self, lat, lon, height=0, **name):
|
|
730
734
|
'''Convert I{geodetic} lat-, longitude and heigth to cartesian.
|
|
731
735
|
|
|
732
736
|
@arg lat: Geodetic latitude (C{degrees}).
|
|
733
737
|
@arg lon: Geodetic longitude (C{degrees}).
|
|
734
738
|
@arg height: Height above the ellipsoid (C{meter}, same units
|
|
735
739
|
as this triaxial's C{a}, C{b} and C{c} axes).
|
|
736
|
-
@kwarg name: Optional name (C{str}).
|
|
740
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
737
741
|
|
|
738
742
|
@return: A L{Vector3Tuple}C{(x, y, z)}.
|
|
739
743
|
|
|
@@ -742,7 +746,7 @@ class Triaxial(Triaxial_):
|
|
|
742
746
|
'''
|
|
743
747
|
return self._forwardLatLon3(height, name, *sincos2d_(lat, lon))
|
|
744
748
|
|
|
745
|
-
def forwardLatLon_(self, slat, clat, slon, clon, height=0, name
|
|
749
|
+
def forwardLatLon_(self, slat, clat, slon, clon, height=0, **name):
|
|
746
750
|
'''Convert I{geodetic} lat-, longitude and heigth to cartesian.
|
|
747
751
|
|
|
748
752
|
@arg slat: Geodetic latitude C{sin(lat)} (C{scalar}).
|
|
@@ -751,7 +755,7 @@ class Triaxial(Triaxial_):
|
|
|
751
755
|
@arg clon: Geodetic longitude C{cos(lon)} (C{scalar}).
|
|
752
756
|
@arg height: Height above the ellipsoid (C{meter}, same units
|
|
753
757
|
as this triaxial's axes C{a}, C{b} and C{c}).
|
|
754
|
-
@kwarg name: Optional name (C{str}).
|
|
758
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
755
759
|
|
|
756
760
|
@return: A L{Vector3Tuple}C{(x, y, z)}.
|
|
757
761
|
|
|
@@ -762,7 +766,7 @@ class Triaxial(Triaxial_):
|
|
|
762
766
|
sb, cb = self._norm2(slon, clon)
|
|
763
767
|
return self._forwardLatLon3(height, name, sa, ca, sb, cb)
|
|
764
768
|
|
|
765
|
-
def _forwardLatLon3(self, height, name, sa, ca, sb, cb):
|
|
769
|
+
def _forwardLatLon3(self, height, name, sa, ca, sb, cb): # name always **name
|
|
766
770
|
'''(INTERNAL) Helper for C{.forwardLatLon} and C{.forwardLatLon_}.
|
|
767
771
|
'''
|
|
768
772
|
ca_x_sb = ca * sb
|
|
@@ -773,7 +777,7 @@ class Triaxial(Triaxial_):
|
|
|
773
777
|
x = (h + n) * ca * cb
|
|
774
778
|
y = (h + n * self._1e2ab) * ca_x_sb
|
|
775
779
|
z = (h + n * self._1e2ac) * sa
|
|
776
|
-
return Vector3Tuple(x, y, z, name
|
|
780
|
+
return Vector3Tuple(x, y, z, **name)
|
|
777
781
|
|
|
778
782
|
def _Height(self, height):
|
|
779
783
|
'''(INTERNAL) Validate a C{height}.
|
|
@@ -814,7 +818,7 @@ class Triaxial(Triaxial_):
|
|
|
814
818
|
z *= sa * sqrt0(z2, Error=TriaxialError)
|
|
815
819
|
return x, y, z
|
|
816
820
|
|
|
817
|
-
def reverseBetaOmega(self, x_xyz, y=None, z=None, name
|
|
821
|
+
def reverseBetaOmega(self, x_xyz, y=None, z=None, **name):
|
|
818
822
|
'''Convert cartesian to I{ellipsoidal} lat- and longitude, C{beta}, C{omega}
|
|
819
823
|
and height.
|
|
820
824
|
|
|
@@ -822,7 +826,7 @@ class Triaxial(Triaxial_):
|
|
|
822
826
|
L{Ecef9Tuple}, L{Vector3d}, L{Vector3Tuple} or L{Vector4Tuple}).
|
|
823
827
|
@kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
|
|
824
828
|
@kwarg z: Z component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
|
|
825
|
-
@kwarg name: Optional name (C{str}).
|
|
829
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
826
830
|
|
|
827
831
|
@return: A L{BetaOmega3Tuple}C{(beta, omega, height)} with C{beta} and
|
|
828
832
|
C{omega} in L{Radians} and (radial) C{height} in C{meter}, same
|
|
@@ -834,9 +838,9 @@ class Triaxial(Triaxial_):
|
|
|
834
838
|
'''
|
|
835
839
|
v = _otherV3d_(x_xyz, y, z)
|
|
836
840
|
a, b, h = self._reverseLatLon3(v, atan2, v, self.forwardBetaOmega_)
|
|
837
|
-
return BetaOmega3Tuple(Radians(beta=a), Radians(omega=b), h, name
|
|
841
|
+
return BetaOmega3Tuple(Radians(beta=a), Radians(omega=b), h, **name)
|
|
838
842
|
|
|
839
|
-
def reverseCartesian(self, x_xyz, y=None, z=None, h=0, normal=True, eps=_EPS2e4, name
|
|
843
|
+
def reverseCartesian(self, x_xyz, y=None, z=None, h=0, normal=True, eps=_EPS2e4, **name):
|
|
840
844
|
'''"Unproject" a cartesian on to a cartesion I{off} this triaxial's surface.
|
|
841
845
|
|
|
842
846
|
@arg x_xyz: X component (C{scalar}) or a cartesian (C{Cartesian},
|
|
@@ -848,7 +852,7 @@ class Triaxial(Triaxial_):
|
|
|
848
852
|
@kwarg normal: If C{True} the height is C{normal} to the surface, otherwise
|
|
849
853
|
C{radially} to the center of this triaxial (C{bool}).
|
|
850
854
|
@kwarg eps: Tolerance for surface test (C{scalar}).
|
|
851
|
-
@kwarg name: Optional name (C{str}).
|
|
855
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
852
856
|
|
|
853
857
|
@return: A L{Vector3Tuple}C{(x, y, z)}.
|
|
854
858
|
|
|
@@ -856,7 +860,7 @@ class Triaxial(Triaxial_):
|
|
|
856
860
|
|
|
857
861
|
@see: Methods L{Triaxial.forwardCartesian} and L{Triaxial.height4}.
|
|
858
862
|
'''
|
|
859
|
-
v = _otherV3d_(x_xyz, y, z, name
|
|
863
|
+
v = _otherV3d_(x_xyz, y, z, **name)
|
|
860
864
|
s = _sideOf(v.xyz, self._abc3, eps=eps)
|
|
861
865
|
if s: # PYCHOK no cover
|
|
862
866
|
t = _SPACE_((_inside_ if s < 0 else _outside_), self.toRepr())
|
|
@@ -869,14 +873,14 @@ class Triaxial(Triaxial_):
|
|
|
869
873
|
v = v.times(_1_0 + (h / v.length))
|
|
870
874
|
return v.xyz # Vector3Tuple
|
|
871
875
|
|
|
872
|
-
def reverseLatLon(self, x_xyz, y=None, z=None, name
|
|
876
|
+
def reverseLatLon(self, x_xyz, y=None, z=None, **name):
|
|
873
877
|
'''Convert cartesian to I{geodetic} lat-, longitude and height.
|
|
874
878
|
|
|
875
879
|
@arg x_xyz: X component (C{scalar}) or a cartesian (C{Cartesian},
|
|
876
880
|
L{Ecef9Tuple}, L{Vector3d}, L{Vector3Tuple} or L{Vector4Tuple}).
|
|
877
881
|
@kwarg y: Y component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
|
|
878
882
|
@kwarg z: Z component (C{scalar}), required if B{C{x_xyz}} if C{scalar}.
|
|
879
|
-
@kwarg name: Optional name (C{str}).
|
|
883
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
880
884
|
|
|
881
885
|
@return: A L{LatLon3Tuple}C{(lat, lon, height)} with C{lat} and C{lon}
|
|
882
886
|
in C{degrees} and (radial) C{height} in C{meter}, same units
|
|
@@ -891,7 +895,7 @@ class Triaxial(Triaxial_):
|
|
|
891
895
|
self._1e2bc, # == 1 - e_sub_y**2
|
|
892
896
|
_1_0)
|
|
893
897
|
t = self._reverseLatLon3(s, atan2d, v, self.forwardLatLon_)
|
|
894
|
-
return LatLon3Tuple(*t, name
|
|
898
|
+
return LatLon3Tuple(*t, **name)
|
|
895
899
|
|
|
896
900
|
def _reverseLatLon3(self, s, atan2_, v, forward_):
|
|
897
901
|
'''(INTERNAL) Helper for C{.reverseBetOmg} and C{.reverseLatLon}.
|
|
@@ -962,32 +966,32 @@ class JacobiConformal(Triaxial):
|
|
|
962
966
|
Radians(y=self._c2_b2 * self._yE.cPi),
|
|
963
967
|
name=JacobiConformal.xyQ2.name)
|
|
964
968
|
|
|
965
|
-
def xyR2(self, beta, omega, name
|
|
969
|
+
def xyR2(self, beta, omega, **name):
|
|
966
970
|
'''Compute a Jacobi Conformal C{x} and C{y} projection.
|
|
967
971
|
|
|
968
972
|
@arg beta: Ellipsoidal latitude (C{radians} or L{Degrees}).
|
|
969
973
|
@arg omega: Ellipsoidal longitude (C{radians} or L{Degrees}).
|
|
970
|
-
@kwarg name: Optional name (C{str}).
|
|
974
|
+
@kwarg name: Optional, overriding C{B{name}="xyR2"} (C{str}).
|
|
971
975
|
|
|
972
976
|
@return: A L{Jacobi2Tuple}C{(x, y)}.
|
|
973
977
|
'''
|
|
974
978
|
return self.xyR2_(*(SinCos2(beta) + SinCos2(omega)),
|
|
975
|
-
name=name
|
|
979
|
+
name=_name__(name, name__=self.xyR2))
|
|
976
980
|
|
|
977
|
-
def xyR2_(self, sbeta, cbeta, somega, comega, name
|
|
981
|
+
def xyR2_(self, sbeta, cbeta, somega, comega, **name):
|
|
978
982
|
'''Compute a Jacobi Conformal C{x} and C{y} projection.
|
|
979
983
|
|
|
980
984
|
@arg sbeta: Ellipsoidal latitude C{sin(beta)} (C{scalar}).
|
|
981
985
|
@arg cbeta: Ellipsoidal latitude C{cos(beta)} (C{scalar}).
|
|
982
986
|
@arg somega: Ellipsoidal longitude C{sin(omega)} (C{scalar}).
|
|
983
987
|
@arg comega: Ellipsoidal longitude C{cos(omega)} (C{scalar}).
|
|
984
|
-
@kwarg name: Optional name (C{str}).
|
|
988
|
+
@kwarg name: Optional, overriding C{B{name}="xyR2_"} (C{str}).
|
|
985
989
|
|
|
986
990
|
@return: A L{Jacobi2Tuple}C{(x, y)}.
|
|
987
991
|
'''
|
|
988
992
|
return Jacobi2Tuple(self.xR_(somega, comega),
|
|
989
993
|
self.yR_(sbeta, cbeta),
|
|
990
|
-
name=name
|
|
994
|
+
name=_name__(name, name__=self.xyR2_))
|
|
991
995
|
|
|
992
996
|
@Property_RO
|
|
993
997
|
def _yE(self):
|
|
@@ -1025,7 +1029,7 @@ class JacobiConformalSpherical(JacobiConformal):
|
|
|
1025
1029
|
'''
|
|
1026
1030
|
_ab = _bc = 0
|
|
1027
1031
|
|
|
1028
|
-
def __init__(self, radius_triaxial, ab=0, bc=0, name
|
|
1032
|
+
def __init__(self, radius_triaxial, ab=0, bc=0, **name):
|
|
1029
1033
|
'''New L{JacobiConformalSpherical}.
|
|
1030
1034
|
|
|
1031
1035
|
@arg radius_triaxial: Radius (C{scalar}, conventionally in
|
|
@@ -1035,7 +1039,7 @@ class JacobiConformalSpherical(JacobiConformal):
|
|
|
1035
1039
|
same units as C{scalar B{radius}}.
|
|
1036
1040
|
@kwarg bc: Relative magnitude of C{B{b} - B{c}} (C{meter},
|
|
1037
1041
|
same units as C{scalar B{radius}}.
|
|
1038
|
-
@kwarg name: Optional name (C{str}).
|
|
1042
|
+
@kwarg name: Optional C{B{name}=NN} (C{str}).
|
|
1039
1043
|
|
|
1040
1044
|
@raise TriaxialError: Invalid B{C{radius_triaxial}}, negative
|
|
1041
1045
|
B{C{ab}}, negative B{C{bc}} or C{(B{ab}
|
|
@@ -1210,7 +1214,7 @@ def _hartzell3(pov, los, Tun): # in .ellipsoids.hartzell4, .formy.hartzell
|
|
|
1210
1214
|
return T._order3d(v, reverse=True), h, None
|
|
1211
1215
|
|
|
1212
1216
|
|
|
1213
|
-
def hartzell4(pov, los=False, tri_biax=_WGS84, name
|
|
1217
|
+
def hartzell4(pov, los=False, tri_biax=_WGS84, **name):
|
|
1214
1218
|
'''Compute the intersection of a tri-/biaxial ellipsoid and a Line-Of-Sight
|
|
1215
1219
|
from a Point-Of-View outside.
|
|
1216
1220
|
|
|
@@ -1223,7 +1227,7 @@ def hartzell4(pov, los=False, tri_biax=_WGS84, name=NN):
|
|
|
1223
1227
|
L{JacobiConformalSpherical}) or biaxial ellipsoid (L{Datum},
|
|
1224
1228
|
L{Ellipsoid}, L{Ellipsoid2}, L{a_f2Tuple} or C{scalar} radius,
|
|
1225
1229
|
conventionally in C{meter}).
|
|
1226
|
-
@kwarg name: Optional name (C{str}).
|
|
1230
|
+
@kwarg name: Optional, overriding C{B{name}="hartzell4"} (C{str}).
|
|
1227
1231
|
|
|
1228
1232
|
@return: L{Vector4Tuple}C{(x, y, z, h)} on the tri-/biaxial's surface, with C{h}
|
|
1229
1233
|
the distance from B{C{pov}} to C{(x, y, z)} I{along the} B{C{los}}, all
|
|
@@ -1240,18 +1244,18 @@ def hartzell4(pov, los=False, tri_biax=_WGS84, name=NN):
|
|
|
1240
1244
|
Line-of-Sight Intersection with Earth"<https://StephenHartzell.Medium.com/
|
|
1241
1245
|
satellite-line-of-sight-intersection-with-earth-d786b4a6a9b6>}.
|
|
1242
1246
|
'''
|
|
1243
|
-
n = hartzell4.__name__
|
|
1244
1247
|
if isinstance(tri_biax, Triaxial_):
|
|
1245
1248
|
T = tri_biax
|
|
1246
1249
|
else:
|
|
1247
1250
|
D = tri_biax if isinstance(tri_biax, Datum) else \
|
|
1248
|
-
_spherical_datum(tri_biax,
|
|
1251
|
+
_spherical_datum(tri_biax, name__=hartzell4) # _dunder_nameof
|
|
1249
1252
|
T = D.ellipsoid._triaxial
|
|
1250
1253
|
try:
|
|
1251
1254
|
v, h, i = _hartzell3(pov, los, T)
|
|
1252
1255
|
except Exception as x:
|
|
1253
1256
|
raise TriaxialError(pov=pov, los=los, tri_biax=tri_biax, cause=x)
|
|
1254
|
-
return Vector4Tuple(v.x, v.y, v.z, h, iteration=i,
|
|
1257
|
+
return Vector4Tuple(v.x, v.y, v.z, h, iteration=i, # _dunder_nameof
|
|
1258
|
+
name=_name__(name, name__=hartzell4))
|
|
1255
1259
|
|
|
1256
1260
|
|
|
1257
1261
|
def _hypot21(x, y, z=0):
|
|
@@ -1439,7 +1443,7 @@ def _rootXd(r, s, u, v, w, g, eps):
|
|
|
1439
1443
|
break
|
|
1440
1444
|
else: # PYCHOK no cover
|
|
1441
1445
|
t = Fmt.no_convergence(e, eps)
|
|
1442
|
-
raise _ValueError(t,
|
|
1446
|
+
raise _ValueError(t, txt__=_rootXd)
|
|
1443
1447
|
return t, i
|
|
1444
1448
|
|
|
1445
1449
|
|