pyTMD 2.2.0__tar.gz → 2.2.1__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 (74) hide show
  1. {pytmd-2.2.0 → pytmd-2.2.1}/CITATION.cff +2 -2
  2. {pytmd-2.2.0 → pytmd-2.2.1}/PKG-INFO +3 -3
  3. {pytmd-2.2.0 → pytmd-2.2.1}/README.rst +1 -1
  4. {pytmd-2.2.0 → pytmd-2.2.1}/providers/AVISO.json +34 -34
  5. {pytmd-2.2.0 → pytmd-2.2.1}/providers/providers.json +21 -0
  6. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/arguments.py +6 -2
  7. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/compute.py +15 -14
  8. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/data/database.json +55 -34
  9. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/io/model.py +4 -2
  10. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/math.py +56 -2
  11. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/predict.py +17 -9
  12. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/utilities.py +68 -2
  13. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD.egg-info/PKG-INFO +3 -3
  14. {pytmd-2.2.0 → pytmd-2.2.1}/pyproject.toml +3 -0
  15. {pytmd-2.2.0 → pytmd-2.2.1}/scripts/aviso_fes_tides.py +9 -5
  16. {pytmd-2.2.0 → pytmd-2.2.1}/scripts/gsfc_got_tides.py +4 -2
  17. {pytmd-2.2.0 → pytmd-2.2.1}/scripts/verify_box_tpxo.py +4 -2
  18. pytmd-2.2.1/version.txt +1 -0
  19. pytmd-2.2.0/version.txt +0 -1
  20. {pytmd-2.2.0 → pytmd-2.2.1}/.gitignore +0 -0
  21. {pytmd-2.2.0 → pytmd-2.2.1}/CODE_OF_CONDUCT.rst +0 -0
  22. {pytmd-2.2.0 → pytmd-2.2.1}/CONTRIBUTORS.rst +0 -0
  23. {pytmd-2.2.0 → pytmd-2.2.1}/LICENSE +0 -0
  24. {pytmd-2.2.0 → pytmd-2.2.1}/MANIFEST.in +0 -0
  25. {pytmd-2.2.0 → pytmd-2.2.1}/providers/ESR.json +0 -0
  26. {pytmd-2.2.0 → pytmd-2.2.1}/providers/GSFC.json +0 -0
  27. {pytmd-2.2.0 → pytmd-2.2.1}/providers/README.rst +0 -0
  28. {pytmd-2.2.0 → pytmd-2.2.1}/providers/TPXO.json +0 -0
  29. {pytmd-2.2.0 → pytmd-2.2.1}/providers/_model_to_database.py +0 -0
  30. {pytmd-2.2.0 → pytmd-2.2.1}/providers/_providers_to_database.py +0 -0
  31. {pytmd-2.2.0 → pytmd-2.2.1}/providers/_update_providers.py +0 -0
  32. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/__init__.py +0 -0
  33. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/astro.py +0 -0
  34. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/check_points.py +0 -0
  35. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/compute_tide_corrections.py +0 -0
  36. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/crs.py +0 -0
  37. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/data/ce1973_tab1.txt +0 -0
  38. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/data/ct1971_tab5.txt +0 -0
  39. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/data/doodson.json +0 -0
  40. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/data/opoleloadcoefcmcor.txt.gz +0 -0
  41. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/data/tab5.2e.txt +0 -0
  42. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/data/tab5.3a.txt +0 -0
  43. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/data/tab5.3b.txt +0 -0
  44. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/ellipse.py +0 -0
  45. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/eop.py +0 -0
  46. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/interpolate.py +0 -0
  47. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/io/ATLAS.py +0 -0
  48. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/io/FES.py +0 -0
  49. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/io/GOT.py +0 -0
  50. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/io/IERS.py +0 -0
  51. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/io/OTIS.py +0 -0
  52. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/io/__init__.py +0 -0
  53. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/io/constituents.py +0 -0
  54. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/solve/__init__.py +0 -0
  55. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/solve/constants.py +0 -0
  56. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/spatial.py +0 -0
  57. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/time.py +0 -0
  58. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/tools.py +0 -0
  59. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD/version.py +0 -0
  60. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD.egg-info/SOURCES.txt +0 -0
  61. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD.egg-info/dependency_links.txt +0 -0
  62. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD.egg-info/requires.txt +0 -0
  63. {pytmd-2.2.0 → pytmd-2.2.1}/pyTMD.egg-info/top_level.txt +0 -0
  64. {pytmd-2.2.0 → pytmd-2.2.1}/scripts/arcticdata_tides.py +0 -0
  65. {pytmd-2.2.0 → pytmd-2.2.1}/scripts/compute_LPET_elevations.py +0 -0
  66. {pytmd-2.2.0 → pytmd-2.2.1}/scripts/compute_LPT_displacements.py +0 -0
  67. {pytmd-2.2.0 → pytmd-2.2.1}/scripts/compute_OPT_displacements.py +0 -0
  68. {pytmd-2.2.0 → pytmd-2.2.1}/scripts/compute_SET_displacements.py +0 -0
  69. {pytmd-2.2.0 → pytmd-2.2.1}/scripts/compute_tidal_currents.py +0 -0
  70. {pytmd-2.2.0 → pytmd-2.2.1}/scripts/compute_tidal_elevations.py +0 -0
  71. {pytmd-2.2.0 → pytmd-2.2.1}/scripts/reduce_OTIS_files.py +0 -0
  72. {pytmd-2.2.0 → pytmd-2.2.1}/scripts/usap_cats_tides.py +0 -0
  73. {pytmd-2.2.0 → pytmd-2.2.1}/setup.cfg +0 -0
  74. {pytmd-2.2.0 → pytmd-2.2.1}/setup.py +0 -0
@@ -36,8 +36,8 @@ url: 'https://pytmd.readthedocs.io'
36
36
  repository: 'https://pypi.org/project/pyTMD'
37
37
  repository-artifact: 'https://anaconda.org/conda-forge/pytmd'
38
38
  doi: "10.5281/zenodo.5555395"
39
- version: "2.2.0"
40
- date-released: "2024-12-20"
39
+ version: "2.2.1"
40
+ date-released: "2025-02-10"
41
41
  keywords:
42
42
  - Ocean Tides
43
43
  - Load Tides
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: pyTMD
3
- Version: 2.2.0
3
+ Version: 2.2.1
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
@@ -204,7 +204,7 @@ Contributing
204
204
  ############
205
205
 
206
206
  This project contains work and contributions from the `scientific community <./CONTRIBUTORS.rst>`_.
