pyTMD 2.2.8__tar.gz → 2.2.9__tar.gz

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 (59) hide show
  1. {pytmd-2.2.8/pyTMD.egg-info → pytmd-2.2.9}/PKG-INFO +12 -9
  2. {pytmd-2.2.8 → pytmd-2.2.9}/README.md +2 -1
  3. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/__init__.py +6 -8
  4. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/arguments.py +23 -11
  5. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/astro.py +6 -4
  6. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/compute.py +3 -2
  7. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/data/database.json +364 -21
  8. pytmd-2.2.9/pyTMD/datasets/__init__.py +16 -0
  9. pytmd-2.2.8/pyTMD/scripts/arcticdata_tides.py → pytmd-2.2.9/pyTMD/datasets/fetch_arcticdata.py +42 -21
  10. pytmd-2.2.8/pyTMD/scripts/aviso_fes_tides.py → pytmd-2.2.9/pyTMD/datasets/fetch_aviso_fes.py +207 -87
  11. pytmd-2.2.8/pyTMD/scripts/gsfc_got_tides.py → pytmd-2.2.9/pyTMD/datasets/fetch_gsfc_got.py +73 -33
  12. pytmd-2.2.9/pyTMD/datasets/fetch_test_data.py +187 -0
  13. pytmd-2.2.8/pyTMD/scripts/reduce_OTIS_files.py → pytmd-2.2.9/pyTMD/datasets/reduce_otis.py +70 -46
  14. {pytmd-2.2.8/pyTMD/scripts → pytmd-2.2.9/pyTMD/datasets}/verify_box_tpxo.py +31 -16
  15. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/interpolate.py +8 -6
  16. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/io/FES.py +17 -21
  17. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/io/GOT.py +13 -20
  18. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/io/OTIS.py +841 -290
  19. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/io/__init__.py +3 -2
  20. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/io/constituents.py +9 -8
  21. pytmd-2.2.9/pyTMD/io/dataset.py +229 -0
  22. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/io/model.py +28 -6
  23. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/math.py +1 -1
  24. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/predict.py +17 -15
  25. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/solve/constants.py +43 -5
  26. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/tools.py +3 -2
  27. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/utilities.py +39 -6
  28. {pytmd-2.2.8 → pytmd-2.2.9/pyTMD.egg-info}/PKG-INFO +12 -9
  29. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD.egg-info/SOURCES.txt +7 -6
  30. pytmd-2.2.9/pyTMD.egg-info/entry_points.txt +11 -0
  31. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD.egg-info/requires.txt +9 -7
  32. {pytmd-2.2.8 → pytmd-2.2.9}/pyproject.toml +77 -31
  33. pytmd-2.2.8/pyTMD/compute_tide_corrections.py +0 -174
  34. pytmd-2.2.8/pyTMD/io/dataset.py +0 -67
  35. pytmd-2.2.8/pyTMD.egg-info/entry_points.txt +0 -6
  36. {pytmd-2.2.8 → pytmd-2.2.9}/LICENSE +0 -0
  37. {pytmd-2.2.8 → pytmd-2.2.9}/MANIFEST.in +0 -0
  38. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/crs.py +0 -0
  39. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/data/ct1971_tab6.txt +0 -0
  40. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/data/cte1973_tab.txt +0 -0
  41. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/data/d1921_tab.txt +0 -0
  42. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/data/doodson.json +0 -0
  43. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/data/hw1995_tab.txt +0 -0
  44. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/data/opoleloadcoefcmcor.txt.gz +0 -0
  45. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/data/t1987_tab.txt +0 -0
  46. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/data/tab5.2e.txt +0 -0
  47. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/data/tab5.3a.txt +0 -0
  48. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/data/tab5.3b.txt +0 -0
  49. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/data/w1990_tab.txt +0 -0
  50. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/ellipse.py +0 -0
  51. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/io/ATLAS.py +0 -0
  52. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/io/IERS.py +0 -0
  53. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/io/NOAA.py +0 -0
  54. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/solve/__init__.py +0 -0
  55. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/spatial.py +0 -0
  56. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD/version.py +0 -0
  57. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD.egg-info/dependency_links.txt +0 -0
  58. {pytmd-2.2.8 → pytmd-2.2.9}/pyTMD.egg-info/top_level.txt +0 -0
  59. {pytmd-2.2.8 → pytmd-2.2.9}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyTMD
