Skip to content

Commit

Permalink
fix: output ATLAS netCDFs as nx, ny to match originals
Browse files Browse the repository at this point in the history
  • Loading branch information
tsutterley committed Sep 22, 2023
1 parent 1423709 commit 4d9e600
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions pyTMD/io/ATLAS.py
Original file line number Diff line number Diff line change
Expand Up @@ -911,11 +911,11 @@ def output_netcdf_grid(
nc['lat_u'] = fileID.createVariable('lat_u', lat_u.dtype, ('ny',))
nc['lon_v'] = fileID.createVariable('lon_v', lon_v.dtype, ('nx',))
nc['lat_v'] = fileID.createVariable('lat_v', lat_v.dtype, ('ny',))
nc['hz'] = fileID.createVariable('hz', hz.dtype, ('ny','nx',),
nc['hz'] = fileID.createVariable('hz', hz.dtype, ('nx','ny',),

Check warning on line 914 in pyTMD/io/ATLAS.py

View check run for this annotation

Codecov / codecov/patch

pyTMD/io/ATLAS.py#L914

Added line #L914 was not covered by tests
fill_value=0, zlib=True)
nc['hu'] = fileID.createVariable('hu', hu.dtype, ('ny','nx',),
nc['hu'] = fileID.createVariable('hu', hu.dtype, ('nx','ny',),

Check warning on line 916 in pyTMD/io/ATLAS.py

View check run for this annotation

Codecov / codecov/patch

pyTMD/io/ATLAS.py#L916

Added line #L916 was not covered by tests
fill_value=0, zlib=True)
nc['hv'] = fileID.createVariable('hv', hv.dtype, ('ny','nx',),
nc['hv'] = fileID.createVariable('hv', hv.dtype, ('nx','ny',),

Check warning on line 918 in pyTMD/io/ATLAS.py

View check run for this annotation

Codecov / codecov/patch

pyTMD/io/ATLAS.py#L918

Added line #L918 was not covered by tests
fill_value=0, zlib=True)
# filling the NetCDF variables
nc['lon_z'][:] = lon_z[:]
Expand All @@ -924,9 +924,9 @@ def output_netcdf_grid(
nc['lat_u'][:] = lat_u[:]
nc['lon_v'][:] = lon_v[:]
nc['lat_v'][:] = lat_v[:]
nc['hz'][:] = hz[:]
nc['hu'][:] = hu[:]
nc['hv'][:] = hv[:]
nc['hz'][:] = hz[:].T
nc['hu'][:] = hu[:].T
nc['hv'][:] = hv[:].T

Check warning on line 929 in pyTMD/io/ATLAS.py

View check run for this annotation

Codecov / codecov/patch

pyTMD/io/ATLAS.py#L927-L929

Added lines #L927 - L929 were not covered by tests
# define variable attributes
for TYPE in ('z','u','v'):
# set variable attributes for coordinates
Expand Down Expand Up @@ -992,15 +992,15 @@ def output_netcdf_elevation(
nc = {}
nc['lon_z'] = fileID.createVariable('lon_z', lon_z.dtype, ('nx',))
nc['lat_z'] = fileID.createVariable('lat_z', lat_z.dtype, ('ny',))
nc['hRe'] = fileID.createVariable('hRe', h.real.dtype, ('ny','nx',),
nc['hRe'] = fileID.createVariable('hRe', h.real.dtype, ('nx','ny',),

Check warning on line 995 in pyTMD/io/ATLAS.py

View check run for this annotation

Codecov / codecov/patch

pyTMD/io/ATLAS.py#L995

Added line #L995 was not covered by tests
fill_value=0, zlib=True)
nc['hIm'] = fileID.createVariable('hIm', h.imag.dtype, ('ny','nx',),
nc['hIm'] = fileID.createVariable('hIm', h.imag.dtype, ('nx','ny',),

Check warning on line 997 in pyTMD/io/ATLAS.py

View check run for this annotation

Codecov / codecov/patch

pyTMD/io/ATLAS.py#L997

Added line #L997 was not covered by tests
fill_value=0, zlib=True)
# filling the NetCDF variables
nc['lon_z'][:] = lon_z[:]
nc['lat_z'][:] = lat_z[:]
nc['hRe'][:] = h.real[:]
nc['hIm'][:] = h.imag[:]
nc['hRe'][:] = h.real[:].T
nc['hIm'][:] = h.imag[:].T

Check warning on line 1003 in pyTMD/io/ATLAS.py

View check run for this annotation

Codecov / codecov/patch

pyTMD/io/ATLAS.py#L1002-L1003

Added lines #L1002 - L1003 were not covered by tests
# define variable attributes
complexpart = dict(Re='Real part', Im='Imag part')
# set variable attributes for coordinates
Expand Down Expand Up @@ -1087,23 +1087,23 @@ def output_netcdf_transport(
nc['lat_u'] = fileID.createVariable('lat_u', lat_u.dtype, ('ny',))
nc['lon_v'] = fileID.createVariable('lon_v', lon_v.dtype, ('nx',))
nc['lat_v'] = fileID.createVariable('lat_v', lat_v.dtype, ('ny',))
nc['uRe'] = fileID.createVariable('uRe', u.real.dtype, ('ny','nx',),
nc['uRe'] = fileID.createVariable('uRe', u.real.dtype, ('nx','ny',),

Check warning on line 1090 in pyTMD/io/ATLAS.py

View check run for this annotation

Codecov / codecov/patch

pyTMD/io/ATLAS.py#L1090

Added line #L1090 was not covered by tests
fill_value=0, zlib=True)
nc['uIm'] = fileID.createVariable('uIm', u.imag.dtype, ('ny','nx',),
nc['uIm'] = fileID.createVariable('uIm', u.imag.dtype, ('nx','ny',),

Check warning on line 1092 in pyTMD/io/ATLAS.py

View check run for this annotation

Codecov / codecov/patch

pyTMD/io/ATLAS.py#L1092

Added line #L1092 was not covered by tests
fill_value=0, zlib=True)
nc['vRe'] = fileID.createVariable('vRe', v.real.dtype, ('ny','nx',),
nc['vRe'] = fileID.createVariable('vRe', v.real.dtype, ('nx','ny',),

Check warning on line 1094 in pyTMD/io/ATLAS.py

View check run for this annotation

Codecov / codecov/patch

pyTMD/io/ATLAS.py#L1094

Added line #L1094 was not covered by tests
fill_value=0, zlib=True)
nc['vIm'] = fileID.createVariable('vIm', v.imag.dtype, ('ny','nx',),
nc['vIm'] = fileID.createVariable('vIm', v.imag.dtype, ('nx','ny',),

Check warning on line 1096 in pyTMD/io/ATLAS.py

View check run for this annotation

Codecov / codecov/patch

pyTMD/io/ATLAS.py#L1096

Added line #L1096 was not covered by tests
fill_value=0, zlib=True)
# filling the NetCDF variables
nc['lon_u'][:] = lon_u[:]
nc['lat_u'][:] = lat_u[:]
nc['lon_v'][:] = lon_v[:]
nc['lat_v'][:] = lat_v[:]
nc['uRe'][:] = u.real[:]
nc['uIm'][:] = u.imag[:]
nc['vRe'][:] = v.real[:]
nc['vIm'][:] = v.imag[:]
nc['uRe'][:] = u.real[:].T
nc['uIm'][:] = u.imag[:].T
nc['vRe'][:] = v.real[:].T
nc['vIm'][:] = v.imag[:].T

Check warning on line 1106 in pyTMD/io/ATLAS.py

View check run for this annotation

Codecov / codecov/patch

pyTMD/io/ATLAS.py#L1103-L1106

Added lines #L1103 - L1106 were not covered by tests
# define variable attributes
direction = dict(u='WE', v='SN')
complexpart = dict(Re='Real part', Im='Imag part')
Expand Down

0 comments on commit 4d9e600

Please sign in to comment.