207
- If you would like to contribute to the project, please have a look at the `open issues <https://github.com/tsutterley/pyTMD/issues>`_ and the project `code of conduct <./CODE_OF_CONDUCT.rst>`_.
207
+ If you would like to contribute to the project, please have a look at the `open issues <https://github.com/tsutterley/pyTMD/issues>`_ and `discussions board <https://github.com/tsutterley/pyTMD/discussions>`_.
208
208
 
209
209
  Credits
210
210
  #######
@@ -115,7 +115,7 @@ Contributing
115
115
  ############
116
116
 
117
117
  This project contains work and contributions from the `scientific community <./CONTRIBUTORS.rst>`_.
118
- If you would like to contribute to the project, please have a look at the `open issues <https://github.com/tsutterley/pyTMD/issues>`_ and the project `code of conduct <./CODE_OF_CONDUCT.rst>`_.
118
+ If you would like to contribute to the project, please have a look at the `open issues <https://github.com/tsutterley/pyTMD/issues>`_ and `discussions board <https://github.com/tsutterley/pyTMD/discussions>`_.
119
119
 
120
120
  Credits
121
121
  #######
@@ -268,40 +268,40 @@
268
268
  "FES2022": {
269
269
  "format": "FES-netcdf",
270
270
  "model_file": [
271
- "fes2022b/ocean_tide/2n2_fes2022.nc",
272
- "fes2022b/ocean_tide/eps2_fes2022.nc",
273
- "fes2022b/ocean_tide/j1_fes2022.nc",
274
- "fes2022b/ocean_tide/k1_fes2022.nc",
275
- "fes2022b/ocean_tide/k2_fes2022.nc",
276
- "fes2022b/ocean_tide/l2_fes2022.nc",
277
- "fes2022b/ocean_tide/lambda2_fes2022.nc",
278
- "fes2022b/ocean_tide/m2_fes2022.nc",
279
- "fes2022b/ocean_tide/m3_fes2022.nc",
280
- "fes2022b/ocean_tide/m4_fes2022.nc",
281
- "fes2022b/ocean_tide/m6_fes2022.nc",
282
- "fes2022b/ocean_tide/m8_fes2022.nc",
283
- "fes2022b/ocean_tide/mf_fes2022.nc",
284
- "fes2022b/ocean_tide/mks2_fes2022.nc",
285
- "fes2022b/ocean_tide/mm_fes2022.nc",
286
- "fes2022b/ocean_tide/mn4_fes2022.nc",
287
- "fes2022b/ocean_tide/ms4_fes2022.nc",
288
- "fes2022b/ocean_tide/msf_fes2022.nc",
289
- "fes2022b/ocean_tide/msqm_fes2022.nc",
290
- "fes2022b/ocean_tide/mtm_fes2022.nc",
291
- "fes2022b/ocean_tide/mu2_fes2022.nc",
292
- "fes2022b/ocean_tide/n2_fes2022.nc",
293
- "fes2022b/ocean_tide/n4_fes2022.nc",
294
- "fes2022b/ocean_tide/nu2_fes2022.nc",
295
- "fes2022b/ocean_tide/o1_fes2022.nc",
296
- "fes2022b/ocean_tide/p1_fes2022.nc",
297
- "fes2022b/ocean_tide/q1_fes2022.nc",
298
- "fes2022b/ocean_tide/r2_fes2022.nc",
299
- "fes2022b/ocean_tide/s1_fes2022.nc",
300
- "fes2022b/ocean_tide/s2_fes2022.nc",
301
- "fes2022b/ocean_tide/s4_fes2022.nc",
302
- "fes2022b/ocean_tide/sa_fes2022.nc",
303
- "fes2022b/ocean_tide/ssa_fes2022.nc",
304
- "fes2022b/ocean_tide/t2_fes2022.nc"
271
+ "fes2022b/ocean_tide_20241025/2n2_fes2022.nc",
272
+ "fes2022b/ocean_tide_20241025/eps2_fes2022.nc",
273
+ "fes2022b/ocean_tide_20241025/j1_fes2022.nc",
274
+ "fes2022b/ocean_tide_20241025/k1_fes2022.nc",
275
+ "fes2022b/ocean_tide_20241025/k2_fes2022.nc",
276
+ "fes2022b/ocean_tide_20241025/l2_fes2022.nc",
277
+ "fes2022b/ocean_tide_20241025/lambda2_fes2022.nc",
278
+ "fes2022b/ocean_tide_20241025/m2_fes2022.nc",
279
+ "fes2022b/ocean_tide_20241025/m3_fes2022.nc",
280
+ "fes2022b/ocean_tide_20241025/m4_fes2022.nc",
281
+ "fes2022b/ocean_tide_20241025/m6_fes2022.nc",
282
+ "fes2022b/ocean_tide_20241025/m8_fes2022.nc",
283
+ "fes2022b/ocean_tide_20241025/mf_fes2022.nc",
284
+ "fes2022b/ocean_tide_20241025/mks2_fes2022.nc",
285
+ "fes2022b/ocean_tide_20241025/mm_fes2022.nc",
286
+ "fes2022b/ocean_tide_20241025/mn4_fes2022.nc",
287
+ "fes2022b/ocean_tide_20241025/ms4_fes2022.nc",
288
+ "fes2022b/ocean_tide_20241025/msf_fes2022.nc",
289
+ "fes2022b/ocean_tide_20241025/msqm_fes2022.nc",
290
+ "fes2022b/ocean_tide_20241025/mtm_fes2022.nc",
291
+ "fes2022b/ocean_tide_20241025/mu2_fes2022.nc",
292
+ "fes2022b/ocean_tide_20241025/n2_fes2022.nc",
293
+ "fes2022b/ocean_tide_20241025/n4_fes2022.nc",
294
+ "fes2022b/ocean_tide_20241025/nu2_fes2022.nc",
295
+ "fes2022b/ocean_tide_20241025/o1_fes2022.nc",
296
+ "fes2022b/ocean_tide_20241025/p1_fes2022.nc",
297
+ "fes2022b/ocean_tide_20241025/q1_fes2022.nc",
298
+ "fes2022b/ocean_tide_20241025/r2_fes2022.nc",
299
+ "fes2022b/ocean_tide_20241025/s1_fes2022.nc",
300
+ "fes2022b/ocean_tide_20241025/s2_fes2022.nc",
301
+ "fes2022b/ocean_tide_20241025/s4_fes2022.nc",
302
+ "fes2022b/ocean_tide_20241025/sa_fes2022.nc",
303
+ "fes2022b/ocean_tide_20241025/ssa_fes2022.nc",
304
+ "fes2022b/ocean_tide_20241025/t2_fes2022.nc"
305
305
  ],
306
306
  "name": "FES2022",
307
307
  "reference": "https://doi.org/10.24400/527896/A01-2024.004",
@@ -81,6 +81,27 @@
81
81
  "type": "z",
82
82
  "variable": "tide_ocean"
83
83
  },
