pygeodesy 24.8.24__py2.py3-none-any.whl → 24.9.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 (49) hide show
  1. {PyGeodesy-24.8.24.dist-info → PyGeodesy-24.9.24.dist-info}/METADATA +7 -7
  2. {PyGeodesy-24.8.24.dist-info → PyGeodesy-24.9.24.dist-info}/RECORD +49 -48
  3. pygeodesy/__init__.py +7 -5
  4. pygeodesy/__main__.py +46 -47
  5. pygeodesy/auxilats/_CX_4.py +104 -181
  6. pygeodesy/auxilats/_CX_6.py +152 -277
  7. pygeodesy/auxilats/_CX_8.py +211 -438
  8. pygeodesy/auxilats/_CX_Rs.py +222 -0
  9. pygeodesy/auxilats/__init__.py +2 -2
  10. pygeodesy/auxilats/__main__.py +30 -38
  11. pygeodesy/auxilats/auxLat.py +28 -36
  12. pygeodesy/auxilats/auxily.py +30 -50
  13. pygeodesy/basics.py +24 -14
  14. pygeodesy/booleans.py +13 -14
  15. pygeodesy/clipy.py +7 -7
  16. pygeodesy/constants.py +44 -31
  17. pygeodesy/deprecated/__init__.py +1 -1
  18. pygeodesy/deprecated/functions.py +9 -1
  19. pygeodesy/elliptic.py +154 -88
  20. pygeodesy/errors.py +32 -5
  21. pygeodesy/etm.py +71 -59
  22. pygeodesy/fmath.py +125 -96
  23. pygeodesy/fstats.py +8 -12
  24. pygeodesy/fsums.py +802 -355
  25. pygeodesy/geodesici.py +6 -5
  26. pygeodesy/geodesicx/_C4_24.py +1 -3
  27. pygeodesy/geodesicx/_C4_27.py +1 -3
  28. pygeodesy/geodesicx/_C4_30.py +1 -3
  29. pygeodesy/geodesicx/__init__.py +1 -1
  30. pygeodesy/geodesicx/__main__.py +44 -46
  31. pygeodesy/geodesicx/gxarea.py +3 -3
  32. pygeodesy/geodesicx/gxbases.py +32 -18
  33. pygeodesy/internals.py +50 -9
  34. pygeodesy/interns.py +3 -2
  35. pygeodesy/karney.py +79 -60
  36. pygeodesy/ktm.py +4 -4
  37. pygeodesy/lazily.py +10 -5
  38. pygeodesy/mgrs.py +47 -42
  39. pygeodesy/named.py +4 -1
  40. pygeodesy/points.py +3 -3
  41. pygeodesy/props.py +7 -6
  42. pygeodesy/resections.py +2 -2
  43. pygeodesy/rhumb/__init__.py +1 -1
  44. pygeodesy/rhumb/aux_.py +42 -60
  45. pygeodesy/sphericalNvector.py +4 -4
  46. pygeodesy/sphericalTrigonometry.py +2 -2
  47. pygeodesy/triaxials.py +3 -3
  48. {PyGeodesy-24.8.24.dist-info → PyGeodesy-24.9.24.dist-info}/WHEEL +0 -0
  49. {PyGeodesy-24.8.24.dist-info → PyGeodesy-24.9.24.dist-info}/top_level.txt +0 -0
pygeodesy/etm.py CHANGED
@@ -73,10 +73,9 @@ from pygeodesy.elliptic import _ALL_LAZY, Elliptic
73
73
  # from pygeodesy.errors import _incompatible # from .named
74
74
  # from pygeodesy.fsums import Fsum # from .fmath
75
75
  from pygeodesy.fmath import cbrt, hypot, hypot1, hypot2, Fsum
76
- from pygeodesy.interns import _COMMASPACE_, _DASH_, _near_, _SPACE_, \
77
- _spherical_
78
- from pygeodesy.karney import _copyBit, _diff182, _fix90, _norm2, _norm180, \
79
- _tand, _unsigned2
76
+ from pygeodesy.interns import _COMMASPACE_, _near_, _SPACE_, _spherical_
77
+ from pygeodesy.karney import _K_2_4, _copyBit, _diff182, _fix90, \
78
+ _norm2, _norm180, _tand, _unsigned2
80
79
  # from pygeodesy.lazily import _ALL_LAZY # from .elliptic
81
80
  from pygeodesy.named import callername, _incompatible, _NamedBase
82
81
  from pygeodesy.namedTuples import Forward4Tuple, Reverse4Tuple
@@ -92,7 +91,7 @@ from pygeodesy.utm import _cmlon, _LLEB, _parseUTM5, _toBand, _toXtm8, \
92
91
  from math import asinh, atan2, degrees, radians, sinh, sqrt
93
92
 
94
93
  __all__ = _ALL_LAZY.etm
95
- __version__ = '24.06.11'
94
+ __version__ = '24.09.06'
96
95
 
97
96
  _OVERFLOW = _1_EPS**2 # about 2e+31
98
97
  _TAYTOL = pow(EPS, 0.6)
@@ -431,13 +430,15 @@ class ExactTransverseMercator(_NamedBase):
431
430
 
