# ============================================================================= # read 38 kHz calibrated data # ============================================================================= print('Reading 38 kHz calibrated data...') raw38 = ek60.get_raw_data(channel_number=1) Sv38toml = np.transpose(raw38.get_Sv(calibration=params).data) t38toml = raw38.get_Sv(calibration=params).ping_time r38toml = raw38.get_Sv(calibration=params).range # ============================================================================= # plot non-calibrated and calibrated data # ============================================================================= print('Displaying results...') plt.figure(figsize=(8, 6)) c = cmaps() plt.subplot(211).invert_yaxis() plt.pcolormesh(t38, r38, Sv38, vmin=-80, vmax=-50, cmap=c.ek500) plt.colorbar().set_label('Sv 38 kHz (dB)') plt.title('Calibration NOT applied') plt.ylabel('Depth (m)') plt.tick_params(labelbottom=False) plt.subplot(212).invert_yaxis() plt.pcolormesh(t38toml, r38toml, Sv38toml, vmin=-80, vmax=-50, cmap=c.ek500) plt.colorbar().set_label('Sv 38 kHz (dB)') plt.title('Calibration applied') plt.ylabel('Depth (m)') plt.xlabel('Time (dd HH:MM)')
m120sh = mSH.weill(Sv120cvv, thr=-70, maxvgap=15, maxhgap=0, minhlen=3, minvlen=15)[0] #------------------------------------------------------------------------------ # Figures plt.figure(figsize=(8, 5)) plt.subplots_adjust(left=0.08, right=0.91, bottom=0.08, top=0.95, wspace=0.08) gs = gridspec.GridSpec(1, 3, width_ratios=[1, 1, .05]) # Sv original plt.subplot(gs[0]).invert_yaxis() im = plt.pcolormesh(t120, r120, Sv120, vmin=-80, vmax=-50, cmap=cmaps().ek500) plt.ylabel('Depth (m)') plt.xlabel('Time (dd HH:MM)') plt.title('Sv') # Swarms mask plt.subplot(gs[1]).invert_yaxis() plt.pcolormesh(t120, r120, m120sh * 1, cmap='Greys') plt.tick_params(labelleft=False) plt.xlabel('Time (dd HH:MM)') plt.title('Swarms') # colorbar ax = plt.subplot(gs[2]) plt.colorbar(im, cax=ax).set_label('dB re m$^{-1}$')
#------------------------------------------------------------------------------ # Clean Sv from impulse noise with Wang's algorithm Sv120wang, m120wang_ = mIN.wang(Sv120) # Note that Wang's algorithm does not return a mask with impulse noise detected # but Sv without impulse noise and other Sv modifications. It also removes # Sv signal below and above the target of interest. In this case, krill swarms. #------------------------------------------------------------------------------ # Figures plt.figure(figsize=(8,4)) # Sv original plt.subplot(131).invert_yaxis() plt.pcolormesh(p120, r120, Sv120, vmin=-80, vmax=-50, cmap=cmaps().ek500) plt.ylabel('Depth (m)') plt.title('IN on') # IN removed with Ryan's algorithm plt.subplot(132).invert_yaxis() plt.pcolormesh(p120, r120, Sv120ryan, vmin=-80, vmax=-50, cmap=cmaps().ek500) plt.tick_params(labelleft=False) plt.xlabel('Number of pings') plt.title('IN off (Ryan)') # IN removed (and further signal) with Wang's algorithm plt.subplot(133).invert_yaxis() plt.pcolormesh(p120, r120, Sv120wang, vmin=-80, vmax=-50, cmap=cmaps().ek500) plt.tick_params(labelleft=False) plt.title('IN off (Wang)')
#------------------------------------------------------------------------------ # integrate Nautical Area Scattering Coefficient (NASC), from 20 to 250 metres NASC, NASCper = tf.Sv2NASC(Sv38inoff, r38, 20, 250, method='sum') # note the sum method is used. # the second output is the percentange vertical samples integrated behind every # computation of NASC. #------------------------------------------------------------------------------ # Figures plt.figure(figsize=(8, 6)) # Sv with impulse noise removed plt.subplot(311).invert_yaxis() plt.pcolormesh(t38, r38, Sv38inoff, vmin=-80, vmax=-50, cmap=cmaps().ek500) plt.tick_params(labelbottom=False) plt.ylabel('Depth (m)') plt.title('Sv with impulse noise removed') # integrated sa ax = plt.subplot(312) ax = [ax, ax.twinx()] ax[0].plot(t38, sa, '-r') ax[0].set_xlim(t38[0], t38[-1]) ax[0].tick_params(axis='y', colors='r') ax[0].yaxis.tick_left() ax[0].yaxis.set_label_position("left") ax[0].set_ylabel('s$_a$ (m$^2$ m$^{-2}$)', color='r') ax[0].tick_params(labelbottom=False) ax[1].plot(t38, saper, '-b')