diff --git a/pyTMD/arguments.py b/pyTMD/arguments.py index 79cb1b89..2f7b1a64 100755 --- a/pyTMD/arguments.py +++ b/pyTMD/arguments.py @@ -155,7 +155,7 @@ def arguments( fargs = np.c_[tau, s, h, p, n, pp, k] arg = np.dot(fargs, _arguments_table(**kwargs)) - # determine nodal corrections f and u + # trigonometric factors for nodal corrections sinn = np.sin(n*dtr) cosn = np.cos(n*dtr) sin2n = np.sin(2.0*n*dtr) diff --git a/pyTMD/io/OTIS.py b/pyTMD/io/OTIS.py index 7bb031d9..350db8c6 100644 --- a/pyTMD/io/OTIS.py +++ b/pyTMD/io/OTIS.py @@ -1,7 +1,7 @@ #!/usr/bin/env python u""" OTIS.py -Written by Tyler Sutterley (07/2024) +Written by Tyler Sutterley (08/2024) Reads files for a tidal model and makes initial calculations to run tide program Includes functions to extract tidal harmonic constants from OTIS tide models for @@ -59,6 +59,7 @@ interpolate.py: interpolation routines for spatial data UPDATE HISTORY: + Updated 08/2024: revert change and assume crop bounds are projected Updated 07/2024: added crop and bounds keywords for trimming model data convert the crs of bounds when cropping model data Updated 06/2024: change int32 to int to prevent overflows with numpy 2.0 @@ -565,15 +566,11 @@ def read_constants( # crop mask and bathymetry data to (buffered) bounds # or adjust longitudinal convention to fit tide model if kwargs['crop'] and np.any(kwargs['bounds']): - # convert coordinate systems of input bounding box - xbox, ybox = np.meshgrid(kwargs['bounds'][:2], kwargs['bounds'][2:]) - x, y = transformer.transform(xbox, ybox, direction='FORWARD') - bounds = np.array([x.min(), x.max(), y.min(), y.max()]) # crop tide model data mx, my = np.copy(xi), np.copy(yi) - mz, xi, yi = _crop(mz, mx, my, bounds=bounds, + mz, xi, yi = _crop(mz, mx, my, bounds=kwargs['bounds'], is_geographic=is_geographic) - hz, xi, yi = _crop(hz, mx, my, bounds=bounds, + hz, xi, yi = _crop(hz, mx, my, bounds=kwargs['bounds'], is_geographic=is_geographic) # replace original values with extend arrays/matrices @@ -677,7 +674,8 @@ def read_constants( # crop tide model data to (buffered) bounds if kwargs['crop'] and np.any(kwargs['bounds']): hc, _, _ = _crop(hc, mx, my, - bounds=bounds, is_geographic=is_geographic) + bounds=kwargs['bounds'], + is_geographic=is_geographic) # replace original values with extend matrices if is_global: hc = _extend_matrix(hc) diff --git a/pyTMD/io/constituents.py b/pyTMD/io/constituents.py index fe230a38..c2f009e1 100644 --- a/pyTMD/io/constituents.py +++ b/pyTMD/io/constituents.py @@ -1,7 +1,7 @@ #!/usr/bin/env python u""" constituents.py -Written by Tyler Sutterley (07/2024) +Written by Tyler Sutterley (08/2024) Basic tide model constituent class PYTHON DEPENDENCIES: @@ -10,6 +10,7 @@ https://numpy.org/doc/stable/user/numpy-for-matlab-users.html UPDATE HISTORY: + Updated 08/2024: add GOT prime nomenclature for 3rd degree constituents Updated 07/2024: add function to parse tidal constituents from strings Updated 05/2024: make subscriptable and allow item assignment Updated 01/2024: added properties for Doodson and Cartwright numbers @@ -213,10 +214,11 @@ def parse(constituent: str) -> str: 'ms4','mk4',r'(?