Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle RDI's variable profile shenanigans #292

Merged
merged 14 commits into from
Mar 11, 2024
4 changes: 2 additions & 2 deletions examples/data/dolfyn/test_data/RDI_withBT.dolfyn.log
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ root - INFO - ###Leaving checkheader.
root - INFO - {'nbyte': 579, 'dat_offsets': array([ 20, 79, 144, 282, 352, 422, 492])}
root - INFO - pos 20
root - INFO - pos 20 id 0
root - WARNING - Number of cells set to 17
root - WARNING - Cell size set to 1.0
root - INFO - Read Config
root - INFO - Read Fixed
root - INFO - pos 79 id 128
Expand Down Expand Up @@ -97,5 +99,3 @@ root - INFO - n 2: 256 0100
root - DEBUG - pos: 727, pos_: 0, nbyte: 65, k: 0, byte_offset: -1
root - DEBUG - Trying to Read 256
root - INFO - Reading code 0x100...
root - INFO - Read Vel
root - INFO - success!
Binary file modified examples/data/dolfyn/test_data/RiverPro_test01.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/dat_vm.mat
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/vmdas01_wh.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/winriver01.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/winriver02.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/winriver02_rotate_ship2earth.nc
Binary file not shown.
Binary file modified examples/data/dolfyn/test_data/winriver02_transect.nc
Binary file not shown.
2 changes: 1 addition & 1 deletion mhkit/dolfyn/io/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def save(ds, filename, format="NETCDF4", engine="netcdf4", compression=False, **

if compression:
# New netcdf4-c cannot compress variable length strings
if isinstance(ds[ky].data[0], str):
if ds[ky].size <= 1 or isinstance(ds[ky].data[0], str):
continue
enc[ky].update(dict(zlib=True, complevel=1))

Expand Down
Loading
Loading