3
- Version: 2.2.8
3
+ Version: 2.2.9
4
4
  Summary: Python-based tidal prediction software for estimating ocean, load, solid Earth and pole tides
5
5
  Author: Tyler Sutterley
6
6
  Author-email: tsutterl@uw.edu
@@ -52,7 +52,8 @@ License-File: LICENSE
52
52
  Requires-Dist: lxml
53
53
  Requires-Dist: netCDF4
54
54
  Requires-Dist: numpy
55
- Requires-Dist: pyproj
55
+ Requires-Dist: platformdirs
56
+ Requires-Dist: pyproj>=2.5.0
56
57
  Requires-Dist: python-dateutil
57
58
  Requires-Dist: scipy>=1.10.1
58
59
  Requires-Dist: timescale>=0.0.8
@@ -71,25 +72,26 @@ Requires-Dist: cartopy; extra == "all"
71
72
  Requires-Dist: ipyleaflet; extra == "all"
72
73
  Requires-Dist: ipywidgets; extra == "all"
73
74
  Requires-Dist: jplephem; extra == "all"
75
+ Requires-Dist: jupyterlab; extra == "all"
74
76
  Requires-Dist: matplotlib; extra == "all"
75
77
  Requires-Dist: notebook; extra == "all"
76
78
  Requires-Dist: pandas; extra == "all"
79
+ Requires-Dist: xarray; extra == "all"
77
80
  Provides-Extra: aws
78
- Requires-Dist: xarray; extra == "aws"
79
81
  Requires-Dist: dask; extra == "aws"
80
- Requires-Dist: zarr>=3; extra == "aws"
81
- Requires-Dist: h5netcdf; extra == "aws"
82
82
  Requires-Dist: geopandas; extra == "aws"
83
- Requires-Dist: pyarrow; extra == "aws"
83
+ Requires-Dist: h5netcdf; extra == "aws"
84
84
  Requires-Dist: obstore; extra == "aws"
85
+ Requires-Dist: pyarrow; extra == "aws"
85
86
  Requires-Dist: s3fs; extra == "aws"
87
+ Requires-Dist: zarr>=3; extra == "aws"
86
88
  Provides-Extra: dev
87
89
  Requires-Dist: flake8; extra == "dev"
90
+ Requires-Dist: gh; extra == "dev"
91
+ Requires-Dist: oct2py; extra == "dev"
88
92
  Requires-Dist: pytest>=4.6; extra == "dev"
89
93
  Requires-Dist: pytest-cov; extra == "dev"
90
94
  Requires-Dist: pytest-xdist; extra == "dev"
91
- Requires-Dist: oct2py; extra == "dev"
92
- Requires-Dist: boto3; extra == "dev"
93
95
  Dynamic: license-file
94
96
 
95
97
  # pyTMD
