 
pathdata = 'c:\NEAQS_2004\ETLceilometer\';
outpath  = 'c:\NEAQS_2004\ETLceilometer\results\';
eval(['cd ', pathdata]);

aa = dir('b4*00.dat');

k = length(aa);
[num] = num2str(k);
disp('Number of ceilometer daily *.raw files : '); disp( [num]); 


st =5;
%%%%%%%%%%%%%%%%%% last file == k %%%%%%%%%%%%%%%

for w = st:k;

[numf] = num2str(w);

disp('# of *.day file in process :'); disp ( [numf]); 

%%%%%%% k is the # of *.cdf files need to be processed. %%%%%%%%

ceil_filename = [aa(w).name]


%%%%%%%%%%%%%%%%%% INPUT DATA FILE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

ceil_year     =  2004;
ceil_month    =  str2num(ceil_filename(3:4));
ceil_day      =  str2num(ceil_filename(5:6));
%%%%% READ HEX CEILOMETER FILE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LCload_1

%%%% SAVE DATA %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


ceilo_30_sec=[cloudcode' cloud1' cloud2' cloud3' ceil_hr' ceil_mn' ceil_sc'];% this is the raw data with time
year = '04';
if ceil_month < 10
    month = ['0' num2str(ceil_month)];
else
    month = num2str(ceil_month);
end
if ceil_day < 10
    day = ['0' num2str(ceil_day)];
else
    day = num2str(ceil_day);
end
out_file = [ outpath day '_' month '_' year '.txt ceilo_30_sec -ascii -tabs'];
eval(['save ',out_file]);
out_file2 = [outpath 'backscatter_' day '_' month '_' year ' ceil_b ceil_hr ceil_mn ceil_sc height'];
eval(['save ',out_file2]);
clear cloudcode cloud1 cloud2 cloud3 ceil_hr ceil_mn ceil_sc ceilo_30_sec ceil*;

%%%%% 2 LEVEL OF DATA ANALYSIS -- STATISTICS %%%%%%%%%


end
