
cruise='DYNAMO_2011';
yy=[];
y1a=load('c:\data\cwf\Dropbox\DATA\dynamo\files\DYNAMO_2011_radar_Cldtop_leg1.txt');%y1b=reshape(y1a,6,length(y1a)/6);y1a=y1b'; 
y2a=load('c:\data\cwf\Dropbox\DATA\dynamo\files\DYNAMO_2011_radar_Cldtop_leg2.txt');%y2b=reshape(y2a,6,length(y2a)/6);y2a=y2b';
y3a=load('c:\data\cwf\Dropbox\DATA\dynamo\files\DYNAMO_2011_radar_Cldtop_leg3.txt');%y3b=reshape(y3a,6,length(y3a)/6);y3a=y3b'; 
y4a=load('c:\data\cwf\Dropbox\DATA\dynamo\files\DYNAMO_2011_radar_Cldtop_leg4.txt');%read file with 10min 

y1b=y1a(:,2:10);
yyx=[y1b' y2a' y3a' y4a']';
jdp=y1a(:,1)+y1a(:,2)/24;
b=length(y2a);mm=274;jdp2(1)=mm+y2a(1)/24;
for i=2:b-1
      jdp2(i)=mm+y2a(i,1)/24;
      if y2a(i+1,1)<y2a(i);mm=mm+1;end;
end;
jdp2(b)=mm+y2a(b,1)/24;

b=length(y3a);mm=312;jdp3(1)=mm+y3a(1)/24;
for i=2:b-1
      jdp3(i)=mm+y3a(i,1)/24;
      if y3a(i+1,1)<y3a(i);mm=mm+1;end;
end;
jdp3(b)=mm+y3a(b,1)/24;


b=length(y4a);mm=350;jdp4(1)=mm+y4a(1)/24;
for i=2:b-1
      jdp4(i)=mm+y4a(i,1)/24;
      if y4a(i+1,1)<y4a(i);mm=mm+1;end;
end;
jdp4(b)=mm+y4a(b,1)/24;

jdx=[jdp' jdp2 jdp3 jdp4]';
yi=interp1(jdx,yyx,jdy);

   

   jdy_hr=yi(:,1);%julian day at beginning of time average
   cloud_top=yi(:,2);%column water vap (cm)
   cloud_med=yi(:,3)*1e4;%column liq (mm), convert to g/m^2
   cloud_sig=yi(:,4);%numbwer obs
   dbz_mean=yi(:,5);%
   dbz_noise=yi(:,6);%
   Veloc_mean=yi(:,7);%
   Tot_rangegates=yi(:,8);
   cloud_thk=yi(:,9);
%    1 hour
% 	2 Cloud top height (km)
% 	3 CLoud top height std (km)
% 	4 Cloud top height 1/2 width distribution (km)
% 	5 Mean dBZ
% 	6 Mean dBZ-noise
% 	7 Mean Dopper veloc (+ down)
% 	8 Total number range gates with significant signal (0.3 s, 1hr)
% 	9 Cloud thickness (km) 

% ii=find(isnan(vap));vap(ii)=qa(ii)/3.3;
% ii=find(sigvap>0.1 | isnan(sigvap));liq(ii)=NaN;
figure;plot(jdy,cloud_thk);


