-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathantide.m
184 lines (131 loc) · 5.08 KB
/
antide.m
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
1;
load('data/smkf1.mat');
station = qa_ts(station, 'tide', [], 1);
figure;
plot(station.tide_qc.date, station.tide_qc.data);
datetick; set_datetick_cursor; title('Tide_QC');
tide = station.tide.data;
tide = tide(~isnan(tide));
tide = (tide - mean(tide));
[tidepsd,fr] = pwelch(tide);
figure; loglog((fr*24),tidepsd); title('PWelch (raw)');
x=max(station.tide.date(isnan(station.tide.data)));
tide = station.tide.data(station.tide.date > x);
tide = (tide - mean(tide));
[tidepsd,fr] = pwelch(tide);
figure; loglog((fr*24),tidepsd); title('PWelch (>nan)');
tide = station.tide_qc.data;
tide=(tide-mean(tide));
[tidepsd,fr] = pwelch(tide);
figure; loglog((fr*24),tidepsd); title('PWelch (QC)');
[tidepsd,fr] = pcov(tide,20);
figure; loglog((fr*24),tidepsd); title('PCov (QC)');
[tidepsd,fr] = peig(tide,10);
figure; loglog((fr*24),tidepsd); title('PEig (QC)');
[name,fr,tcon,xout] = t_tide(station.tide.data, 'output', 'none');
size(xout)
figure; plot(station.tide.date, (station.tide.data - xout));
datetick; set_datetick_cursor;
title('Tide - T\_Tide');
dts = station.tide.date(station.tide.date >= datenum(2006,1,1));
tide = station.tide.data(station.tide.date >= datenum(2006,1,1));
[name,fr,tcon,xout] = t_tide(tide, 'output', 'none');
figure; plot(dts, (tide - xout));
datetick; set_datetick_cursor;
title('Tide - T\_Tide (2006-2008)');
[name,fr,tcon,xout] = t_tide(station.tide_qc.data, 'output', 'none');
figure; plot(station.tide_qc.date, (station.tide_qc.data - xout));
datetick; set_datetick_cursor;
title('Tide - T\_Tide (QC)');
dts = station.tide_qc.date(station.tide_qc.date >= datenum(2006,1,1));
tide = station.tide_qc.data(station.tide_qc.date >= datenum(2006,1,1));
[name,fr,tcon,xout] = t_tide(tide, 'output', 'none');
figure; plot(dts, (tide - xout)); datetick;
set_datetick_cursor;
title('Tide - T\_Tide (QC, 2006-2008)');
x=max(station.tide.date(isnan(station.tide.data)));
dts = station.tide.date(station.tide.date > x);
tide = station.tide.data(station.tide.date > x);
dts = station.tide.date(~isnan(station.tide.data));
tide = station.tide.data(~isnan(station.tide.data));
length(find(diff(dts) > 0.09)),
mu_tide = mean(tide);
dtide = tide - mu_tide;
dts(-2.5 > dtide | dtide > 2.5) = [];
tide(-2.5 > dtide | dtide > 2.5) = [];
mu_tide = mean(tide);
tide = tide - mu_tide;
fdts = dts(1):(1/24):dts(end);
ftide = interp1(dts, tide, fdts);
% fts = filter_ts(ftide, 3);
% figure; plot(fdts(40:end-40), mu_tide + (fts(40:end-40)));
% datetick('x', 'mmmyy', 'keepticks', 'keeplimits'); set_datetick_cursor;
% title('Tide 3HLP');
fts = filter_ts(ftide, 40);
figure; plot(fdts(40:end-40), mu_tide + (fts(40:end-40)));
datetick('x', 'mmmyy', 'keepticks', 'keeplimits'); set_datetick_cursor;
title('Tide 40HLP');
station = verify_variable(station, 'sea_t_1_day_deviation_3_day_average');
station = qa_ts(station, 'sea_t', [], 1);
figure;
plot(station.sea_t_1_day_deviation_3_day_average.date, ...
station.sea_t_1_day_deviation_3_day_average.data);
datetick; set_datetick_cursor;
title('Sea T - \mu_3_d(\sigma_1_d(T))');
ymd2jday(2006,6,14)
[LONS, LATS, sst_iw, chl_iw, tsm_iw] = anmodis('2006165.18', [1 1 1]);
set(gca, 'clim', [22 29]);
sw_dist([24.63 , 24.70], [-81.11 , -80.71], 'km')
sw_dist([24.70, 24.98], [-80.71, -80.41], 'km')
sw_dist([24.57, 24.6], [-81.31, -81.22], 'km')
1/10e3
(2*pi)/10e3
k=(2*pi)/10e3
om = k*0.30,
om = k*0.50
om = k*0.10
k=(2*pi)/40e3
om = k*0.30,
om = k*0.50,
m=1/200; N=1e-3; f=7e-5;
om=sqrt(((N*k)^2)/(m^2))
om<f
N=1e-2;
om=sqrt(((N*k)^2)/(m^2))
om<f
N=5e-3;
om=sqrt(((N*k)^2)/(m^2))
N=3e-3;
om=sqrt(((N*k)^2)/(m^2))
N=2e-3;
om=sqrt(((N*k)^2)/(m^2))
sw_dist([24.57, 24.77], [-81.27, -80.76], 'km')
pd ../../RSMAS/Coastal/thesis
% [f,z] = animwera(num2str([2006164:2006166]'), [1 0 0]);
[f,z] = animwera(num2str([2006166:2006167]'), [1 0 0]);
for fi=1:length(f); figure(f(fi)); set(gca, 'clim', [3e-3 9e-3]); end;
reviewanim(f);
for fi=f; close(fi); end;
station = load_station_data('smkf1');
dts = station.tide.date(~isnan(station.tide.data));
tide = station.tide.data(~isnan(station.tide.data));
dts(abs(tide-mean(tide)) > 2.5) = [];
tide(abs(tide-mean(tide)) > 2.5) = [];
fts = filter_ts(tide, 40);
figure; plot(dts, fts); datetick('x', 'mmmyy', 'keepticks', 'keeplimits');
set_datetick_cursor; title('40HLP Tide - SMKF1');
[tidepsd,fr] = pwelch(fts(80:end-80));
figure; loglog(fr,tidepsd); title('PWelch (40HLP)');
x = max(station.tide.date(isnan(station.tide.data)));
dts = station.tide.date(station.tide.date > x);
tide = station.tide.data(station.tide.date > x);
dts(abs(tide-mean(tide)) > 2.5) = [];
tide(abs(tide-mean(tide)) > 2.5) = [];
fts = filter_ts(tide, 40);
[tidepsd,fr] = pwelch(fts(80:end-80));
figure; loglog(fr,tidepsd); title('PWelch (40HLP; 2004-2008)');
[tidepsd,fr] = pmtm(fts(80:end-80));
figure; loglog(fr,tidepsd); title('PSD - MTM (40HLP; 2004-2008)');
fts = filter_ts(tide, 72);
[tidepsd,fr] = pmtm(fts(144:end-144));
figure; loglog(fr,tidepsd); title('PSD - MTM (72HLP; 2004-2008)');