source: altifloat/matlab_toolbox/twin4f.m @ 160

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

last version of Varanth

  • Property svn:executable set to *
File size: 10.9 KB
Line 
1% 1 floater 2 pts
2
3close all
4
5figure(1)
6
7ls;
8load obs_float_test.dat;
9whos;
10obs_float_test (1:4,:)
11x=obs_float_test (1:2:4,4);
12y=obs_float_test (2:2:4,4);
13x=x+1;
14y=y+1;
15plot(x(1),y(1),'+')
16hold on;
17plot(x(2),y(2),'>')
18hold on;
19plot(x(1:2),y(1:2),'+');
20hold on;
21plot(x(1:2),y(1:2),'-r')
22hold on;
23
24
25x3=obs_float_test (5:2:8,4);
26y3=obs_float_test (6:2:8,4);
27x3=x3+1;
28y3=y3+1;
29plot(x3(1),y3(1),'+')
30hold on;
31plot(x3(2),y3(2),'>')
32hold on;
33plot(x3(1:2),y3(1:2),'+');
34hold on;
35plot(x3(1:2),y3(1:2),'-r')
36hold on;
37
38x5=obs_float_test (9:2:12,4);
39y5=obs_float_test (10:2:12,4);
40x5=x5+1;
41y5=y5+1;
42plot(x5(1),y5(1),'+')
43hold on;
44plot(x5(2),y5(2),'>')
45hold on;
46plot(x5(1:2),y5(1:2),'+');
47hold on;
48plot(x5(1:2),y5(1:2),'-r')
49hold on;
50
51x7=obs_float_test (13:2:16,4);
52y7=obs_float_test (14:2:16,4);
53x7=x7+1;
54y7=y7+1;
55plot(x7(1),y7(1),'+')
56hold on;
57plot(x7(2),y7(2),'>')
58hold on;
59plot(x7(1:2),y7(1:2),'+');
60hold on;
61plot(x7(1:2),y7(1:2),'-r')
62hold on;
63
64
65
66load rfloat_total.dat
67rfloat_total(:,:)
68x2=rfloat_total(1:20,4);
69y2=rfloat_total(1:20,3);
70x2=x2+1;
71y2=y2+1;
72[k,h]=size(x2);
73plot(x2(2),y2(2),'+')
74hold on;
75plot(x2(k-1),y2(k-1),'>')
76hold on;
77plot(x2(2:k-1),y2(2:k-1),'+')
78hold on;
79plot(x2(2:k-1),y2(2:k-1),'-g')
80hold on;
81
82x4=rfloat_total(21:40,4);
83y4=rfloat_total(21:40,3);
84x4=x4+1;
85y4=y4+1;
86[k,h]=size(x4);
87plot(x4(2),y4(2),'+')
88hold on;
89plot(x4(k-1),y4(k-1),'>')
90hold on;
91plot(x4(2:k-1),y4(2:k-1),'+')
92hold on;
93plot(x4(2:k-1),y4(2:k-1),'-g')
94hold on;
95
96x6=rfloat_total(41:60,4);
97y6=rfloat_total(41:60,3);
98x6=x6+1;
99y6=y6+1;
100[k,h]=size(x6);
101plot(x6(2),y6(2),'+')
102hold on;
103plot(x6(k-1),y6(k-1),'>')
104hold on;
105plot(x6(2:k-1),y6(2:k-1),'+')
106hold on;
107plot(x6(2:k-1),y6(2:k-1),'-g')
108hold on;
109
110x8=rfloat_total(61:80,4);
111y8=rfloat_total(61:80,3);
112x8=x8+1;
113y8=y8+1;
114[k,h]=size(x8);
115plot(x8(2),y8(2),'+')
116hold on;
117plot(x8(k-1),y8(k-1),'>')
118hold on;
119plot(x8(2:k-1),y8(2:k-1),'+')
120hold on;
121plot(x8(2:k-1),y8(2:k-1),'-g')
122hold on;
123
124load uv_total.dat;
125whos;
126X1=uv_total(1:5046,end-3);
127Y1=uv_total(1:5046,end-2);
128X1=X1+1;
129Y1=Y1+1;
130%change si pas de temps change
131U1=zeros(5046,1);
132V1=zeros(5046,1);
133e=1;
134for r=1:1:19
135   
136    for count=1:5046
137        Unew(count)=uv_total(e,end-1);
138        Vnew(count)=uv_total(e,end);
139        e=e+1;
140    end
141    U1=U1+Unew';
142    V1=V1+Vnew';
143   
144   
145end
146
147U1=U1/19;
148V1=V1/19;
149quiver(X1,Y1,U1,V1,2,'r','Autoscale','off');
150
151
152load utrue.dat;
153
154utrue=roundn(utrue,-6)
155whos;
156X3=utrue(:,end-2);
157Y3=utrue(:,end-1);
158U3=utrue(:,end);
159load vtrue.dat
160vtrue=roundn(vtrue,-6)
161V3=vtrue(:,end);
162quiver(X3,Y3,U3,V3,2,'b','Autoscale','off');
163
164load uzero.dat;
165
166
167whos;
168X2=uzero(:,end-2);
169Y2=uzero(:,end-1);
170U2=uzero(:,end);
171load vzero.dat
172
173V2=vzero(:,end);
174quiver(X2,Y2,U2,V2,2,'g','Autoscale','off');
175
176figure(2)
177load vel_bck_all.dat
178it=find(vel_bck_all(:,1)==1);
179Tu=reshape(vel_bck_all(it,4),58,87);
180Tv=reshape(vel_bck_all(it,5),58,87);
181
182load vel_true_all.dat
183it=find(vel_true_all(:,1)==1);
184Bu=reshape(vel_true_all(it,4),58,87);
185Bv=reshape(vel_true_all(it,5),58,87);
186
187F=(Bu-Tu).^2+(Bv-Tv).^2
188sum=0;
189count=0;
190for r=70:77
191    for t=39:46
192        sum=sum+F(t,r);
193        count=count+1;
194    end
195end
196sum=sum/count
197
198imagesc(F)
199hold on
200whos;
201obs_float_test (1:4,:)
202x=obs_float_test (1:2:4,4);
203y=obs_float_test (2:2:4,4);
204x=x+1;
205y=y+1;
206plot(x(1),y(1),'+')
207hold on;
208plot(x(2),y(2),'>')
209hold on;
210plot(x(1:2),y(1:2),'+');
211hold on;
212plot(x(1:2),y(1:2),'-r')
213hold on;
214
215
216x3=obs_float_test (5:2:8,4);
217y3=obs_float_test (6:2:8,4);
218x3=x3+1;
219y3=y3+1;
220plot(x3(1),y3(1),'+')
221hold on;
222plot(x3(2),y3(2),'>')
223hold on;
224plot(x3(1:2),y3(1:2),'+');
225hold on;
226plot(x3(1:2),y3(1:2),'-r')
227hold on;
228
229x5=obs_float_test (9:2:12,4);
230y5=obs_float_test (10:2:12,4);
231x5=x5+1;
232y5=y5+1;
233plot(x5(1),y5(1),'+')
234hold on;
235plot(x5(2),y5(2),'>')
236hold on;
237plot(x5(1:2),y5(1:2),'+');
238hold on;
239plot(x5(1:2),y5(1:2),'-r')
240hold on;
241
242x7=obs_float_test (13:2:16,4);
243y7=obs_float_test (14:2:16,4);
244x7=x7+1;
245y7=y7+1;
246plot(x7(1),y7(1),'+')
247hold on;
248plot(x7(2),y7(2),'>')
249hold on;
250plot(x7(1:2),y7(1:2),'+');
251hold on;
252plot(x7(1:2),y7(1:2),'-r')
253hold on;
254
255figure(3)
256
257load uv_total.dat
258it=find(uv_total(:,1)==0);
259Iu0=reshape(uv_total(it,4),58,87);
260Iv0=reshape(uv_total(it,5),58,87);
261it=find(uv_total(:,1)==1);
262Iu1=reshape(uv_total(it,4),58,87);
263Iv1=reshape(uv_total(it,5),58,87);
264it=find(uv_total(:,1)==2);
265Iu2=reshape(uv_total(it,4),58,87);
266Iv2=reshape(uv_total(it,5),58,87);
267it=find(uv_total(:,1)==3);
268Iu3=reshape(uv_total(it,4),58,87);
269Iv3=reshape(uv_total(it,5),58,87);
270it=find(uv_total(:,1)==4);
271Iu4=reshape(uv_total(it,4),58,87);
272Iv4=reshape(uv_total(it,5),58,87);
273it=find(uv_total(:,1)==5);
274Iu5=reshape(uv_total(it,4),58,87);
275Iv5=reshape(uv_total(it,5),58,87);
276it=find(uv_total(:,1)==6);
277Iu6=reshape(uv_total(it,4),58,87);
278Iv6=reshape(uv_total(it,5),58,87);
279it=find(uv_total(:,1)==7);
280Iu7=reshape(uv_total(it,4),58,87);
281Iv7=reshape(uv_total(it,5),58,87);
282it=find(uv_total(:,1)==8);
283Iu8=reshape(uv_total(it,4),58,87);
284Iv8=reshape(uv_total(it,5),58,87);
285it=find(uv_total(:,1)==9);
286Iu9=reshape(uv_total(it,4),58,87);
287Iv9=reshape(uv_total(it,5),58,87);
288it=find(uv_total(:,1)==10);
289Iu10=reshape(uv_total(it,4),58,87);
290Iv10=reshape(uv_total(it,5),58,87);
291it=find(uv_total(:,1)==11);
292Iu11=reshape(uv_total(it,4),58,87);
293Iv11=reshape(uv_total(it,5),58,87);
294it=find(uv_total(:,1)==12);
295Iu12=reshape(uv_total(it,4),58,87);
296Iv12=reshape(uv_total(it,5),58,87);
297it=find(uv_total(:,1)==13);
298Iu13=reshape(uv_total(it,4),58,87);
299Iv13=reshape(uv_total(it,5),58,87);
300it=find(uv_total(:,1)==14);
301Iu14=reshape(uv_total(it,4),58,87);
302Iv14=reshape(uv_total(it,5),58,87);
303it=find(uv_total(:,1)==15);
304Iu15=reshape(uv_total(it,4),58,87);
305Iv15=reshape(uv_total(it,5),58,87);
306it=find(uv_total(:,1)==16);
307Iu16=reshape(uv_total(it,4),58,87);
308Iv16=reshape(uv_total(it,5),58,87);
309it=find(uv_total(:,1)==17);
310Iu17=reshape(uv_total(it,4),58,87);
311Iv17=reshape(uv_total(it,5),58,87);
312it=find(uv_total(:,1)==18)
313Iu18=reshape(uv_total(it,4),58,87);
314Iv18=reshape(uv_total(it,5),58,87);
315it=find(uv_total(:,1)==19)
316Iu19=reshape(uv_total(it,4),58,87);
317Iv19=reshape(uv_total(it,5),58,87);
318% it=find(uv_total(:,1)==20);
319% I20=reshape(uv_total(it,4),58,87);
320% it=find(uv_total(:,1)==21);
321% I21=reshape(uv_total(it,4),58,87);
322% it=find(uv_total(:,1)==22);
323% I22=reshape(uv_total(it,4),58,87);
324% it=find(uv_total(:,1)==23);
325% I23=reshape(uv_total(it,4),58,87);
326% it=find(uv_total(:,1)==24);
327% I24=reshape(uv_total(it,4),58,87);
328% it=find(uv_total(:,1)==25);
329% I25=reshape(uv_total(it,4),58,87);
330% it=find(uv_total(:,1)==26);
331% I26=reshape(uv_total(it,4),58,87);
332% it=find(uv_total(:,1)==27);
333% I27=reshape(uv_total(it,4),58,87);
334% it=find(uv_total(:,1)==28);
335% I28=reshape(uv_total(it,4),58,87);
336% it=find(uv_total(:,1)==29);
337% I29=reshape(uv_total(it,4),58,87);
338% it=find(uv_total(:,1)==30);
339% I30=reshape(uv_total(it,4),58,87);
340% it=find(uv_total(:,1)==31);
341% I31=reshape(uv_total(it,4),58,87);
342% it=find(uv_total(:,1)==32);
343% I32=reshape(uv_total(it,4),58,87);
344% it=find(uv_total(:,1)==33);
345% I33=reshape(uv_total(it,4),58,87);
346% it=find(uv_total(:,1)==34);
347% I34=reshape(uv_total(it,4),58,87);
348% it=find(uv_total(:,1)==35);
349% I35=reshape(uv_total(it,4),58,87);
350% it=find(uv_total(:,1)==36);
351% I36=reshape(uv_total(it,4),58,87);
352
353Cu=(Iu0+Iu1+Iu2+Iu3+Iu4+Iu5+Iu6+Iu7+Iu8+Iu9+Iu10+Iu11+Iu12+Iu13+Iu14+Iu15+Iu16+Iu17+Iu18+Iu19)/20;
354Cv=(Iv0+Iv1+Iv2+Iv3+Iv4+Iv5+Iv6+Iv7+Iv8+Iv9+Iv10+Iv11+Iv12+Iv13+Iv14+Iv15+Iv16+Iv17+Iv18+Iv19)/20;
355
356F1=(Tu-Cu).^2+(Tv-Cv).^2;
357imagesc(F1)
358sum3=0;
359count3=0;
360for r=70:77
361    for t=39:46
362        sum3=sum3+F1(t,r);
363        count3=count3+1;
364    end
365end
366sum3=sum3/count3
367hold on
368whos;
369obs_float_test (1:4,:)
370x=obs_float_test (1:2:4,4);
371y=obs_float_test (2:2:4,4);
372x=x+1;
373y=y+1;
374plot(x(1),y(1),'+')
375hold on;
376plot(x(2),y(2),'>')
377hold on;
378plot(x(1:2),y(1:2),'+');
379hold on;
380plot(x(1:2),y(1:2),'-r')
381hold on;
382
383
384x3=obs_float_test (5:2:8,4);
385y3=obs_float_test (6:2:8,4);
386x3=x3+1;
387y3=y3+1;
388plot(x3(1),y3(1),'+')
389hold on;
390plot(x3(2),y3(2),'>')
391hold on;
392plot(x3(1:2),y3(1:2),'+');
393hold on;
394plot(x3(1:2),y3(1:2),'-r')
395hold on;
396
397x5=obs_float_test (9:2:12,4);
398y5=obs_float_test (10:2:12,4);
399x5=x5+1;
400y5=y5+1;
401plot(x5(1),y5(1),'+')
402hold on;
403plot(x5(2),y5(2),'>')
404hold on;
405plot(x5(1:2),y5(1:2),'+');
406hold on;
407plot(x5(1:2),y5(1:2),'-r')
408hold on;
409
410x7=obs_float_test (13:2:16,4);
411y7=obs_float_test (14:2:16,4);
412x7=x7+1;
413y7=y7+1;
414plot(x7(1),y7(1),'+')
415hold on;
416plot(x7(2),y7(2),'>')
417hold on;
418plot(x7(1:2),y7(1:2),'+');
419hold on;
420plot(x7(1:2),y7(1:2),'-r')
421hold on;
422
423F2=(Bu-Cu).^2+(Bv-Cv).^2;
424
425figure(4)
426imagesc(F2)
427hold on
428whos;
429obs_float_test (1:4,:)
430x=obs_float_test (1:2:4,4);
431y=obs_float_test (2:2:4,4);
432x=x+1;
433y=y+1;
434plot(x(1),y(1),'+')
435hold on;
436plot(x(2),y(2),'>')
437hold on;
438plot(x(1:2),y(1:2),'+');
439hold on;
440plot(x(1:2),y(1:2),'-r')
441hold on;
442
443
444x3=obs_float_test (5:2:8,4);
445y3=obs_float_test (6:2:8,4);
446x3=x3+1;
447y3=y3+1;
448plot(x3(1),y3(1),'+')
449hold on;
450plot(x3(2),y3(2),'>')
451hold on;
452plot(x3(1:2),y3(1:2),'+');
453hold on;
454plot(x3(1:2),y3(1:2),'-r')
455hold on;
456
457x5=obs_float_test (9:2:12,4);
458y5=obs_float_test (10:2:12,4);
459x5=x5+1;
460y5=y5+1;
461plot(x5(1),y5(1),'+')
462hold on;
463plot(x5(2),y5(2),'>')
464hold on;
465plot(x5(1:2),y5(1:2),'+');
466hold on;
467plot(x5(1:2),y5(1:2),'-r')
468hold on;
469
470x7=obs_float_test (13:2:16,4);
471y7=obs_float_test (14:2:16,4);
472x7=x7+1;
473y7=y7+1;
474plot(x7(1),y7(1),'+')
475hold on;
476plot(x7(2),y7(2),'>')
477hold on;
478plot(x7(1:2),y7(1:2),'+');
479hold on;
480plot(x7(1:2),y7(1:2),'-r')
481hold on;
482
483
484
485figure (5)
486imagesc(F)
487axis([70 77 38 46])
488hold on
489whos;
490obs_float_test (1:4,:)
491x=obs_float_test (1:2:4,4);
492y=obs_float_test (2:2:4,4);
493x=x+1;
494y=y+1;
495plot(x(1),y(1),'+')
496hold on;
497plot(x(2),y(2),'>')
498hold on;
499plot(x(1:2),y(1:2),'+');
500hold on;
501plot(x(1:2),y(1:2),'-r')
502hold on;
503
504
505x3=obs_float_test (5:2:8,4);
506y3=obs_float_test (6:2:8,4);
507x3=x3+1;
508y3=y3+1;
509plot(x3(1),y3(1),'+')
510hold on;
511plot(x3(2),y3(2),'>')
512hold on;
513plot(x3(1:2),y3(1:2),'+');
514hold on;
515plot(x3(1:2),y3(1:2),'-r')
516hold on;
517
518x5=obs_float_test (9:2:12,4);
519y5=obs_float_test (10:2:12,4);
520x5=x5+1;
521y5=y5+1;
522plot(x5(1),y5(1),'+')
523hold on;
524plot(x5(2),y5(2),'>')
525hold on;
526plot(x5(1:2),y5(1:2),'+');
527hold on;
528plot(x5(1:2),y5(1:2),'-r')
529hold on;
530
531x7=obs_float_test (13:2:16,4);
532y7=obs_float_test (14:2:16,4);
533x7=x7+1;
534y7=y7+1;
535plot(x7(1),y7(1),'+')
536hold on;
537plot(x7(2),y7(2),'>')
538hold on;
539plot(x7(1:2),y7(1:2),'+');
540hold on;
541plot(x7(1:2),y7(1:2),'-r')
542hold on;
543
544figure (6)
545imagesc(F1)
546
547axis([70 77 38 46])
548hold on
549whos;
550obs_float_test (1:4,:)
551x=obs_float_test (1:2:4,4);
552y=obs_float_test (2:2:4,4);
553x=x+1;
554y=y+1;
555plot(x(1),y(1),'+')
556hold on;
557plot(x(2),y(2),'>')
558hold on;
559plot(x(1:2),y(1:2),'+');
560hold on;
561plot(x(1:2),y(1:2),'-r')
562hold on;
563
564
565x3=obs_float_test (5:2:8,4);
566y3=obs_float_test (6:2:8,4);
567x3=x3+1;
568y3=y3+1;
569plot(x3(1),y3(1),'+')
570hold on;
571plot(x3(2),y3(2),'>')
572hold on;
573plot(x3(1:2),y3(1:2),'+');
574hold on;
575plot(x3(1:2),y3(1:2),'-r')
576hold on;
577
578x5=obs_float_test (9:2:12,4);
579y5=obs_float_test (10:2:12,4);
580x5=x5+1;
581y5=y5+1;
582plot(x5(1),y5(1),'+')
583hold on;
584plot(x5(2),y5(2),'>')
585hold on;
586plot(x5(1:2),y5(1:2),'+');
587hold on;
588plot(x5(1:2),y5(1:2),'-r')
589hold on;
590
591x7=obs_float_test (13:2:16,4);
592y7=obs_float_test (14:2:16,4);
593x7=x7+1;
594y7=y7+1;
595plot(x7(1),y7(1),'+')
596hold on;
597plot(x7(2),y7(2),'>')
598hold on;
599plot(x7(1:2),y7(1:2),'+');
600hold on;
601plot(x7(1:2),y7(1:2),'-r')
602hold on;
603
604sum=sqrt(sum/count);
605sum3=sqrt(sum3/count3);
606errorbefore=sum
607errorafter=sum3
Note: See TracBrowser for help on using the repository browser.