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