432
431
  f = flattening
433
432
 
434
- def forward(self, lat, lon, lon0=None, **name): # MCCABE 13
433
+ def forward(self, lat, lon, lon0=None, jam=_K_2_4, **name): # MCCABE 13
435
434
  '''Forward projection, from geographic to transverse Mercator.
436
435
 
437
436
  @arg lat: Latitude of point (C{degrees}).
438
437
  @arg lon: Longitude of point (C{degrees}).
439
438
  @kwarg lon0: Central meridian (C{degrees180}), overriding
440
439
  the default if not C{None}.
440
+ @kwarg jam: If C{True}, use the C{Jacobi amplitude}
441
+ otherwise C{Bulirsch}' function (C{bool}).
441
442
  @kwarg name: Optional C{B{name}=NN} (C{str}).
442
443
 
443
444
  @return: L{Forward4Tuple}C{(easting, northing, gamma, scale)}.
@@ -473,7 +474,7 @@ class ExactTransverseMercator(_NamedBase):
473
474
  tau, lam = _tand(lat), radians(lon)
474
475
  u, v = self._zetaInv2(self._E.es_taupf(tau), lam)
475
476
 
476
- sncndn6 = self._sncndn6(u, v)
477
+ sncndn6 = self._sncndn6(u, v, jam=jam)
477
478
  y, x, _ = self._sigma3(v, *sncndn6)
478
479
  g, k = (lon, self.k0) if isnear90(lat) else \
479
480
  self._zetaScaled(sncndn6, ll=False)
@@ -668,13 +669,15 @@ class ExactTransverseMercator(_NamedBase):
668
669
  self._mu = mu
669
670
  self._mv = mv
670
671
 
671
- def reverse(self, x, y, lon0=None, **name):
672
+ def reverse(self, x, y, lon0=None, jam=_K_2_4, **name):
672
673
  '''Reverse projection, from Transverse Mercator to geographic.
673
674
 
674
675
  @arg x: Easting of point (C{meters}).
675
676
  @arg y: Northing of point (C{meters}).
676
677
  @kwarg lon0: Optional central meridian (C{degrees180}),
677
678
  overriding the default (C{iff not None}).
679
+ @kwarg jam: If C{True}, use the C{Jacobi amplitude}
680
+ otherwise C{Bulirsch}' function (C{bool}).
678
681
  @kwarg name: Optional C{B{name}=NN} (C{str}).
679
682
 
680
683
  @return: L{Reverse4Tuple}C{(lat, lon, gamma, scale)}.
@@ -706,7 +709,7 @@ class ExactTransverseMercator(_NamedBase):
706
709
  v = self._Ev_cK
707
710
 
708
711
  if v or u != self._Eu_cK:
709
- g, k, lat, lon = self._zetaScaled(self._sncndn6(u, v))
712
+ g, k, lat, lon = self._zetaScaled(self._sncndn6(u, v, jam=jam))
710
713
  else: # PYCHOK no cover
711
714
  g, k, lat, lon = _0_0, self.k0, _90_0, _0_0
712
715
 
@@ -866,12 +869,12 @@ class ExactTransverseMercator(_NamedBase):
866
869
 
867
870
  return u, v, t, C
868
871
 
869
- def _sncndn6(self, u, v):
872
+ def _sncndn6(self, u, v, **jam):
870
873
  '''(INTERNAL) Get 6-tuple C{(snu, cnu, dnu, snv, cnv, dnv)}.
871
874
  '''
872
875
  # snu, cnu, dnu = self._Eu.sncndn(u)
873
876
  # snv, cnv, dnv = self._Ev.sncndn(v)
874
- return self._Eu.sncndn(u) + self._Ev.sncndn(v)
877
+ return self._Eu.sncndn(u, **jam) + self._Ev.sncndn(v, **jam)
875
878
 
876
879
  def toStr(self, joined=_COMMASPACE_, **kwds): # PYCHOK signature