84
+ "DTU23": {
85
+ "format": "GOT-ascii",
86
+ "model_file": [
87
+ "DTU23_OceanTide/DTU23/K1_DTU23.d",
88
+ "DTU23_OceanTide/DTU23/K2_DTU23.d",
89
+ "DTU23_OceanTide/DTU23/M2_DTU23.d",
90
+ "DTU23_OceanTide/DTU23/M4_DTU23.d",
91
+ "DTU23_OceanTide/DTU23/N2_DTU23.d",
92
+ "DTU23_OceanTide/DTU23/O1_DTU23.d",
93
+ "DTU23_OceanTide/DTU23/P1_DTU23.d",
94
+ "DTU23_OceanTide/DTU23/Q1_DTU23.d",
95
+ "DTU23_OceanTide/DTU23/S1_DTU23.d",
96
+ "DTU23_OceanTide/DTU23/S2_DTU23.d"
97
+ ],
98
+ "name": "DTU23",
99
+ "reference": "https://doi.org/10.3390/rs15184479",
100
+ "scale": 0.01,
101
+ "type": "z",
102
+ "variable": "tide_ocean",
103
+ "version": "2023"
104
+ },
84
105
  "EOT20": {
85
106
  "format": "FES-netcdf",
86
107
  "model_file": [
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  u"""
3
3
  arguments.py
4
- Written by Tyler Sutterley (12/2024)
4
+ Written by Tyler Sutterley (02/2025)
5
5
  Calculates the nodal corrections for tidal constituents
6
6
  Modification of ARGUMENTS fortran subroutine by Richard Ray 03/1999
7
7
 
@@ -39,6 +39,7 @@ REFERENCES:
39
39
  Ocean Tides", Journal of Atmospheric and Oceanic Technology, (2002).
40
40
 
41
41
  UPDATE HISTORY:
42
+ Updated 02/2025: add option to make doodson numbers strings
42
43
  Updated 12/2024: added function to calculate tidal aliasing periods
43
44
  Updated 11/2024: allow variable case for Doodson number formalisms
44
45
  fix species in constituent parameters for complex tides
@@ -1542,6 +1543,8 @@ def _to_doodson_number(coef: list | np.ndarray, **kwargs):
1542
1543
  ----------
1543
1544
  coef: list or np.ndarray
1544
1545
  Doodson coefficients (Cartwright numbers) for constituent
1546
+ astype: type, default float
1547
+ Output data type for default case
1545
1548
  raise_error: bool, default True
1546
1549
  Raise exception if constituent is unsupported
1547
1550
 
@@ -1552,6 +1555,7 @@ def _to_doodson_number(coef: list | np.ndarray, **kwargs):
1552
1555
  """
1553
1556
  # default keyword arguments
1554
1557
  kwargs.setdefault('raise_error', True)
1558
+ astype = kwargs.get('astype', float)
1555
1559
  # assert length and verify array
1556
1560
  coef = np.array(coef[:6]).astype(int)
1557
1561
  # add 5 to values following Doodson convention (prevent negatives)
@@ -1569,7 +1573,7 @@ def _to_doodson_number(coef: list | np.ndarray, **kwargs):
1569
1573
  else:
1570
1574
  # convert to single number and round off floating point errors
1571
1575
  DO = np.sum([v*10**(2-o) for o,v in enumerate(coef)])
1572
- return np.round(DO, decimals=3)
1576
+ return np.round(DO, decimals=3).astype(astype)
1573
1577
 
1574
1578
  def _to_extended_doodson(coef: list | np.ndarray, **kwargs):
1575
1579
  """
@@ -153,6 +153,7 @@ __all__ = [
153
153
  "corrections",
154
154
  "tide_elevations",
155
155
  "tide_currents",
156
+ "tide_masks",
156
157
  "LPET_elevations",
157
158
  "LPT_displacements",
158
159
  "OPT_displacements",
@@ -219,7 +220,7 @@ def tide_elevations(
219
220
  CROP: bool = False,
220
221
  BOUNDS: list | np.ndarray | None = None,
221
222
  BUFFER: int | float | None = None,
222
- EPSG: str | int = 3031,
223
+ EPSG: str | int = 4326,
223
224
  EPOCH: list | tuple = (2000, 1, 1, 0, 0, 0),
224
225
  TYPE: str | None = 'drift',
225
226
  TIME: str = 'UTC',
@@ -260,7 +261,7 @@ def tide_elevations(
260
261
  Boundaries for cropping tide model data
261
262
  BUFFER: int, float or NoneType, default None
262
263
  Buffer distance for cropping tide model data
263
- EPSG: int, default: 3031 (Polar Stereographic South, WGS84)
264
+ EPSG: int, default: 4326 (WGS84 Latitude and Longitude)
264
265
  Input coordinate system
265
266
  EPOCH: tuple, default (2000,1,1,0,0,0)
266
267
  Time period for calculating delta times
@@ -447,7 +448,7 @@ def tide_currents(
447
448
  CROP: bool = False,
448
449
  BOUNDS: list | np.ndarray | None = None,
449
450
  BUFFER: int | float | None = None,
450
- EPSG: str | int = 3031,
451
+ EPSG: str | int = 4326,
451
452
  EPOCH: list | tuple = (2000, 1, 1, 0, 0, 0),
452
453
  TYPE: str | None = 'drift',
453
454
  TIME: str = 'UTC',
@@ -486,7 +487,7 @@ def tide_currents(
486
487
  Boundaries for cropping tide model data
487
488
  BUFFER: int, float or NoneType, default None
488
489
  Buffer distance for cropping tide model data
489
- EPSG: int, default: 3031 (Polar Stereographic South, WGS84)
490
+ EPSG: int, default: 4326 (WGS84 Latitude and Longitude)
490
491
  Input coordinate system
491
492
  EPOCH: tuple, default (2000,1,1,0,0,0)
492
493
  Time period for calculating delta times
@@ -666,7 +667,7 @@ def tide_masks(x: np.ndarray, y: np.ndarray,
666
667
  MODEL: str | None = None,
667
668
  GZIP: bool = False,
668
669
  DEFINITION_FILE: str | pathlib.Path | None = None,
669
- EPSG: str | int = 3031,
670
+ EPSG: str | int = 4326,
670
671
  METHOD: str = 'spline'
671
672
  ):
672
673
  """
@@ -686,7 +687,7 @@ def tide_masks(x: np.ndarray, y: np.ndarray,
686
687
  Tide model files are gzip compressed
687
688
  DEFINITION_FILE: str or NoneType, default None
688
689
  Tide model definition file for use
689
- EPSG: str or int, default: 3031 (Polar Stereographic South, WGS84)
690
+ EPSG: str or int, default: 4326 (WGS84 Latitude and Longitude)
690
691
  Input coordinate system
691
692
  METHOD: str, default 'spline'
692
693
  interpolation method
@@ -794,7 +795,7 @@ def tide_masks(x: np.ndarray, y: np.ndarray,
794
795
  # PURPOSE: compute long-period equilibrium tidal elevations
795
796
  def LPET_elevations(
796
797
  x: np.ndarray, y: np.ndarray, delta_time: np.ndarray,
797
- EPSG: str | int = 3031,
798
+ EPSG: str | int = 4326,
798
799
  EPOCH: list | tuple = (2000, 1, 1, 0, 0, 0),
799
800
  TYPE: str | None = 'drift',
800
801
  TIME: str = 'UTC',
@@ -811,7 +812,7 @@ def LPET_elevations(
811
812
  y-coordinates in projection EPSG
812
813
  delta_time: np.ndarray
813
814
  seconds since EPOCH or datetime array
814
- EPSG: int, default: 3031 (Polar Stereographic South, WGS84)
815
+ EPSG: int, default: 4326 (WGS84 Latitude and Longitude)
815
816
  Input coordinate system
816
817
  EPOCH: tuple, default (2000,1,1,0,0,0)
817
818
  Time period for calculating delta times
@@ -899,7 +900,7 @@ def LPET_elevations(
899
900
  # following IERS Convention (2010) guidelines
900
901
  def LPT_displacements(
901
902
  x: np.ndarray, y: np.ndarray, delta_time: np.ndarray,
902
- EPSG: str | int = 3031,
903
+ EPSG: str | int = 4326,
903
904
  EPOCH: list | tuple = (2000, 1, 1, 0, 0, 0),
904
905
  TYPE: str | None = 'drift',
905
906
  TIME: str = 'UTC',
@@ -920,7 +921,7 @@ def LPT_displacements(
920
921
  y-coordinates in projection EPSG
921
922
  delta_time: np.ndarray
922
923
  seconds since EPOCH or datetime array
923
- EPSG: int, default: 3031 (Polar Stereographic South, WGS84)
924
+ EPSG: int, default: 4326 (WGS84 Latitude and Longitude)
924
925
  Input coordinate system
925
926
  EPOCH: tuple, default (2000,1,1,0,0,0)
926
927
  Time period for calculating delta times
@@ -1099,7 +1100,7 @@ def LPT_displacements(
1099
1100
  # following IERS Convention (2010) guidelines
1100
1101
  def OPT_displacements(
1101
1102
  x: np.ndarray, y: np.ndarray, delta_time: np.ndarray,
1102
- EPSG: str | int = 3031,
1103
+ EPSG: str | int = 4326,
1103
1104
  EPOCH: list | tuple = (2000, 1, 1, 0, 0, 0),
1104
1105
  TYPE: str | None = 'drift',
1105
1106
  TIME: str = 'UTC',
@@ -1121,7 +1122,7 @@ def OPT_displacements(
1121
1122
  y-coordinates in projection EPSG
1122
1123
  delta_time: np.ndarray
1123
1124
  seconds since EPOCH or datetime array
1124
- EPSG: int, default: 3031 (Polar Stereographic South, WGS84)
1125
+ EPSG: int, default: 4326 (WGS84 Latitude and Longitude)
1125
1126
  Input coordinate system
1126
1127
  EPOCH: tuple, default (2000,1,1,0,0,0)
1127
1128
  Time period for calculating delta times
@@ -1327,7 +1328,7 @@ def OPT_displacements(
1327
1328
  # PURPOSE: compute solid earth tidal elevations
1328
1329
  def SET_displacements(
1329
1330
  x: np.ndarray, y: np.ndarray, delta_time: np.ndarray,
1330
- EPSG: str | int = 3031,
1331
+ EPSG: str | int = 4326,
1331
1332
  EPOCH: list | tuple = (2000, 1, 1, 0, 0, 0),
1332
1333
  TYPE: str | None = 'drift',
1333
1334
  TIME: str = 'UTC',
@@ -1348,7 +1349,7 @@ def SET_displacements(
1348
1349
  y-coordinates in projection EPSG
1349
1350
  delta_time: np.ndarray
1350
1351
  seconds since EPOCH or datetime array
1351
- EPSG: int, default: 3031 (Polar Stereographic South, WGS84)
1352
+ EPSG: int, default: 4326 (WGS84 Latitude and Longitude)
1352
1353
  Input coordinate system
1353
1354
  EPOCH: tuple, default (2000,1,1,0,0,0)
1354
1355
  Time period for calculating delta times
@@ -985,6 +985,27 @@
985
985
  "type": "z",
986
986
  "variable": "tide_load"
987
987
  },
988
+ "DTU23": {
989
+ "format": "GOT-ascii",
990
+ "model_file": [
991
+ "DTU23_OceanTide/DTU23/K1_DTU23.d",
992
+ "DTU23_OceanTide/DTU23/K2_DTU23.d",
993
+ "DTU23_OceanTide/DTU23/M2_DTU23.d",
994
+ "DTU23_OceanTide/DTU23/M4_DTU23.d",
995
+ "DTU23_OceanTide/DTU23/N2_DTU23.d",
996
+ "DTU23_OceanTide/DTU23/O1_DTU23.d",
997
+ "DTU23_OceanTide/DTU23/P1_DTU23.d",
998
+ "DTU23_OceanTide/DTU23/Q1_DTU23.d",
999
+ "DTU23_OceanTide/DTU23/S1_DTU23.d",
1000
+ "DTU23_OceanTide/DTU23/S2_DTU23.d"
1001
+ ],
1002
+ "name": "DTU23",
1003
+ "reference": "https://doi.org/10.3390/rs15184479",
1004
+ "scale": 0.01,
1005
+ "type": "z",
1006
+ "variable": "tide_ocean",
1007
+ "version": "2023"
1008
+ },
988
1009
  "EOT20": {
989
1010
  "format": "FES-netcdf",
990
1011
  "model_file": [
@@ -1222,40 +1243,40 @@
1222
1243
  "FES2022": {
1223
1244
  "format": "FES-netcdf",
1224
1245
  "model_file": [
1225
- "fes2022b/ocean_tide/2n2_fes2022.nc",
1226
- "fes2022b/ocean_tide/eps2_fes2022.nc",
1227
- "fes2022b/ocean_tide/j1_fes2022.nc",
1228
- "fes2022b/ocean_tide/k1_fes2022.nc",
1229
- "fes2022b/ocean_tide/k2_fes2022.nc",
1230
- "fes2022b/ocean_tide/l2_fes2022.nc",
1231
- "fes2022b/ocean_tide/lambda2_fes2022.nc",
1232
- "fes2022b/ocean_tide/m2_fes2022.nc",
1233
- "fes2022b/ocean_tide/m3_fes2022.nc",
1234
- "fes2022b/ocean_tide/m4_fes2022.nc",
1235
- "fes2022b/ocean_tide/m6_fes2022.nc",
1236
- "fes2022b/ocean_tide/m8_fes2022.nc",
1237
- "fes2022b/ocean_tide/mf_fes2022.nc",
1238
- "fes2022b/ocean_tide/mks2_fes2022.nc",
1239
- "fes2022b/ocean_tide/mm_fes2022.nc",
1240
- "fes2022b/ocean_tide/mn4_fes2022.nc",
1241
- "fes2022b/ocean_tide/ms4_fes2022.nc",
1242
- "fes2022b/ocean_tide/msf_fes2022.nc",
1243
- "fes2022b/ocean_tide/msqm_fes2022.nc",
1244
- "fes2022b/ocean_tide/mtm_fes2022.nc",
1245
- "fes2022b/ocean_tide/mu2_fes2022.nc",
1246
- "fes2022b/ocean_tide/n2_fes2022.nc",
1247
- "fes2022b/ocean_tide/n4_fes2022.nc",
1248
- "fes2022b/ocean_tide/nu2_fes2022.nc",
1249
- "fes2022b/ocean_tide/o1_fes2022.nc",
1250
- "fes2022b/ocean_tide/p1_fes2022.nc",
1251
- "fes2022b/ocean_tide/q1_fes2022.nc",
1252
- "fes2022b/ocean_tide/r2_fes2022.nc",
1253
- "fes2022b/ocean_tide/s1_fes2022.nc",
1254
- "fes2022b/ocean_tide/s2_fes2022.nc",
1255
- "fes2022b/ocean_tide/s4_fes2022.nc",
1256
- "fes2022b/ocean_tide/sa_fes2022.nc",
1257
- "fes2022b/ocean_tide/ssa_fes2022.nc",
1258
- "fes2022b/ocean_tide/t2_fes2022.nc"
1246
+ "fes2022b/ocean_tide_20241025/2n2_fes2022.nc",
1247
+ "fes2022b/ocean_tide_20241025/eps2_fes2022.nc",
1248
+ "fes2022b/ocean_tide_20241025/j1_fes2022.nc",
1249
+ "fes2022b/ocean_tide_20241025/k1_fes2022.nc",
1250
+ "fes2022b/ocean_tide_20241025/k2_fes2022.nc",
1251
+ "fes2022b/ocean_tide_20241025/l2_fes2022.nc",
1252
+ "fes2022b/ocean_tide_20241025/lambda2_fes2022.nc",
1253
+ "fes2022b/ocean_tide_20241025/m2_fes2022.nc",
1254
+ "fes2022b/ocean_tide_20241025/m3_fes2022.nc",
1255
+ "fes2022b/ocean_tide_20241025/m4_fes2022.nc",
1256
+ "fes2022b/ocean_tide_20241025/m6_fes2022.nc",
1257
+ "fes2022b/ocean_tide_20241025/m8_fes2022.nc",
1258
+ "fes2022b/ocean_tide_20241025/mf_fes2022.nc",
1259
+ "fes2022b/ocean_tide_20241025/mks2_fes2022.nc",
1260
+ "fes2022b/ocean_tide_20241025/mm_fes2022.nc",
1261
+ "fes2022b/ocean_tide_20241025/mn4_fes2022.nc",
1262
+ "fes2022b/ocean_tide_20241025/ms4_fes2022.nc",
1263
+ "fes2022b/ocean_tide_20241025/msf_fes2022.nc",
1264
+ "fes2022b/ocean_tide_20241025/msqm_fes2022.nc",
1265
+ "fes2022b/ocean_tide_20241025/mtm_fes2022.nc",
1266
+ "fes2022b/ocean_tide_20241025/mu2_fes2022.nc",
1267
+ "fes2022b/ocean_tide_20241025/n2_fes2022.nc",
1268
+ "fes2022b/ocean_tide_20241025/n4_fes2022.nc",
1269
+ "fes2022b/ocean_tide_20241025/nu2_fes2022.nc",
1270
+ "fes2022b/ocean_tide_20241025/o1_fes2022.nc",
1271
+ "fes2022b/ocean_tide_20241025/p1_fes2022.nc",
1272
+ "fes2022b/ocean_tide_20241025/q1_fes2022.nc",
1273
+ "fes2022b/ocean_tide_20241025/r2_fes2022.nc",
1274
+ "fes2022b/ocean_tide_20241025/s1_fes2022.nc",
1275
+ "fes2022b/ocean_tide_20241025/s2_fes2022.nc",
1276
+ "fes2022b/ocean_tide_20241025/s4_fes2022.nc",
1277
+ "fes2022b/ocean_tide_20241025/sa_fes2022.nc",
1278
+ "fes2022b/ocean_tide_20241025/ssa_fes2022.nc",
1279
+ "fes2022b/ocean_tide_20241025/t2_fes2022.nc"
1259
1280
  ],
1260
1281
  "name": "FES2022",
1261
1282
  "reference": "https://doi.org/10.24400/527896/A01-2024.004",
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  u"""
3
3
  model.py
4
- Written by Tyler Sutterley (11/2024)
4
+ Written by Tyler Sutterley (02/2025)
5
5
  Retrieves tide model parameters for named tide models and
6
6
  from model definition files
7
7
 
@@ -11,6 +11,7 @@ PYTHON DEPENDENCIES:
11
11
  https://numpy.org/doc/stable/user/numpy-for-matlab-users.html
12
12
 
13
13
  UPDATE HISTORY:
14
+ Updated 02/2025: fixed missing grid kwarg for reading from TMD3 models
14
15
  Updated 11/2024: use Love numbers for long-period tides in node equilibrium
15
16
  Updated 10/2024: add wrapper functions to read and interpolate constants
16
17
  add functions to append node tide equilibrium values to amplitudes
@@ -1077,7 +1078,8 @@ class model:
1077
1078
  model_file = self.model_file
1078
1079
  # read tidal constants for model type
1079
1080
  c = OTIS.read_constants(self.grid_file,
1080
- model_file, self.projection, **kwargs)
1081
+ model_file, self.projection,
1082
+ grid=self.file_format, **kwargs)
1081
1083
  elif self.format in ('ATLAS-netcdf',):
1082
1084
  # extract model file in case of currents
1083
1085
  if isinstance(self.model_file, dict):
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  u"""
3
3
  math.py
4
- Written by Tyler Sutterley (12/2024)
4
+ Written by Tyler Sutterley (01/2025)
5
5
  Special functions of mathematical physics
6
6
 
7
7
  PYTHON DEPENDENCIES:
@@ -12,6 +12,7 @@ PYTHON DEPENDENCIES:
12
12
  https://docs.scipy.org/doc/
13
13
 
14
14
  UPDATE HISTORY:
15
+ Updated 01/2025: added function for fully-normalized Legendre polynomials
15
16
  Updated 12/2024: added function to calculate an aliasing frequency
16
17
  Written 11/2024
17
18
  """
@@ -26,6 +27,7 @@ __all__ = [
26
27
  "rotate",
27
28
  "aliasing",
28
29
  "legendre",
30
+ "assoc_legendre",
29
31
  "sph_harm"
30
32
  ]
31
33
 
@@ -141,7 +143,7 @@ def legendre(
141
143
  Parameters
142
144
  ----------
143
145
  l: int
144
- degree of the Legrendre polynomials (0 to 3)
146
+ degree of the Legendre polynomials (0 to 3)
145
147
  x: np.ndarray
146
148
  elements ranging from -1 to 1
147
149
 
@@ -188,6 +190,58 @@ def legendre(
188
190
  else:
189
191
  return np.pow(-1.0, m)*Plm[l, m, :]
190
192
 
193
+ def assoc_legendre(lmax, x):
194
+ """
195
+ Computes fully-normalized associated Legendre Polynomials using a
196
+ standard forward-column method :cite:p:`Colombo:1981vh`
197
+ :cite:p:`HofmannWellenhof:2006hy`
198
+
199
+ Parameters
200
+ ----------
201
+ lmax: int
202
+ maximum degree and order of Legendre polynomials
203
+ x: np.ndarray
204
+ elements ranging from -1 to 1
205
+
206
+ Typically ``cos(theta)``, where ``theta`` is the colatitude in radians
207
+
208
+ Returns
209
+ -------
210
+ Plm: np.ndarray
211
+ fully-normalized Legendre polynomials
212
+ """
213
+ # verify values are integers
214
+ lmax = np.int64(lmax)
215
+ # verify dimensions
216
+ singular_values = (np.ndim(x) == 0)
217
+ x = np.atleast_1d(x).flatten()
218
+ # if x is the cos of colatitude, u is the sine
219
+ u = np.sqrt(1.0 - x**2)
220
+ # size of the x array
221
+ nx = len(x)
222
+ # allocate for associated legendre functions
223
+ Plm = np.zeros((lmax+1,lmax+1,nx))
224
+ # initial polynomials for the recursion
225
+ Plm[0,0,:] = 1.0
226
+ Plm[1,0,:] = np.sqrt(3.0)*x
227
+ Plm[1,1,:] = np.sqrt(3.0)*u
228
+ for l in range(2, lmax+1):
229
+ # normalization factor
230
+ norm = np.sqrt(2.0*l+1.0)
231
+ for m in range(0, l):
232
+ # zonal and tesseral terms (non-sectorial)
233
+ a = np.sqrt((2.0*l-1.0)/((l-m)*(l+m)))
234
+ b = np.sqrt((l+m-1.0)*(l-m-1.0)/((l-m)*(l+m)*(2.0*l-3.0)))
235
+ Plm[l,m,:] = a*norm*x*Plm[l-1,m,:] - b*norm*Plm[l-2,m,:]
236
+ # sectorial terms: serve as seed values for the recursion
237
+ # starting with P00 and P11 (outside the loop)
238
+ Plm[l,l,:] = u*norm*np.sqrt(1.0/(2.0*l))*Plm[l-1,l-1,:]
239
+ # return values
240
+ if singular_values:
241
+ return Plm[:, :, 0]
242
+ else:
243
+ return Plm
244
+
191
245
  def sph_harm(
192
246
  l: int,
193
247
  theta: np.ndarray,
@@ -108,7 +108,8 @@ def map(t: float | np.ndarray,
108
108
  corrections: str = 'OTIS'
109
109
  ):
110
110
  """
111
- Predict tides at a single time using harmonic constants :cite:p:`Egbert:2002ge`
111
+ Predict tides at a single time using harmonic
112
+ constants :cite:p:`Egbert:2002ge`
112
113
 
113
114
  Parameters
114
115
  ----------
@@ -280,8 +281,9 @@ def infer_minor(
280
281
  ):
281
282
  """
282
283
  Infer the tidal values for minor constituents using their
283
- relation with major constituents :cite:p:`Doodson:1941td` :cite:p:`Schureman:1958ty`
284
- :cite:p:`Foreman:1989dt` :cite:p:`Egbert:2002ge`
284
+ relation with major constituents :cite:p:`Doodson:1941td`
285
+ :cite:p:`Schureman:1958ty` :cite:p:`Foreman:1989dt`
286
+ :cite:p:`Egbert:2002ge`
285
287
 
286
288
  Parameters
287
289
  ----------
@@ -497,6 +499,7 @@ def _infer_semi_diurnal(
497
499
  """
498
500
  # set default keyword arguments
499
501
  kwargs.setdefault('deltat', 0.0)
502
+ kwargs.setdefault('corrections', 'GOT')
500
503
  kwargs.setdefault('method', 'linear')
501
504
  kwargs.setdefault('raise_exception', False)
502
505
  # list of minor constituents
@@ -597,8 +600,9 @@ def _infer_semi_diurnal(
597
600
  Ainv = np.array([[3.3133, -4.2538, 1.9405],
598
601
  [-3.3133, 4.2538, -0.9405],
599
602
  [1.5018, -3.2579, 1.7561]])
600
- coef = np.inner(Ainv, z)
601
- # convert frequency to cycles per day
603
+ coef = np.dot(Ainv, z.T)
604
+ # convert frequency to radians per 48 hours
605
+ # following Munk and Cartwright (1966)
602
606
  f = 2.0*omega[k]*86400.0
603
607
  # calculate interpolated values for constituent
604
608
  interp = coef[0,:] + coef[1,:]*np.cos(f) + coef[2,:]*np.sin(f)
@@ -621,7 +625,8 @@ def _infer_diurnal(
621
625
  Infer the tidal values for diurnal minor constituents
622
626
  using their relation with major constituents taking into
623
627
  account resonance due to free core nutation
624
- :cite:p:`Munk:1966go` :cite:p:`Ray:2017jx` :cite:p:`Wahr:1981if` :cite:p:`Cartwright:1973em`
628
+ :cite:p:`Munk:1966go` :cite:p:`Ray:2017jx` :cite:p:`Wahr:1981if`
629
+ :cite:p:`Cartwright:1973em`
625
630
 
626
631
  Parameters
627
632
  ----------
@@ -650,6 +655,7 @@ def _infer_diurnal(
650
655
  """
651
656
  # set default keyword arguments
652
657
  kwargs.setdefault('deltat', 0.0)
658
+ kwargs.setdefault('corrections', 'GOT')
653
659
  kwargs.setdefault('method', 'linear')
654
660
  kwargs.setdefault('raise_exception', False)
655
661
  # list of minor constituents
@@ -761,8 +767,9 @@ def _infer_diurnal(
761
767
  Ainv = np.array([[3.1214, -3.8494, 1.728],
762
768
  [-3.1727, 3.9559, -0.7832],
763
769
  [1.438, -3.0297, 1.5917]])
764
- coef = np.inner(Ainv, z)
765
- # convert frequency to cycles per day
770
+ coef = np.dot(Ainv, z.T)
771
+ # convert frequency to radians per 48 hours
772
+ # following Munk and Cartwright (1966)
766
773
  f = 2.0*omega[k]*86400.0
767
774
  # calculate interpolated values for constituent
768
775
  interp = coef[0,:] + coef[1,:]*np.cos(f) + coef[2,:]*np.sin(f)
@@ -1259,7 +1266,8 @@ def solid_earth_tide(
1259
1266
  ):
1260
1267
  """
1261
1268
  Compute the solid Earth tides due to the gravitational attraction of
1262
- the moon and sun :cite:p:`Mathews:1991kv` :cite:p:`Mathews:1997js` :cite:p:`Ries:1992ip` :cite:p:`Wahr:1981ea`
1269
+ the moon and sun :cite:p:`Mathews:1991kv` :cite:p:`Mathews:1997js`
1270
+ :cite:p:`Ries:1992ip` :cite:p:`Wahr:1981ea`
1263
1271
 
1264
1272
  Parameters
1265
1273
  ----------
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  u"""
3
3
  utilities.py
4
- Written by Tyler Sutterley (08/2024)
4
+ Written by Tyler Sutterley (01/2025)
5
5
  Download and management utilities for syncing time and auxiliary files
6
6
 
7
7
  PYTHON DEPENDENCIES:
@@ -9,6 +9,7 @@ PYTHON DEPENDENCIES:
9
9
  https://pypi.python.org/pypi/lxml
10
10
 
11
11
  UPDATE HISTORY:
12
+ Updated 01/2025: added function to list a directory from the UHSLC
12
13
  Updated 08/2024: generalize hash function to use any available algorithm
13
14
  Updated 07/2024: added function to parse JSON responses from https
14
15
  Updated 06/2024: make default case for an import exception be a class
@@ -112,7 +113,8 @@ __all__ = [
112
113
  "cddis_list",
113
114
  "from_cddis",
114
115
  "iers_list",
115
- "from_jpl_ssd"
116
+ "from_jpl_ssd",
117
+ "uhslc_list"
116
118
  ]
117
119
 
118
120
  # PURPOSE: get absolute path within a package from a relative path
@@ -1567,3 +1569,67 @@ def from_jpl_ssd(
1567
1569
  logging.info('Downloading JPL Planetary Ephemeride Kernel File')
1568
1570
  from_http(HOST, timeout=timeout, context=context, local=local,
1569
1571
  hash=hash, chunk=chunk, verbose=verbose, mode=mode)
1572
+
1573
+ # PURPOSE: list a directory on the University of Hawaii SLC Server
1574
+ def uhslc_list(
1575
+ HOST: str | list,
1576
+ timeout: int | None = None,
1577
+ context: ssl.SSLContext = _default_ssl_context,
1578
+ parser = lxml.etree.HTMLParser(),
1579
+ pattern: str = '',
1580
+ sort: bool = False
1581
+ ):
1582
+ """
1583
+ List a directory from the University of Hawaii Sea Level Center
1584
+
1585
+ Parameters
1586
+ ----------
1587
+ HOST: str or list
1588
+ remote http host path
1589
+ timeout: int or NoneType, default None
1590
+ timeout in seconds for blocking operations
1591
+ context: obj, default pyTMD.utilities._default_ssl_context
1592
+ SSL context for ``urllib`` opener object
1593
+ parser: obj, default lxml.etree.HTMLParser()
1594
+ HTML parser for ``lxml``
1595
+ pattern: str, default ''
1596
+ regular expression pattern for reducing list
1597
+ sort: bool, default False
1598
+ sort output list
1599
+
1600
+ Returns
1601
+ -------
1602
+ colnames: list
1603
+ column names in a directory
1604
+ """
1605
+ # verify inputs for remote http host
1606
+ if isinstance(HOST, str):
1607
+ HOST = url_split(HOST)
1608
+ # try listing from http
1609
+ try:
1610
+ # Create and submit request.
1611
+ request = urllib2.Request(posixpath.join(*HOST))
1612
+ response = urllib2.urlopen(request, timeout=timeout, context=context)
1613
+ except urllib2.HTTPError as exc:
1614
+ logging.debug(exc.code)
1615
+ raise RuntimeError(exc.reason) from exc
1616
+ except urllib2.URLError as exc:
1617
+ logging.debug(exc.reason)
1618
+ msg = 'List error from {0}'.format(posixpath.join(*HOST))
1619
+ raise Exception(msg) from exc
1620
+ else:
1621
+ # read and parse request for files
1622
+ tree = lxml.etree.parse(response, parser)
1623
+ colnames = tree.xpath('//a/text()')
1624
+ # reduce using regular expression pattern
1625
+ if pattern:
1626
+ i = [i for i,f in enumerate(colnames) if re.search(pattern, f)]
1627
+ # reduce list of column names
1628
+ colnames = [colnames[indice] for indice in i]
1629
+ # sort the list
1630
+ if sort:
1631
+ i = [i for i,j in sorted(enumerate(colnames), key=lambda i: i[1])]
1632
+ # sort list of column names
1633
+ colnames = [colnames[indice] for indice in i]
1634
+ # return the list of column names
1635
+ return colnames
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: pyTMD
3
- Version: 2.2.0
3
+ Version: 2.2.1
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
@@ -204,7 +204,7 @@ Contributing
204
204
  ############
205
205
 
206
206
  This project contains work and contributions from the `scientific community <./CONTRIBUTORS.rst>`_.
207
- If you would like to contribute to the project, please have a look at the `open issues <https://github.com/tsutterley/pyTMD/issues>`_ and the project `code of conduct <./CODE_OF_CONDUCT.rst>`_.
207
+ If you would like to contribute to the project, please have a look at the `open issues <https://github.com/tsutterley/pyTMD/issues>`_ and `discussions board <https://github.com/tsutterley/pyTMD/discussions>`_.
208
208
 
209
209
  Credits
210
210
  #######
@@ -101,3 +101,6 @@ omit = [
101
101
  [tool.coverage.report]
102
102
  show_missing = true
103
103
  precision = 2
104
+
105
+ [tool.ruff]
106
+ line-length = 80
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  u"""
3
3
  aviso_fes_tides.py
4
- Written by Tyler Sutterley (07/2024)
4
+ Written by Tyler Sutterley (01/2025)
5
5
  Downloads the FES (Finite Element Solution) global tide model from AVISO
6
6
  Decompresses the model tar files into the constituent files and auxiliary files
7
7
  https://www.aviso.altimetry.fr/data/products/auxiliary-products/
@@ -40,6 +40,8 @@ PROGRAM DEPENDENCIES:
40
40
  utilities.py: download and management utilities for syncing files
41
41
 
42
42
  UPDATE HISTORY:
43
+ Updated 01/2025: new ocean tide directory for latest FES2022 version
44
+ scrubbed use of pathlib.os to just use os directly
43
45
  Updated 07/2024: added list and download for FES2022 tide model
44
46
  compare modification times with remote to not overwrite files
45
47
  Updated 05/2023: added option to change connection timeout
@@ -234,7 +236,9 @@ def aviso_fes_list(MODEL, f, logger,
234
236
  FES = {}
235
237
  # 2022 model
236
238
  FES['FES2022'] = []
237
- FES['FES2022'].append(['fes2022b','ocean_tide'])
239
+ # updated directory for ocean tide model
240
+ # latest version fixes the valid_max attribute for longitudes
241
+ FES['FES2022'].append(['fes2022b','ocean_tide_20241025'])
238
242
  if LOAD:
239
243
  FES['FES2022'].append(['fes2022b','load_tide'])
240
244
  if EXTRAPOLATED:
@@ -320,7 +324,7 @@ def ftp_download(logger, ftp, remote_path, local_dir,
320
324
  shutil.copyfileobj(fi, fo)
321
325
  # get last modified date of remote file within tar file
322
326
  # keep remote modification time of file and local access time
323
- pathlib.os.utime(local_file, (local_file.stat().st_atime, m.mtime))
327
+ os.utime(local_file, (local_file.stat().st_atime, m.mtime))
324
328
  local_file.chmod(mode=MODE)
325
329
  elif LZMA:
326
330
  # get last modified date of remote file and convert into unix time
@@ -350,7 +354,7 @@ def ftp_download(logger, ftp, remote_path, local_dir,
350
354
  shutil.copyfileobj(fi, fo)
351
355
  # get last modified date of remote file within tar file
352
356
  # keep remote modification time of file and local access time
353
- pathlib.os.utime(local_file, (local_file.stat().st_atime, mtime))
357
+ os.utime(local_file, (local_file.stat().st_atime, mtime))
354
358
  local_file.chmod(mode=MODE)
355
359
  else:
356
360
  # copy readme and uncompressed files directly
@@ -375,7 +379,7 @@ def ftp_download(logger, ftp, remote_path, local_dir,
375
379
  with opener(local_file, 'wb') as f:
376
380
  ftp.retrbinary(f'RETR {remote_file}', f.write, blocksize=CHUNK)
377
381
  # keep remote modification time of file and local access time
378
- pathlib.os.utime(local_file, (local_file.stat().st_atime, mtime))
382
+ os.utime(local_file, (local_file.stat().st_atime, mtime))
379
383
  local_file.chmod(mode=MODE)
380
384
 
381
385
  # PURPOSE: compare the modification time of two files
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  u"""
3
3
  gsfc_got_tides.py
4
- Written by Tyler Sutterley (09/2024)
4
+ Written by Tyler Sutterley (01/2025)
5
5
  Download GSFC Global Ocean Tide (GOT) models
6
6
 
7
7
  CALLING SEQUENCE:
@@ -32,12 +32,14 @@ PROGRAM DEPENDENCIES:
32
32
  utilities.py: download and management utilities for syncing files
33
33
 
34
34
  UPDATE HISTORY:
35
+ Updated 01/2025: scrubbed use of pathlib.os to just use os directly
35
36
  Updated 09/2024: added Ray and Erofeeva (2014) long-period tide model
36
37
  Updated 08/2024: keep prime nomenclature for 3rd degree tides
37
38
  Written 07/2024
38
39
  """
39
40
  from __future__ import print_function, annotations
40
41
 
42
+ import os
41
43
  import re
42
44
  import gzip
43
45
  import shutil
@@ -120,7 +122,7 @@ def gsfc_got_tides(MODEL: str,
120
122
  shutil.copyfileobj(fi, fo)
121
123
  # get last modified date of remote file within tar file
122
124
  # keep remote modification time of file and local access time
123
- pathlib.os.utime(local_file, (local_file.stat().st_atime, m.mtime))
125
+ os.utime(local_file, (local_file.stat().st_atime, m.mtime))
124
126
  local_file.chmod(mode=MODE)
125
127
 
126
128
  # PURPOSE: compare the modification time of two files
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env python
2
2
  u"""
3
3
  verify_box_tpxo.py
4
- Written by Tyler Sutterley (09/2024)
4
+ Written by Tyler Sutterley (01/2025)
5
5
  Verifies downloaded TPXO9-atlas global tide models from the box file
6
6
  sharing service
7
7
 
@@ -26,6 +26,7 @@ REFERENCE:
26
26
  https://developer.box.com/guides/
27
27
 
28
28
  UPDATE HISTORY:
29
+ Updated 01/2025: scrubbed use of pathlib.os to just use os directly
29
30
  Updated 09/2024: use model class to define output directory
30
31
  Updated 04/2023: using pathlib to define and expand paths
31
32
  Updated 01/2023: use default context from utilities module
@@ -38,6 +39,7 @@ UPDATE HISTORY:
38
39
  """
39
40
  from __future__ import print_function
40
41
 
42
+ import os
41
43
  import re
42
44
  import json
43
45
  import logging
@@ -132,7 +134,7 @@ def verify_box_tpxo(tide_dir, folder_id, TIDE_MODEL=None,
132
134
  logger.critical(f'Local checksum: {sha1}')
133
135
  raise Exception('Checksum verification failed')
134
136
  # keep remote modification time of file and local access time
135
- pathlib.os.utime(local, (local.stat().st_atime, remote_mtime))
137
+ os.utime(local, (local.stat().st_atime, remote_mtime))
136
138
  # change the permissions mode of the local file
137
139
  local.chmod(mode=MODE)
138
140
 
@@ -0,0 +1 @@
1
+ 2.2.1
pytmd-2.2.0/version.txt DELETED
@@ -1 +0,0 @@
1
- 2.2.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes