source: altifloat/matlab_toolbox/make_mean.m @ 160

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

last version of Varanth

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