source: altifloat/matlab_toolbox/takecorrectionasbck.m~ @ 199

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

last version of Varanth

File size: 1.4 KB
Line 
1function [ output_args ] = create_bck( totaltime )
2
3totaltime=totaltime-1;
4outfile='obs_float/ucorr.dat';
5load obs_float/uv_total.dat;
6load obs_float/uzero.dat
7
8umean(:,1)=uzero(:,1);
9umean(:,2)=uzero(:,2);
10umean(:,3)=uzero(:,3);
11U1=zeros(5046,1);
12V1=zeros(5046,1);
13e=1;
14for r=1:1:totaltime
15   
16    Unew=zeros(1,5046);
17    Vnew=zeros(1,5046);
18    for count=1:5046
19        Unew(count)=uv_total(e,end-1);
20        Vnew(count)=uv_total(e,end);
21        e=e+1;
22    end
23    U1=U1+Unew';
24    V1=V1+Vnew';
25   
26   
27end
28
29U1=U1./totaltime;
30V1=V1./totaltime;
31%%% Because if the jtlag is 3 we have a set of zeros each 3 time steps in
32%%% the uv_total.
33U1=U1;
34V1=V1;
35umean(:,4)=U1;
36
37
38fid=fopen(outfile,'w');
39fprintf(fid,'%d %d %d %f\n',umean');
40fclose(fid);
41
42outfile='obs_float/vcorr.dat';
43load obs_float/uv_total.dat;
44load obs_float/uzero.dat
45
46vmean(:,1)=uzero(:,1);
47vmean(:,2)=uzero(:,2);
48vmean(:,3)=uzero(:,3);
49U1=zeros(5046,1);
50V1=zeros(5046,1);
51e=1;
52for r=1:1:totaltime
53   
54    Unew=zeros(1,5046);
55    Vnew=zeros(1,5046);
56    for count=1:5046
57        Unew(count)=uv_total(e,end-1);
58        Vnew(count)=uv_total(e,end);
59        e=e+1;
60    end
61    U1=U1+Unew';
62    V1=V1+Vnew';
63   
64   
65end
66
67U1=U1./totaltime;
68V1=V1./totaltime;
69%%% Because if the jtlag is 3 we have a set of zeros each 3 time steps in
70%%% the uv_total.
71U1=U1;
72V1=V1;
73vmean(:,4)=V1;
74
75
76fid=fopen(outfile,'w');
77fprintf(fid,'%d %d %d %f\n',vmean');
78fclose(fid);
79end
Note: See TracBrowser for help on using the repository browser.