Download Kilcher et al adv_tu..

Transcript
48
49
adv.clean.GN2002(dat)
dat_cln = dat.copy()
50
51
52
53
54
55
####
# Create a figure for comparing screened data to the original.
fig = plt.figure(1, figsize=[8, 4])
fig.clf()
ax = fig.add_axes([.14, .14, .8, .74])
56
57
58
# Plot the raw (unscreened) data:
ax.plot(dat_raw.mpltime, dat_raw.u, ’r-’)
59
60
61
62
63
64
65
66
67
68
69
# Plot the screened data:
ax.plot(dat.mpltime, dat.u, ’g-’)
bads = np.abs(dat.u - dat_raw.u[t_range_inds])
ax.text(0.55, 0.95,
"%0.2f%% of the data were ’cleaned’\nby the Goring+Nikora method." %
(np.float(sum(bads > 0)) / len(bads) * 100),
transform=ax.transAxes,
va=’top’,
ha=’left’,
)
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Add some annotations:
ax.axvspan(dt.date2num(dt.datetime.datetime(2012, 6, 12, 12)),
t_range[0], zorder=-10, facecolor=’0.9’,
edgecolor=’none’)
ax.text(0.13, 0.9, ’Mooring falling\ntoward seafloor’,
ha=’center’, va=’top’, transform=ax.transAxes,
size=’small’)
ax.text(t_range[0] + 0.0001, 0.6, ’Mooring on seafloor’,
size=’small’,
ha=’left’)
ax.annotate(’’, (t_range[0] + 0.006, 0.3),
(t_range[0], 0.3),
arrowprops=dict(facecolor=’black’, shrink=0.0),
ha=’right’)
85
86
87
88
89
90
91
92
93
# Finalize the figure
# Format the time axis:
tkr = dt.MinuteLocator(interval=5)
frmt = dt.DateFormatter(’%H:%M’)
ax.xaxis.set_major_locator(tkr)
ax.xaxis.set_minor_locator(dt.MinuteLocator(interval=1))
ax.xaxis.set_major_formatter(frmt)
ax.set_ylim([-3, 3])
94
95
96
97
98
# Label the axes:
ax.set_ylabel(’$u\,\mathrm{[m/s]}$’, size=’large’)
ax.set_xlabel(’Time [June 12, 2012]’)
ax.set_title(’Data cropping and cleaning’)
31