Skip to content

Commit

Permalink
fix: verify coordinate dimensions for each input data type
Browse files Browse the repository at this point in the history
increase version number to 1.0.5
  • Loading branch information
tsutterley committed Dec 28, 2021
1 parent 0df213a commit c338b75
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion pyTMD/compute_tide_corrections.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
UPDATE HISTORY:
Updated 12/2021: added function to calculate a tidal time series
verify coordinate dimensions for each input data type
Updated 09/2021: refactor to use model class for files and attributes
Updated 07/2021: can use numpy datetime arrays as input time variable
added function for determining the input spatial variable type
Expand Down Expand Up @@ -184,9 +185,13 @@ def compute_tide_corrections(x, y, delta_time, DIRECTORY=None, MODEL=None,
if not TYPE:
TYPE = pyTMD.spatial.data_type(x, y, delta_time)
#-- reform coordinate dimensions for input grids
#-- or verify coordinate dimension shapes
if (TYPE.lower() == 'grid') and (np.size(x) != np.size(y)):
x,y = np.meshgrid(np.copy(x),np.copy(y))
elif (TYPE.lower() == 'time series'):
elif (TYPE.lower() == 'grid'):
x = np.atleast_2d(x)
y = np.atleast_2d(y)
elif TYPE.lower() in ('time series', 'drift'):
x = np.atleast_1d(x)
y = np.atleast_1d(y)

Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.4.0
1.0.5

0 comments on commit c338b75

Please sign in to comment.