File tree Expand file tree Collapse file tree
pycurrents_ADCP_processing Expand file tree Collapse file tree Original file line number Diff line number Diff 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" )
You can’t perform that action at this time.
0 commit comments