1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| def Wave_Analysis_Plot(dat, t, dt): import proplot as pplt
res_wt = WaveTrans(dat, dt) iwave = res_wt['iwave'] periods = res_wt['periods'] power = res_wt['power'] sig95 = res_wt['sig95'] coi = res_wt['coi'] glbl_power = res_wt['glbl_power'] glbl_sig95 = res_wt['glbl_sig95']
fig, axes = pplt.subplots([[1, 1, 1, 1, 0], [2, 2, 2, 2, 3]], figsize=(12, 10)) axes[0].plot(t, iwave, c='grey', lw=1.5) axes[0].plot(t, dat, c='k', lw=2.5) axes[1].contourf(t, periods, power) axes[1].contour(t, periods, sig95, colors='k', vmin=1, vmax=1) axes[1].plot(t, coi, c='k', lw=3)
axes[2].plot(glbl_power, periods, c='k', lw=2) axes[2].plot(glbl_sig95, periods, c='grey', ls='--', lw=2)
axes[0].format(ylabel='Data') axes[2].format(xlabel='Power') axes[0:2].format(xlabel='Time') axes[1:3].format(ylabel='Periods', yscale='log', yticks=2**np.arange(1, int(np.log2(coi.max()))), ylim=(coi.max()*1.1, periods[0])) pplt.show()
return res_wt
|