source: altifloat/matlab_toolbox/twin2f.m @ 199

Last change on this file since 199 was 129, checked in by jbrlod, 10 years ago

last version of Varanth

  • Property svn:executable set to *
File size: 8.6 KB
Line 
1% 1 floater 2 pts
2
3close all
4figure(1)
5
6ls;
7load obs_float/obs_float_test.dat;
8whos;
9obs_float_test (1:4,:)
10x=obs_float_test (1:2:66,4)
11y=obs_float_test (2:2:66,4)
12plot(x(1),y(1),'+')
13x=x+1;
14y=y+1;
15hold on;
16plot(x(33),y(33),'>')
17hold on;
18plot(x(1:33),y(1:33),'+');
19hold on;
20plot(x(1:33),y(1:33),'-r')
21hold on;
22
23
24x3=obs_float_test (67:2:132,4)
25y3=obs_float_test (68:2:132,4)
26x3=x3+1;
27y3=y3+1;
28plot(x3(1),y3(1),'+')
29hold on;
30plot(x3(33),y3(33),'>')
31hold on;
32plot(x3(1:33),y3(1:33),'+');
33hold on;
34plot(x3(1:33),y3(1:33),'-k')
35hold on;
36
37load obs_float/rfloat_total.dat
38rfloat_total(:,:)
39x2=rfloat_total(1:100,4)
40y2=rfloat_total(1:100,3)
41x2=x2+1
42y2=y2+1
43[k,h]=size(x2);
44plot(x2(2),y2(2),'+')
45hold on;
46plot(x2(k-1),y2(k-1),'>')
47hold on;
48plot(x2(2:k-1),y2(2:k-1),'+')
49hold on;
50plot(x2(2:k-1),y2(2:k-1),'-g')
51hold on;
52
53rfloat_total(:,:)
54x4=rfloat_total(101:200,4)
55y4=rfloat_total(101:200,3)
56x4=x4+1
57y4=y4+1
58[k,h]=size(x4);
59plot(x4(2),y4(2),'+')
60hold on;
61plot(x4(k-1),y4(k-1),'>')
62hold on;
63plot(x4(2:k-1),y4(2:k-1),'+')
64hold on;
65plot(x4(2:k-1),y4(2:k-1),'-b')
66hold on;
67
68load obs_float/uv_total.dat;
69whos;
70X1=uv_total(1:5046,end-3);
71Y1=uv_total(1:5046,end-2);
72X1=X1+1;
73Y1=Y1+1;
74%change si pas de temps change
75U1=zeros(5046,1);
76V1=zeros(5046,1);
77e=1;
78for r=1:1:32
79   
80    for count=1:5046
81        Unew(count)=uv_total(e,end-1);
82        Vnew(count)=uv_total(e,end);
83        e=e+1;
84    end
85    U1=U1+Unew';
86    V1=V1+Vnew';
87   
88   
89end
90
91U1=U1/32;
92V1=V1/32;
93quiver(X1,Y1,U1,V1,2,'r','Autoscale','off');
94
95
96load obs_float/uzero.dat;
97
98uzero=roundn(uzero,-6)
99whos;
100X3=uzero(:,end-2);
101Y3=uzero(:,end-1);
102U3=uzero(:,end);
103load obs_float/vzero.dat
104vzero=roundn(vzero,-6)
105V3=vzero(:,end);
106quiver(X3,Y3,U3,V3,2,'c','Autoscale','off');
107
108% load obs_float/uzero.dat;
109%
110%
111% whos;
112% X2=uzero(:,end-2);
113% Y2=uzero(:,end-1);
114% U2=uzero(:,end);
115% load obs_float/vzero.dat
116%
117% V2=vzero(:,end);
118% quiver(X2,Y2,U2,V2,2,'g','Autoscale','off');
119% figure(2)
120% load vel_bck_all.dat
121% it=find(vel_bck_all(:,1)==1);
122% Tu=reshape(vel_bck_all(it,4),58,87);
123% Tv=reshape(vel_bck_all(it,5),58,87);
124%
125% load vel_true_all.dat
126% it=find(vel_true_all(:,1)==1);
127% Bu=reshape(vel_true_all(it,4),58,87);
128% Bv=reshape(vel_true_all(it,5),58,87);
129%
130% F=(Bu-Tu).^2+(Bv-Tv).^2
131% sum=0;
132% count=0;
133% for r=70:77
134%     for t=39:46
135%         sum=sum+F(t,r);
136%         count=count+1;
137%     end
138% end
139% sum=sum/count
140%
141% imagesc(F)
142% hold on
143% obs_float_test (1:4,:)
144% x=obs_float_test (1:2:4,4)
145% y=obs_float_test (2:2:4,4)
146% x=x+1
147% y=y+1
148% plot(x(1),y(1),'+')
149% hold on;
150% plot(x(2),y(2),'>')
151% hold on;
152% plot(x(1:2),y(1:2),'+');
153% hold on;
154% plot(x(1:2),y(1:2),'-r')
155% hold on;
156%
157%
158% x3=obs_float_test (5:2:8,4)
159% y3=obs_float_test (6:2:8,4)
160% x3=x3+1
161% y3=y3+1
162% plot(x3(1),y3(1),'+')
163% hold on;
164% plot(x3(2),y3(2),'>')
165% hold on;
166% plot(x3(1:2),y3(1:2),'+');
167% hold on;
168% plot(x3(1:2),y3(1:2),'-r')
169% hold on;
170%
171%
172% figure(3)
173%
174% load uv_total.dat
175% it=find(uv_total(:,1)==0);
176% Iu0=reshape(uv_total(it,4),58,87);
177% Iv0=reshape(uv_total(it,5),58,87);
178% it=find(uv_total(:,1)==1);
179% Iu1=reshape(uv_total(it,4),58,87);
180% Iv1=reshape(uv_total(it,5),58,87);
181% it=find(uv_total(:,1)==2);
182% Iu2=reshape(uv_total(it,4),58,87);
183% Iv2=reshape(uv_total(it,5),58,87);
184% it=find(uv_total(:,1)==3);
185% Iu3=reshape(uv_total(it,4),58,87);
186% Iv3=reshape(uv_total(it,5),58,87);
187% it=find(uv_total(:,1)==4);
188% Iu4=reshape(uv_total(it,4),58,87);
189% Iv4=reshape(uv_total(it,5),58,87);
190% it=find(uv_total(:,1)==5);
191% Iu5=reshape(uv_total(it,4),58,87);
192% Iv5=reshape(uv_total(it,5),58,87);
193% it=find(uv_total(:,1)==6);
194% Iu6=reshape(uv_total(it,4),58,87);
195% Iv6=reshape(uv_total(it,5),58,87);
196% it=find(uv_total(:,1)==7);
197% Iu7=reshape(uv_total(it,4),58,87);
198% Iv7=reshape(uv_total(it,5),58,87);
199% it=find(uv_total(:,1)==8);
200% Iu8=reshape(uv_total(it,4),58,87);
201% Iv8=reshape(uv_total(it,5),58,87);
202% it=find(uv_total(:,1)==9);
203% Iu9=reshape(uv_total(it,4),58,87);
204% Iv9=reshape(uv_total(it,5),58,87);
205% it=find(uv_total(:,1)==10);
206% Iu10=reshape(uv_total(it,4),58,87);
207% Iv10=reshape(uv_total(it,5),58,87);
208% it=find(uv_total(:,1)==11);
209% Iu11=reshape(uv_total(it,4),58,87);
210% Iv11=reshape(uv_total(it,5),58,87);
211% it=find(uv_total(:,1)==12);
212% Iu12=reshape(uv_total(it,4),58,87);
213% Iv12=reshape(uv_total(it,5),58,87);
214% it=find(uv_total(:,1)==13);
215% Iu13=reshape(uv_total(it,4),58,87);
216% Iv13=reshape(uv_total(it,5),58,87);
217% it=find(uv_total(:,1)==14);
218% Iu14=reshape(uv_total(it,4),58,87);
219% Iv14=reshape(uv_total(it,5),58,87);
220% it=find(uv_total(:,1)==15);
221% Iu15=reshape(uv_total(it,4),58,87);
222% Iv15=reshape(uv_total(it,5),58,87);
223% it=find(uv_total(:,1)==16);
224% Iu16=reshape(uv_total(it,4),58,87);
225% Iv16=reshape(uv_total(it,5),58,87);
226% it=find(uv_total(:,1)==17);
227% Iu17=reshape(uv_total(it,4),58,87);
228% Iv17=reshape(uv_total(it,5),58,87);
229% it=find(uv_total(:,1)==18)
230% Iu18=reshape(uv_total(it,4),58,87);
231% Iv18=reshape(uv_total(it,5),58,87);
232% it=find(uv_total(:,1)==19)
233% Iu19=reshape(uv_total(it,4),58,87);
234% Iv19=reshape(uv_total(it,5),58,87);
235% % it=find(uv_total(:,1)==20);
236% % I20=reshape(uv_total(it,4),58,87);
237% % it=find(uv_total(:,1)==21);
238% % I21=reshape(uv_total(it,4),58,87);
239% % it=find(uv_total(:,1)==22);
240% % I22=reshape(uv_total(it,4),58,87);
241% % it=find(uv_total(:,1)==23);
242% % I23=reshape(uv_total(it,4),58,87);
243% % it=find(uv_total(:,1)==24);
244% % I24=reshape(uv_total(it,4),58,87);
245% % it=find(uv_total(:,1)==25);
246% % I25=reshape(uv_total(it,4),58,87);
247% % it=find(uv_total(:,1)==26);
248% % I26=reshape(uv_total(it,4),58,87);
249% % it=find(uv_total(:,1)==27);
250% % I27=reshape(uv_total(it,4),58,87);
251% % it=find(uv_total(:,1)==28);
252% % I28=reshape(uv_total(it,4),58,87);
253% % it=find(uv_total(:,1)==29);
254% % I29=reshape(uv_total(it,4),58,87);
255% % it=find(uv_total(:,1)==30);
256% % I30=reshape(uv_total(it,4),58,87);
257% % it=find(uv_total(:,1)==31);
258% % I31=reshape(uv_total(it,4),58,87);
259% % it=find(uv_total(:,1)==32);
260% % I32=reshape(uv_total(it,4),58,87);
261% % it=find(uv_total(:,1)==33);
262% % I33=reshape(uv_total(it,4),58,87);
263% % it=find(uv_total(:,1)==34);
264% % I34=reshape(uv_total(it,4),58,87);
265% % it=find(uv_total(:,1)==35);
266% % I35=reshape(uv_total(it,4),58,87);
267% % it=find(uv_total(:,1)==36);
268% % I36=reshape(uv_total(it,4),58,87);
269%
270% Cu=(Iu0+Iu1+Iu2+Iu3+Iu4+Iu5+Iu6+Iu7+Iu8+Iu9+Iu10+Iu11+Iu12+Iu13+Iu14+Iu15+Iu16+Iu17+Iu18+Iu19)/20;
271% Cv=(Iv0+Iv1+Iv2+Iv3+Iv4+Iv5+Iv6+Iv7+Iv8+Iv9+Iv10+Iv11+Iv12+Iv13+Iv14+Iv15+Iv16+Iv17+Iv18+Iv19)/20;
272%
273% F1=(Tu-Cu).^2+(Tv-Cv).^2;
274% imagesc(F1)
275% sum3=0;
276% count3=0;
277% for r=70:77
278%     for t=39:46
279%         sum3=sum3+F1(t,r);
280%         count3=count3+1;
281%     end
282% end
283% sum3=sum3/count3
284% hold on
285% obs_float_test (1:4,:)
286% x=obs_float_test (1:2:4,4)
287% y=obs_float_test (2:2:4,4)
288% x=x+1
289% y=y+1
290% plot(x(1),y(1),'+')
291% hold on;
292% plot(x(2),y(2),'>')
293% hold on;
294% plot(x(1:2),y(1:2),'+');
295% hold on;
296% plot(x(1:2),y(1:2),'-r')
297% hold on;
298%
299%
300% x3=obs_float_test (5:2:8,4)
301% y3=obs_float_test (6:2:8,4)
302% x3=x3+1
303% y3=y3+1
304% plot(x3(1),y3(1),'+')
305% hold on;
306% plot(x3(2),y3(2),'>')
307% hold on;
308% plot(x3(1:2),y3(1:2),'+');
309% hold on;
310% plot(x3(1:2),y3(1:2),'-r')
311% hold on;
312%
313%
314% F2=(Bu-Cu).^2+(Bv-Cv).^2;
315%
316% figure(4)
317% imagesc(F2)
318% hold on
319% obs_float_test (1:4,:)
320% x=obs_float_test (1:2:4,4)
321% y=obs_float_test (2:2:4,4)
322% x=x+1
323% y=y+1
324% plot(x(1),y(1),'+')
325% hold on;
326% plot(x(2),y(2),'>')
327% hold on;
328% plot(x(1:2),y(1:2),'+');
329% hold on;
330% plot(x(1:2),y(1:2),'-r')
331% hold on;
332%
333%
334% x3=obs_float_test (5:2:8,4)
335% y3=obs_float_test (6:2:8,4)
336% x3=x3+1
337% y3=y3+1
338% plot(x3(1),y3(1),'+')
339% hold on;
340% plot(x3(2),y3(2),'>')
341% hold on;
342% plot(x3(1:2),y3(1:2),'+');
343% hold on;
344% plot(x3(1:2),y3(1:2),'-r')
345% hold on;
346%
347%
348% figure (5)
349% imagesc(F)
350% axis([70 77 38 46])
351% hold on
352% obs_float_test (1:4,:)
353% x=obs_float_test (1:2:4,4)
354% y=obs_float_test (2:2:4,4)
355% x=x+1
356% y=y+1
357% plot(x(1),y(1),'+')
358% hold on;
359% plot(x(2),y(2),'>')
360% hold on;
361% plot(x(1:2),y(1:2),'+');
362% hold on;
363% plot(x(1:2),y(1:2),'-r')
364% hold on;
365%
366%
367% x3=obs_float_test (5:2:8,4)
368% y3=obs_float_test (6:2:8,4)
369% x3=x3+1
370% y3=y3+1
371% plot(x3(1),y3(1),'+')
372% hold on;
373% plot(x3(2),y3(2),'>')
374% hold on;
375% plot(x3(1:2),y3(1:2),'+');
376% hold on;
377% plot(x3(1:2),y3(1:2),'-r')
378% hold on;
379%
380% figure(6)
381% imagesc(F1)
382%
383% axis([70 77 38 46])
384% hold on
385% obs_float_test (1:4,:)
386% x=obs_float_test (1:2:4,4)
387% y=obs_float_test (2:2:4,4)
388% x=x+1
389% y=y+1
390% plot(x(1),y(1),'+')
391% hold on;
392% plot(x(2),y(2),'>')
393% hold on;
394% plot(x(1:2),y(1:2),'+');
395% hold on;
396% plot(x(1:2),y(1:2),'-r')
397% hold on;
398%
399%
400% x3=obs_float_test (5:2:8,4)
401% y3=obs_float_test (6:2:8,4)
402% x3=x3+1
403% y3=y3+1
404% plot(x3(1),y3(1),'+')
405% hold on;
406% plot(x3(2),y3(2),'>')
407% hold on;
408% plot(x3(1:2),y3(1:2),'+');
409% hold on;
410% plot(x3(1:2),y3(1:2),'-r')
411% hold on;
412%
413% sum=sqrt(sum/count);
414% sum3=sqrt(sum3/count3);
415% errorbefore=sum
416% errorafter=sum3
Note: See TracBrowser for help on using the repository browser.