Commit 26b561ad authored by cponcele's avatar cponcele
Browse files

Fix sonar_netcdf : bug in backscatter_r variable when dimensions >2

parent f9cb0c93
......@@ -165,7 +165,7 @@ class NcReader:
shape = vlen_variable.shape
dimensions = vlen_variable.dimensions
reduced_shape, reduced_dimensions = self._squeeze_shape(shape, dimensions)
vlen_variable.set_auto_mask(False)
# with netcdf < 1.5.4 we need to take into account for scale factor and add offset by ourself
scale_factor = None
add_offset = None
......@@ -210,9 +210,9 @@ class NcReader:
reduced_dimensions = reduced_dim_in_progress
else:
# values = vlen_variable[:]
values = np.empty(shape=reduced_shape, dtype=object)
for index in range(0, reduced_shape[0]):
values[index] = vlen_variable[index]
#values = np.empty(shape=reduced_shape, dtype=object)
values=np.squeeze(vlen_variable[:])
pprint(f"Vlen variable {variable_path} : reduced shape for display is {reduced_dimensions} ({reduced_shape})")
if len(reduced_shape) == 1:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment