Skip to content

Commit

Permalink
fix: FES2022 have masked longitudes
Browse files Browse the repository at this point in the history
  • Loading branch information
tsutterley committed Jul 14, 2024
1 parent dd8143f commit db1746c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pyTMD/io/FES.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
UPDATE HISTORY:
Updated 07/2024: added new FES2022 to available known model versions
FES2022 have masked longitudes, only extract longitude data
Updated 01/2024: attempt to extract constituent IDs from filenames
Updated 06/2023: extract ocean tide model variables for FES2012
Updated 04/2023: added global HAMTIDE11 model
Expand Down Expand Up @@ -675,18 +676,18 @@ def read_netcdf_file(
# variable dimensions for each model
# amplitude and phase components for each type
if kwargs['version'] in ('FES2012',):
lon = fileID.variables['lon'][:]
lat = fileID.variables['lat'][:]
lon = fileID.variables['lon'][:].data
lat = fileID.variables['lat'][:].data

Check warning on line 680 in pyTMD/io/FES.py

View check run for this annotation

Codecov / codecov/patch

pyTMD/io/FES.py#L679-L680

Added lines #L679 - L680 were not covered by tests
amp_key = dict(z='Ha', u='Ua', v='Va')[kwargs['type']]
phase_key = dict(z='Hg', u='Ug', v='Vg')[kwargs['type']]
elif kwargs['version'] in ('FES2014','FES2022','EOT20'):
lon = fileID.variables['lon'][:]
lat = fileID.variables['lat'][:]
lon = fileID.variables['lon'][:].data
lat = fileID.variables['lat'][:].data
amp_key = dict(z='amplitude', u='Ua', v='Va')[kwargs['type']]
phase_key = dict(z='phase', u='Ug', v='Vg')[kwargs['type']]
elif kwargs['version'] in ('HAMTIDE11',):
lon = fileID.variables['LON'][:]
lat = fileID.variables['LAT'][:]
lon = fileID.variables['LON'][:].data
lat = fileID.variables['LAT'][:].data

Check warning on line 690 in pyTMD/io/FES.py

View check run for this annotation

Codecov / codecov/patch

pyTMD/io/FES.py#L689-L690

Added lines #L689 - L690 were not covered by tests
amp_key = dict(z='AMPL', u='UAMP', v='VAMP')[kwargs['type']]
phase_key = dict(z='PHAS', u='UPHA', v='VPHA')[kwargs['type']]
# get amplitude and phase components
Expand Down

0 comments on commit db1746c

Please sign in to comment.