Skip to content

Commit c10822d

Browse files
committed
correct the bin depths in write_instrument() - these are derived from distance dimension not equal to distance dimension
1 parent 07683e6 commit c10822d

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

pycurrents_ADCP_processing/ADCP_IOS_Header_file.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,10 @@ def write_instrument(nc):
314314
# serial_number = nc.attrs["serial_number"] nc.attrs["instrument_serial_number"]
315315
depth = str(nc.instrument_depth.data)
316316
orientation = nc.attrs["orientation"]
317+
if nc.orientation == 'up':
318+
bin_depths = nc.instrument_depth.data - nc.distance.data
319+
else:
320+
bin_depths = nc.instrument_depth.data + nc.distance.data
317321

318322
print("*INSTRUMENT")
319323
print(" TYPE : " + model)
@@ -322,9 +326,11 @@ def write_instrument(nc):
322326
print(" ORIENTATION : " + orientation)
323327
print()
324328
print(" $ARRAY: BIN DEPTHS (M)")
325-
n = nc.LCEWAP01["distance"].values.size
326-
for i in range(0, n):
327-
Bin_depth = str(round(nc.LCEWAP01["distance"].values[i], 2))
329+
# n = nc.LCEWAP01["distance"].values.size
330+
# for i in range(0, n):
331+
for i in range(len(bin_depths)):
332+
# Bin_depth = str(round(nc.LCEWAP01["distance"].values[i], 2))
333+
Bin_depth = str(round(bin_depths[i], 2))
328334
num_space = 13 - len(str(Bin_depth))
329335
print(" " * num_space + Bin_depth)
330336
print(" $END")

0 commit comments

Comments
 (0)