source: altifloat/matlab_toolbox/testingfilter.m @ 160

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

last version of Varanth

File size: 8.8 KB
Line 
1close all
2
3figure(1)
4
5fid = fopen('obs_float/obs_float_test.dat', 'rb');
6fseek(fid, 0, 'eof');
7fileSize = ftell(fid);
8frewind(fid);
9data = fread(fid, fileSize, 'uint8');
10numLines = sum(data == 10) + 1;
11fclose(fid);
12m=numLines-1;
13n=m/2;
14load obs_float/obs_float_test.dat;
15
16x=obs_float_test (1:2:4,4);
17y=obs_float_test (2:2:4,4);
18x=x+1;
19y=y+1;
20plot(x(1),y(1),'+')
21hold on;
22plot(x(2),y(2),'>')
23hold on;
24plot(x(1:2),y(1:2),'+');
25hold on;
26plot(x(1:2),y(1:2),'-r')
27hold on;
28
29% x3=obs_float_test (n+1:2:m,4);
30% y3=obs_float_test (n+2:2:m,4);
31% % x3=x3+1;
32% % y3=y3+1;
33% plot(x3(1),y3(1),'+')
34% hold on;
35% plot(x3(n/2),y3(n/2),'>')
36% hold on;
37% plot(x3(1:n/2),y3(1:n/2),'+');
38% hold on;
39% plot(x3(1:n/2),y3(1:n/2),'-m')
40% hold on;
41
42
43fid = fopen('obs_float/rfloat_total.dat', 'rb');
44fseek(fid, 0, 'eof');
45fileSize = ftell(fid);
46frewind(fid);
47data = fread(fid, fileSize, 'uint8');
48numLines = sum(data == 10) + 1;
49fclose(fid);
50p=numLines-1;
51u=p/2;
52load obs_float/rfloat_total.dat
53x2=rfloat_total(1:4,4);
54y2=rfloat_total(1:4,3);
55ligne=1;
56for h=1:3:4
57    x2(h)=obs_float_test(ligne,4);
58    y2(h)=obs_float_test(ligne+1,4);
59    ligne=ligne+2;
60end
61x2=x2+1;
62y2=y2+1;
63[k,h]=size(x2);
64plot(x2(1),y2(1),'+')
65hold on;
66plot(x2(k),y2(k),'>')
67hold on;
68plot(x2(1:k),y2(1:k),'+')
69hold on;
70plot(x2(1:k),y2(1:k),'-g')
71hold on;
72
73% rfloat_total(:,:)
74% x4=rfloat_total(u+1:p,4)
75% y4=rfloat_total(u+1:p,3)
76% ligne=n+1;
77% for h=1:3:u
78%     x4(h)=obs_float_test(ligne,4);
79%     y4(h)=obs_float_test(ligne+1,4);
80%     ligne=ligne+2;
81% end
82% % x4=x4+1;
83% % y4=y4+1;
84% [k,h]=size(x4);
85% plot(x4(1),y4(1),'+')
86% hold on;
87% plot(x4(k),y4(k),'>')
88% hold on;
89% plot(x4(1:k),y4(1:k),'+')
90% hold on;
91% plot(x4(1:k),y4(1:k),'-g')
92% hold on;
93
94
95load obs_float/uv_total.dat;
96whos;
97X1=uv_total(1:5046,end-3);
98Y1=uv_total(1:5046,end-2);
99X1=X1+1;
100Y1=Y1+1;
101%change si pas de temps change
102U1=zeros(5046,1);
103V1=zeros(5046,1);
104e=1;
105for r=1:1:2
106   
107    Unew=zeros(1,5046);
108    Vnew=zeros(1,5046);
109    for count=1:5046
110        Unew(count)=uv_total(e,end-1);
111        Vnew(count)=uv_total(e,end);
112        e=e+1;
113    end
114    U1=U1+Unew';
115    V1=V1+Vnew';
116   
117   
118end
119
120U1=U1./2;
121V1=V1./2;
122quiver(X1,Y1,U1,V1,2,'r','Autoscale','off');
123
124% load obs_float/unext3d.dat;
125%
126% unext3d=roundn(unext3d,-6)
127% whos;
128% X3=unext3d(:,end-2);
129% Y3=unext3d(:,end-1);
130% U3=unext3d(:,end);
131% load obs_float/vnext3d.dat
132% vnext3d=roundn(vnext3d,-6)
133% V3=vnext3d(:,end);
134% quiver(X3,Y3,U3,V3,2,'b','Autoscale','off');
135
136load obs_float/uzero.dat;
137
138
139whos;
140X2=uzero(:,end-2);
141Y2=uzero(:,end-1);
142U2=uzero(:,end);
143load obs_float/vzero.dat
144
145V2=vzero(:,end);
146quiver(X2,Y2,U2,V2,2,'b','Autoscale','off');
147
148
149
150%
151%
152%  figure(2)
153% load obs_float/vel_bck_all.dat
154% it=find(vel_bck_all(:,1)==1);
155% Tu=reshape(vel_bck_all(it,4),58,87);
156% Tv=reshape(vel_bck_all(it,5),58,87);
157%
158% load obs_float/vel_next_all.dat
159% it=find(vel_next_all(:,1)==1);
160% Bu=reshape(vel_next_all(it,4),58,87);
161% Bv=reshape(vel_next_all(it,5),58,87);
162%
163% F=(Bu-Tu).^2+(Bv-Tv).^2
164% imagesc(F)
165% axis xy
166% colorbar
167% hold on
168% obs_float_test (1:4,:)
169% x=obs_float_test (1:2:214,4)
170% y=obs_float_test (2:2:214,4)
171% x=x+1
172% y=y+1
173% plot(x(1),y(1),'+')
174% hold on;
175% plot(x(40),y(40),'>')
176% hold on;
177% plot(x(1:40),y(1:40),'+');
178% hold on;
179% plot(x(1:40),y(1:40),'-r')
180% hold on;
181%
182%
183% x3=obs_float_test (289:2:502,4)
184% y3=obs_float_test (290:2:502,4)
185% x3=x3+1
186% y3=y3+1
187% plot(x3(1),y3(1),'+')
188% hold on;
189% plot(x3(40),y3(40),'>')
190% hold on;
191% plot(x3(1:40),y3(1:40),'+');
192% hold on;
193% plot(x3(1:40),y3(1:40),'-r')
194% hold on;
195%
196% x5=obs_float_test (577:2:790,4)
197% y5=obs_float_test (578:2:790,4)
198% x5=x5+1
199% y5=y5+1
200% plot(x5(1),y5(1),'+')
201% hold on;
202% plot(x5(34),y5(34),'>')
203% hold on;
204% plot(x5(1:34),y5(1:34),'+');
205% hold on;
206% plot(x5(1:34),y5(1:34),'-r')
207% hold on;
208%
209% x7=obs_float_test (865:2:348,4)
210% y7=obs_float_test (866:2:348,4)
211% x7=x7+1
212% y7=y7+1
213% plot(x7(1),y7(1),'+')
214% hold on;
215% plot(x7(34),y7(34),'>')
216% hold on;
217% plot(x7(1:34),y7(1:34),'+');
218% hold on;
219% plot(x7(1:34),y7(1:34),'-r')
220% hold on;
221%
222% figure(3)
223%
224% load obs_float/uv_total.dat
225%
226% steps=35
227% counterr=1;
228%
229% Cu=0;
230% Cv=0;
231% for ll=1:steps
232%     Iu=0;
233%     Iv=0;
234%     it=counterr:(counterr+5045);
235%     Iu=reshape(uv_total(it,4),58,87);
236%     Iv=reshape(uv_total(it,5),58,87);
237%     counterr=counterr+5046;
238%     Cu=Cu+Iu;
239%     Cv=Cv+Iv;
240% end
241%     
242% Cu=Cu/35;
243% Cv=Cv/35;
244%
245% F1=(Tu-Cu).^2+(Tv-Cv).^2;
246% imagesc(F1)
247% axis xy
248% colorbar
249% hold on
250% obs_float_test (1:4,:)
251% x=obs_float_test (1:2:214,4)
252% y=obs_float_test (2:2:214,4)
253% x=x+1
254% y=y+1
255% plot(x(1),y(1),'+')
256% hold on;
257% plot(x(34),y(34),'>')
258% hold on;
259% plot(x(1:34),y(1:34),'+');
260% hold on;
261% plot(x(1:34),y(1:34),'-r')
262% hold on;
263%
264%
265% x3=obs_float_test (289:2:502,4)
266% y3=obs_float_test (290:2:502,4)
267% x3=x3+1
268% y3=y3+1
269% plot(x3(1),y3(1),'+')
270% hold on;
271% plot(x3(34),y3(34),'>')
272% hold on;
273% plot(x3(1:34),y3(1:34),'+');
274% hold on;
275% plot(x3(1:34),y3(1:34),'-r')
276% hold on;
277%
278% x5=obs_float_test (577:2:790,4)
279% y5=obs_float_test (578:2:790,4)
280% x5=x5+1
281% y5=y5+1
282% plot(x5(1),y5(1),'+')
283% hold on;
284% plot(x5(34),y5(34),'>')
285% hold on;
286% plot(x5(1:34),y5(1:34),'+');
287% hold on;
288% plot(x5(1:34),y5(1:34),'-r')
289% hold on;
290%
291% x7=obs_float_test (865:2:348,4)
292% y7=obs_float_test (866:2:348,4)
293% x7=x7+1
294% y7=y7+1
295% plot(x7(1),y7(1),'+')
296% hold on;
297% plot(x7(34),y7(34),'>')
298% hold on;
299% plot(x7(1:34),y7(1:34),'+');
300% hold on;
301% plot(x7(1:34),y7(1:34),'-r')
302% hold on;
303% F2=(Bu-Cu).^2+(Bv-Cv).^2;
304% figure(4)
305% imagesc(F2)
306% axis xy
307% colorbar
308% hold on
309% obs_float_test (1:4,:)
310% x=obs_float_test (1:2:214,4)
311% y=obs_float_test (2:2:214,4)
312% x=x+1
313% y=y+1
314% plot(x(1),y(1),'+')
315% hold on;
316% plot(x(34),y(34),'>')
317% hold on;
318% plot(x(1:34),y(1:34),'+');
319% hold on;
320% plot(x(1:34),y(1:34),'-r')
321% hold on;
322%
323%
324% x3=obs_float_test (289:2:502,4)
325% y3=obs_float_test (290:2:502,4)
326% x3=x3+1
327% y3=y3+1
328% plot(x3(1),y3(1),'+')
329% hold on;
330% plot(x3(34),y3(34),'>')
331% hold on;
332% plot(x3(1:34),y3(1:34),'+');
333% hold on;
334% plot(x3(1:34),y3(1:34),'-r')
335% hold on;
336%
337% x5=obs_float_test (577:2:790,4)
338% y5=obs_float_test (578:2:790,4)
339% x5=x5+1
340% y5=y5+1
341% plot(x5(1),y5(1),'+')
342% hold on;
343% plot(x5(34),y5(34),'>')
344% hold on;
345% plot(x5(1:34),y5(1:34),'+');
346% hold on;
347% plot(x5(1:34),y5(1:34),'-r')
348% hold on;
349%
350% x7=obs_float_test (865:2:348,4)
351% y7=obs_float_test (866:2:348,4)
352% x7=x7+1
353% y7=y7+1
354% plot(x7(1),y7(1),'+')
355% hold on;
356% plot(x7(34),y7(34),'>')
357% hold on;
358% plot(x7(1:34),y7(1:34),'+');
359% hold on;
360% plot(x7(1:34),y7(1:34),'-r')
361% hold on;
362%
363% figure (5)
364% imagesc(F)
365% axis([71 77 33 37])
366% hold on
367% obs_float_test (1:4,:)
368% x=obs_float_test (1:2:214,4)
369% y=obs_float_test (2:2:214,4)
370% x=x+1
371% y=y+1
372% plot(x(1),y(1),'+')
373% hold on;
374% plot(x(34),y(34),'>')
375% hold on;
376% plot(x(1:34),y(1:34),'+');
377% hold on;
378% plot(x(1:34),y(1:34),'-r')
379% hold on;
380%
381%
382% x3=obs_float_test (289:2:502,4)
383% y3=obs_float_test (290:2:502,4)
384% x3=x3+1
385% y3=y3+1
386% plot(x3(1),y3(1),'+')
387% hold on;
388% plot(x3(34),y3(34),'>')
389% hold on;
390% plot(x3(1:34),y3(1:34),'+');
391% hold on;
392% plot(x3(1:34),y3(1:34),'-r')
393% hold on;
394%
395% x5=obs_float_test (577:2:790,4)
396% y5=obs_float_test (578:2:790,4)
397% x5=x5+1
398% y5=y5+1
399% plot(x5(1),y5(1),'+')
400% hold on;
401% plot(x5(34),y5(34),'>')
402% hold on;
403% plot(x5(1:34),y5(1:34),'+');
404% hold on;
405% plot(x5(1:34),y5(1:34),'-r')
406% hold on;
407%
408% x7=obs_float_test (865:2:348,4)
409% y7=obs_float_test (866:2:348,4)
410% x7=x7+1
411% y7=y7+1
412% plot(x7(1),y7(1),'+')
413% hold on;
414% plot(x7(34),y7(34),'>')
415% hold on;
416% plot(x7(1:34),y7(1:34),'+');
417% hold on;
418% plot(x7(1:34),y7(1:34),'-r')
419% hold on;
420%
421% figure (6)
422% imagesc(F1)
423%
424% axis([71 77 33 37])
425% hold on
426% obs_float_test (1:4,:)
427% x=obs_float_test (1:2:214,4)
428% y=obs_float_test (2:2:214,4)
429% x=x+1
430% y=y+1
431% plot(x(1),y(1),'+')
432% hold on;
433% plot(x(34),y(34),'>')
434% hold on;
435% plot(x(1:34),y(1:34),'+');
436% hold on;
437% plot(x(1:34),y(1:34),'-r')
438% hold on;
439%
440%
441% x3=obs_float_test (289:2:502,4)
442% y3=obs_float_test (290:2:502,4)
443% x3=x3+1
444% y3=y3+1
445% plot(x3(1),y3(1),'+')
446% hold on;
447% plot(x3(34),y3(34),'>')
448% hold on;
449% plot(x3(1:34),y3(1:34),'+');
450% hold on;
451% plot(x3(1:34),y3(1:34),'-r')
452% hold on;
453%
454% x5=obs_float_test (577:2:790,4)
455% y5=obs_float_test (578:2:790,4)
456% x5=x5+1
457% y5=y5+1
458% plot(x5(1),y5(1),'+')
459% hold on;
460% plot(x5(34),y5(34),'>')
461% hold on;
462% plot(x5(1:34),y5(1:34),'+');
463% hold on;
464% plot(x5(1:34),y5(1:34),'-r')
465% hold on;
466%
467% x7=obs_float_test (865:2:348,4)
468% y7=obs_float_test (866:2:348,4)
469% x7=x7+1
470% y7=y7+1
471% plot(x7(1),y7(1),'+')
472% hold on;
473% plot(x7(34),y7(34),'>')
474% hold on;
475% plot(x7(1:34),y7(1:34),'+');
476% hold on;
477% plot(x7(1:34),y7(1:34),'-r')
478% hold on;
479% sum=0;
480% count=0;
481% for r=71:76
482%     for t=33:37
483%         sum=sum+F(t,r);
484%         count=count+1;
485%     end
486% end
487% sum=sum/count
488%
489% sum3=0;
490% count3=0;
491% for r=71:76
492%     for t=33:37
493%         sum3=sum3+F1(t,r);
494%         count3=count3+1;
495%     end
496% end
497% sum3=sum3/count3
498% sum=sqrt(sum/count);
499% sum3=sqrt(sum3/count3);
500% errorbefore=sum
501% errorafter=sum3
Note: See TracBrowser for help on using the repository browser.