Skip to content

Commit 71f7f31

Browse files
committed
add error catching for depth profile rotary spectra plot
1 parent 6a0e358 commit 71f7f31

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

pycurrents_ADCP_processing/plot_westcoast_nc_LX.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2548,7 +2548,7 @@ def create_westcoast_plots(
25482548
)
25492549
fnames_rot_spec.append(fname_rot_spec)
25502550
except ValueError as e:
2551-
print(f'Rotary spectra plot failed with error: {e}')
2551+
print(f'Single-bin rotary spectra plot failed with error: {e}')
25522552
else:
25532553
print(f'Warning: Bin index {bin_idx} for rotary spectra out of range of limited bins with '
25542554
f'length {len(bin_depths_lim)}')
@@ -2569,12 +2569,15 @@ def create_westcoast_plots(
25692569

25702570
# pcolor (pseudocolour) depth profile plot of rotary spectra
25712571
if do_profile_rotary_spectra or do_all_plots:
2572-
fnames_depth_prof = make_depth_prof_rot_spec(
2573-
dest_dir, ncdata.filename, station=ncdata.station, deployment_number=ncdata.deployment_number,
2574-
serial_number=ncdata.instrument_serial_number.data, instrument_depth=ncdata.instrument_depth.data,
2575-
bin_depths_lim=bin_depths_lim, ns_lim=ns_lim, ew_lim=ew_lim, time_lim=time_lim
2576-
)
2577-
output_file_list.append(fnames_depth_prof)
2572+
try:
2573+
fnames_depth_prof = make_depth_prof_rot_spec(
2574+
dest_dir, ncdata.filename, station=ncdata.station, deployment_number=ncdata.deployment_number,
2575+
serial_number=ncdata.instrument_serial_number.data, instrument_depth=ncdata.instrument_depth.data,
2576+
bin_depths_lim=bin_depths_lim, ns_lim=ns_lim, ew_lim=ew_lim, time_lim=time_lim
2577+
)
2578+
output_file_list.append(fnames_depth_prof)
2579+
except ValueError as e:
2580+
print(f'Depth profile rotary spectra plot failed with error: {e}')
25782581

25792582
# Redo part of process with tidal-filtered data
25802583
if do_filter_ne or do_filter_ac or do_all_plots:

0 commit comments

Comments
 (0)