@@ -166,6 +168,7 @@ This will automatically create the environment, install all dependencies, and la
166
168
  - [lxml: processing XML and HTML in Python](https://pypi.python.org/pypi/lxml)
167
169
  - [netCDF4: Python interface to the netCDF C library](https://unidata.github.io/netcdf4-python/)
168
170
  - [numpy: Scientific Computing Tools For Python](https://www.numpy.org)
171
+ - [platformdirs: Python module for determining platform-specific directories](https://pypi.org/project/platformdirs/)
169
172
  - [pyproj: Python interface to PROJ library](https://pypi.org/project/pyproj/)
170
173
  - [scipy: Scientific Tools for Python](https://www.scipy.org/)
171
174
  - [timescale: Python tools for time and astronomical calculations](https://pypi.org/project/timescale/)
@@ -208,7 +211,7 @@ It should not be used for coastal navigation or any application that may risk li
208
211
 
209
212
  ## Contributing
210
213
 
211
- This project contains work and contributions from the [scientific community](./CONTRIBUTORS.rst).
214
+ This project contains work and contributions from the [scientific community](./CONTRIBUTORS.md).
212
215
  If you would like to contribute to the project, please have a look at the [contribution guidelines](./doc/source/getting_started/Contributing.rst), [open issues](https://github.com/pyTMD/pyTMD/issues) and [discussions board](https://github.com/pyTMD/pyTMD/discussions).
213
216
 
214
217
  ## Credits
@@ -72,6 +72,7 @@ This will automatically create the environment, install all dependencies, and la
72
72
  - [lxml: processing XML and HTML in Python](https://pypi.python.org/pypi/lxml)
73
73
  - [netCDF4: Python interface to the netCDF C library](https://unidata.github.io/netcdf4-python/)
74
74
  - [numpy: Scientific Computing Tools For Python](https://www.numpy.org)
75
+ - [platformdirs: Python module for determining platform-specific directories](https://pypi.org/project/platformdirs/)
75
76
  - [pyproj: Python interface to PROJ library](https://pypi.org/project/pyproj/)
76
77
  - [scipy: Scientific Tools for Python](https://www.scipy.org/)
77
78
  - [timescale: Python tools for time and astronomical calculations](https://pypi.org/project/timescale/)
@@ -114,7 +115,7 @@ It should not be used for coastal navigation or any application that may risk li
114
115
 
115
116
  ## Contributing
116
117
 
117
- This project contains work and contributions from the [scientific community](./CONTRIBUTORS.rst).
118
+ This project contains work and contributions from the [scientific community](./CONTRIBUTORS.md).
118
119
  If you would like to contribute to the project, please have a look at the [contribution guidelines](./doc/source/getting_started/Contributing.rst), [open issues](https://github.com/pyTMD/pyTMD/issues) and [discussions board](https://github.com/pyTMD/pyTMD/discussions).
119
120
 
120
121
  ## Credits
@@ -22,19 +22,17 @@ import pyTMD.spatial
22
22
  import pyTMD.tools
23
23
  import pyTMD.utilities
24
24
  import pyTMD.version
25
+ from pyTMD import datasets
25
26
  from pyTMD import io
26
27
  from pyTMD import solve
27
28
  from pyTMD.crs import crs
28
29
 
29
30
  # Deprecated functions
30
- from pyTMD.compute_tide_corrections import (
31
- compute_corrections,
32
- compute_tide_corrections,
33
- compute_LPET_corrections,
34
- compute_LPT_corrections,
35
- compute_OPT_corrections,
36
- compute_SET_corrections,
37
- )
31
+ def compute_tide_corrections(*args, **kwargs):
32
+ """Wrapper function to compute tide corrections
33
+ Deprecated, use :func:`pyTMD.compute.tide_elevations` instead
34
+ """
35
+ return pyTMD.compute.tide_elevations(*args, **kwargs)
38
36
 
39
37
  # get version information
40
38
  __version__ = pyTMD.version.version
@@ -40,6 +40,7 @@ REFERENCES:
40
40
 
41
41
  UPDATE HISTORY:
42
42
  Updated 09/2025: added spherical harmonic degree to tide potential tables
43
+ added IERS Conventions references for Love number calculations
43
44
  Updated 08/2025: add Cartwright and Tayler table with radiational tides
44
45
  make frequency function a wrapper around one that calculates using
45
46
  Doodson coefficients (Cartwright numbers)
@@ -1929,7 +1930,7 @@ def _complex_love_numbers(
1929
1930
  omega: np.ndarray
1930
1931
  angular frequency (radians per second)
1931
1932
  kwargs: dict
1932
- additional keyword arguments for love number calculation
1933
+ additional keyword arguments for Love number calculation
1933
1934
 
1934
1935
  Returns
1935
1936
  -------
@@ -1940,20 +1941,24 @@ def _complex_love_numbers(
1940
1941
  l2: complex
1941
1942
  Degree-2 Love (Shida) number of horizontal displacement
1942
1943
  """
1943
- # (number of sidereal days per solar day)
1944
+ # number of sidereal days per solar day
1944
1945
  sidereal_ratio = 1.002737909
1945
- # number of seconds in a sidereal day (approx 86164.1)
1946
+ # number of seconds in a sidereal day (approximately 86164.1)
1946
1947
  sidereal_day = 86400.0/sidereal_ratio
1947
1948
  # frequency in cycles per sidereal day
1948
1949
  f = omega*sidereal_day/(2.0*np.pi)
1949
1950
  # Love numbers for different frequency bands
1950
1951
  if (omega == 0.0):
1951
- # use real-valued body tide love numbers for permanent tide
1952
+ # use real-valued body tide Love numbers for the permanent tide
1953
+ # to prevent singularities in frequency-dependent model
1952
1954
  h2, k2, l2 = _love_numbers(omega, **kwargs)
1953
1955
  elif (omega > 1e-4):
1954
1956
  # in-phase and out-of-phase components for the semi-diurnal band
1955
- h2 = 0.6078 - 0.0022j
1957
+ # table 7.3a (IERS conventions 2010)
1958
+ h2 = 0.6078 - 0.0025j
1959
+ # table 6.5c (IERS conventions 2010)
1956
1960
  k2 = 0.30102 - 0.0013j
1961
+ # table 7.3a (IERS conventions 2010)
1957
1962
  l2 = 0.0847 - 0.0007j
1958
1963
  elif (omega < 2e-5):
1959
1964
  # compute in-phase and out-of-phase components for the long period band
@@ -1963,9 +1968,12 @@ def _complex_love_numbers(
1963
1968
  fm = sidereal_day/200.0
1964
1969
  factor = np.tan(alpha*np.pi/2.0)**(-1)
1965
1970
  anelasticity_model = factor*(1.0 - (fm/f)**alpha) + 1j*(fm/f)**alpha
1966
- # model for the variation of love numbers across the zonal tide band
1971
+ # model for the variation of Love numbers across the zonal tide band
1972
+ # equation 7.4a (IERS conventions 2010)
1967
1973
  h2 = 0.5998 - 9.96e-4*anelasticity_model
1974
+ # equation 6.12 (IERS conventions 2010)
1968
1975
  k2 = 0.29525 - 5.796e-4*anelasticity_model
1976
+ # equation 7.4b (IERS conventions 2010)
1969
1977
  l2 = 0.0831 - 3.01e-4*anelasticity_model
1970
1978
  else:
1971
1979
  # in-phase and out-of-phase components for the diurnal band
@@ -1981,31 +1989,35 @@ def _complex_love_numbers(
1981
1989
  sigma[2] = 1.0023181 + 0.000025j
1982
1990
  # prograde free core nutation
1983
1991
  sigma[3] = 0.999026 + 0.000780j
1984
- # frequency dependence of Love number h2
1992
+ # frequency dependence of Love number h2 (vertical)
1993
+ # table 7.1 (IERS conventions 2010)
1985
1994
  H2 = np.zeros((4), dtype=np.complex128)
1986
1995
  H2[0] = 0.60671 - 0.242e-2j
1987
1996
  H2[1] = -0.15777e-2 - 0.7630e-4j
1988
1997
  H2[2] = 0.18053e-3 - 0.6292e-5j
1989
1998
  H2[3] = -0.18616e-5 + 0.1379e-6j
1990
- # frequency dependence of Love number k2
1999
+ # frequency dependence of Love number k2 (potential)
2000
+ # table 6.4 (IERS conventions 2010)
1991
2001
  K2 = np.zeros((4), dtype=np.complex128)
1992
2002
  K2[0] = 0.29954 - 0.1412e-2j
1993
2003
  K2[1] = -0.77896e-3 - 0.3711e-4j
1994
2004
  K2[2] = 0.90963e-4 - 0.2963e-5j
1995
2005
  K2[3] = -0.11416e-5 + 0.5325e-7j
1996
- # frequency dependence of Love number l2
2006
+ # frequency dependence of Love number l2 (horizontal)
2007
+ # table 7.1 (IERS conventions 2010)
1997
2008
  L2 = np.zeros((4), dtype=np.complex128)
1998
2009
  L2[0] = 0.84963e-1 - 0.7395e-3j
1999
2010
  L2[1] = -0.22107e-3 - 0.9646e-5j
2000
2011
  L2[2] = -0.54710e-5 - 0.2990e-6j
2001
2012
  L2[3] = -0.29904e-7 - 0.7717e-8j
2002
- # estimate the complex Love number fors diurnal tides
2003
- # equation 6.9 of IERS conventions 2010
2013
+ # estimate the complex Love numbers for diurnal tides
2014
+ # equation 6.9 (IERS conventions 2010)
2004
2015
  h2 = np.sum(H2/(f - sigma))
2005
2016
  k2 = np.sum(K2/(f - sigma))
2006
2017
  l2 = np.sum(L2/(f - sigma))
2007
2018
 
2008
2019
  # return the Love numbers as a complex number
2020
+ # to include the in-phase and out-of-phase components
2009
2021
  return np.array([h2, k2, l2], dtype=np.complex128)
2010
2022
 
2011
2023
  # Doodson (1921) table with values missing from Cartwright tables
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  u"""
3
3
  astro.py
4
- Written by Tyler Sutterley (09/2025)
4
+ Written by Tyler Sutterley (10/2025)
5
5
  Astronomical and nutation routines
6
6
 
7
7
  PYTHON DEPENDENCIES:
@@ -18,6 +18,7 @@ REFERENCES:
18
18
  Oliver Montenbruck, Practical Ephemeris Calculations, 1989.
19
19
 
20
20
  UPDATE HISTORY:
21
+ Updated 10/2025: change default directory for JPL SSD kernels to cache
21
22
  Updated 09/2025: added function to compute the planetary mean longitudes
22
23
  Updated 08/2025: convert angles with numpy radians and degrees functions
23
24
  convert arcseconds to radians with asec2rad function in math.py
@@ -78,6 +79,7 @@ from pyTMD.math import (
78
79
  )
79
80
  from pyTMD.utilities import (
80
81
  get_data_path,
82
+ get_cache_path,
81
83
  import_dependency,
82
84
  from_jpl_ssd
83
85
  )
@@ -116,7 +118,7 @@ __all__ = [
116
118
  ]
117
119
 
118
120
  # default JPL Spacecraft and Planet ephemerides kernel
119
- _default_kernel = get_data_path(['data','de440s.bsp'])
121
+ _default_kernel = get_cache_path('de440s.bsp')
120
122
 
121
123
  # number of days between the Julian day epoch and MJD
122
124
  _jd_mjd = 2400000.5
@@ -282,10 +284,10 @@ def planetary_longitudes(MJD: np.ndarray):
282
284
  mercury_longitude = np.array([252.250906, 149474.0722491, 3.035e-4, 1.8e-8])
283
285
  LMe = polynomial_sum(mercury_longitude, T)
284
286
  # mean longitudes of Venus
285
- venus_longitude = np.array([181.9798001, 58519.2130302, 3.1014e-4, 1.5e-8])
287
+ venus_longitude = np.array([181.979801, 58519.2130302, 3.1014e-4, 1.5e-8])
286
288
  LVe = polynomial_sum(venus_longitude, T)
287
289
  # mean longitudes of Mars
288
- mars_longitude = np.array([355.433, 19141.6964471, 3.1052e-4, 1.e-8])
290
+ mars_longitude = np.array([355.433, 19141.6964471, 3.1052e-4, 1.6e-8])
289
291
  LMa = polynomial_sum(mars_longitude, T)
290
292
  # mean longitudes of Jupiter
291
293
  jupiter_longitude = np.array([34.351519, 3036.3027748, 2.233e-4, 3.7e-8])
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  u"""
3
3
  compute.py
4
- Written by Tyler Sutterley (09/2025)
4
+ Written by Tyler Sutterley (10/2025)
5
5
  Calculates tidal elevations for correcting elevation or imagery data
6
6
  Calculates tidal currents at locations and times
7
7
 
@@ -63,6 +63,7 @@ PROGRAM DEPENDENCIES:
63
63
  interpolate.py: interpolation routines for spatial data
64
64
 
65
65
  UPDATE HISTORY:
66
+ Updated 10/2025: change default directory for tide models to cache
66
67
  Updated 09/2025: added wrapper for calculating solid earth tides
67
68
  using a tide potential catalog following Cartwright and Tayler (1971)
68
69
  Updated 08/2025: convert angles with numpy radians and degrees functions
@@ -175,7 +176,7 @@ __all__ = [
175
176
  _jd_mjd = 2400000.5
176
177
 
177
178
  # default working data directory for tide models
178
- _default_directory = pyTMD.utilities.get_data_path('data')
179
+ _default_directory = pyTMD.utilities.get_cache_path()
179
180
 
180
181
  # PURPOSE: wrapper function for computing values
181
182
  def corrections(