877
880
  '''Return a C{str} representation.
@@ -1094,67 +1097,76 @@ def toEtm8(latlon, lon=None, datum=None, Etm=Etm, falsed=True,
1094
1097
  n, latlon, d.exactTM, Error=ETMError)
1095
1098
 
1096
1099
 
1097
- if __name__ == '__main__': # MCCABE 13
1098
-
1099
- from pygeodesy import fstr, KTransverseMercator, printf
1100
- from pygeodesy.internals import _usage
1101
- from sys import argv, exit as _exit
1102
-
1103
- # mimick some of I{Karney}'s utility C{TransverseMercatorProj}
1104
- _f = _r = _s = _t = False
1105
- _p = -6
1106
- _as = argv[1:]
1107
- while _as and _as[0].startswith(_DASH_):
1108
- _a = _as.pop(0)
1109
- if len(_a) < 2:
1110
- _exit('%s: option %r invalid' % (_usage(*argv), _a))
1111
- elif '-forward'.startswith(_a):
1112
- _f, _r = True, False
1113
- elif '-reverse'.startswith(_a):
1114
- _f, _r = False, True
1115
- elif '-precision'.startswith(_a):
1116
- _p = int(_as.pop(0))
1117
- elif '-series'.startswith(_a):
1118
- _s, _t = True, False
1119
- elif _a == '-t':
1120
- _s, _t = False, True
1121
- elif '-help'.startswith(_a):
1100
+ if __name__ == '__main__': # MCCABE 16
1101
+
1102
+ def _main():
1103
+
1104
+ from pygeodesy import fstr, KTransverseMercator
1105
+ # from pygeodesy.interns import _DASH_ # from internals
1106
+ from pygeodesy.internals import printf, _usage, _DASH_
1107
+ from sys import argv, exit as _exit
1108
+
1109
+ def _help():
1122
1110
  _exit(_usage(argv[0], '[-s | -t ]',
1123
1111
  '[-p[recision] <ndigits>',
1124
1112
  '[-f[orward] <lat> <lon>',
1125
1113
  '|-r[everse] <easting> <northing>',
1126
1114
  '|<lat> <lon>]',
1127
1115
  '|-h[elp]'))
1116
+
1117
+ # mimick some of I{Karney}'s utility C{TransverseMercatorProj}
1118
+ _f = _r = _s = _t = False
1119
+ _p = -6
1120
+ _as = argv[1:]
1121
+ while _as and _as[0].startswith(_DASH_):
1122
+ _a = _as.pop(0)
1123
+ if len(_a) < 2:
1124
+ _exit('%s: option %r invalid' % (_usage(*argv), _a))
1125
+ elif '-forward'.startswith(_a):
1126
+ _f, _r = True, False
1127
+ elif '-reverse'.startswith(_a):
1128
+ _f, _r = False, True
1129
+ elif '-precision'.startswith(_a):
1130
+ _p = int(_as.pop(0))
1131
+ elif '-series'.startswith(_a):
1132
+ _s, _t = True, False
1133
+ elif _a == '-t':
1134
+ _s, _t = False, True
1135
+ elif '-help'.startswith(_a):
1136
+ _help()
1137
+ else:
1138
+ _exit('%s: option %r not supported' % (_usage(*argv), _a))
1139
+
1140
+ if len(_as) > 1:
1141
+ f2 = map1(float, *_as[:2])
1142
+ else:
1143
+ printf('%s ...: incomplete', _usage(*argv))
1144
+ _help()
1145
+
1146
+ if _s: # -series
1147
+ tm = KTransverseMercator()
1148
+ else:
1149
+ tm = ExactTransverseMercator(extendp=_t)
1150
+
1151
+ if _f:
1152
+ t = tm.forward(*f2)
1153
+ elif _r:
1154
+ t = tm.reverse(*f2)
1128
1155
  else:
1129
- _exit('%s: option %r not supported' % (_usage(*argv), _a))
1130
- if len(_as) > 1:
1131
- f2 = map1(float, *_as[:2])
1132
- else:
1133
- _exit('%s ...: incomplete' % (_usage(*argv),))
1134
-
1135
- if _s: # -series
1136
- tm = KTransverseMercator()
1137
- else:
1138
- tm = ExactTransverseMercator(extendp=_t)
1139
-
1140
- if _f:
1141
- t = tm.forward(*f2)
1142
- elif _r:
1143
- t = tm.reverse(*f2)
1144
- else:
1145
- t = tm.forward(*f2)
1156
+ t = tm.forward(*f2)
1157
+ printf('%s: %s', tm.classname, fstr(t, prec=_p, sep=_SPACE_))
1158
+ t = tm.reverse(t.easting, t.northing)
1146
1159
  printf('%s: %s', tm.classname, fstr(t, prec=_p, sep=_SPACE_))
1147
- t = tm.reverse(t.easting, t.northing)
1148
- printf('%s: %s', tm.classname, fstr(t, prec=_p, sep=_SPACE_))
1149
1160
 
1161
+ _main()
1150
1162
 
1151
- # % python3 -m pygeodesy.etm -p 12 33.33 44.44
1163
+ # % python3.12 -m pygeodesy.etm -p 12 33.33 44.44
1152
1164
  # ExactTransverseMercator: 4276926.11480390653 4727193.767015309073 28.375536563148 1.233325101778
1153
1165
  # ExactTransverseMercator: 33.33 44.44 28.375536563148 1.233325101778
1154
1166
 
1155
- # % python3 -m pygeodesy.etm -s -p 12 33.33 44.44
1156
- # KTransverseMercator: 4276926.114803904667 4727193.767015310004 28.375536563148 1.233325101778
1157
- # KTransverseMercator: 33.33 44.44 28.375536563148 1.233325101778
1167
+ # % python3.12 -s -m pygeodesy.etm -p 12 33.33 44.44
1168
+ # ExactTransverseMercator: 4276926.11480390653 4727193.767015309073 28.375536563148 1.233325101778
1169
+ # ExactTransverseMercator: 33.33 44.44 28.375536563148 1.233325101778
1158
1170
 
1159
1171
  # % echo 33.33 44.44 | .../bin/TransverseMercatorProj
1160
1172
  # 4276926.114804 4727193.767015 28.375536563148 1.233325101778