Skip to content

Commit 07e6c81

Browse files
authored
Merge pull request #292 from jmcvey3/rdi_sl_fix
Handle RDI's variable profile shenanigans
2 parents 41084bd + 190e2b9 commit 07e6c81

13 files changed

+251
-213
lines changed

examples/data/dolfyn/test_data/RDI_withBT.dolfyn.log

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ root - INFO - ###Leaving checkheader.
66
root - INFO - {'nbyte': 579, 'dat_offsets': array([ 20, 79, 144, 282, 352, 422, 492])}
77
root - INFO - pos 20
88
root - INFO - pos 20 id 0
9+
root - WARNING - Number of cells set to 17
10+
root - WARNING - Cell size set to 1.0
911
root - INFO - Read Config
1012
root - INFO - Read Fixed
1113
root - INFO - pos 79 id 128
@@ -97,5 +99,3 @@ root - INFO - n 2: 256 0100
9799
root - DEBUG - pos: 727, pos_: 0, nbyte: 65, k: 0, byte_offset: -1
98100
root - DEBUG - Trying to Read 256
99101
root - INFO - Reading code 0x100...
100-
root - INFO - Read Vel
101-
root - INFO - success!
Binary file not shown.
0 Bytes
Binary file not shown.
-699 Bytes
Binary file not shown.
-758 Bytes
Binary file not shown.
865 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.

mhkit/dolfyn/io/api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def save(ds, filename, format="NETCDF4", engine="netcdf4", compression=False, **
203203

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

0 commit comments

Comments
 (0)