%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                        %
%  This program plot zonalmean of        %
%  of CloudSat Obs.                      %
%                                        %
%  Just modify the list with yours       %
%                                        %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%




close ('all');
clear all;

%%% colormap vector
a=[0.75 0 1; 0.5 0 1; 0 0 1; 0 0.5 1; 0 1 1; 0 1 0.5; 0 1 0; 0.5 1 0; 1 1 0; 1 0.5 0; 1 0 0; 1 0 0.5];

%%% Create the JFM list files
 fid=fopen('/home/gcesana/src/Figure_Helene/fig_papier/table/liste_jfm_cloudsat');
 c=textscan(fid,'%s','delimiter','');      
 list=c{1};

ncload([list{1}])

for i = 1:length(list)
  list{i}
  ncload([list{i}]);

cloud(:,:,:,:,i)=CloudSat_height_v_dBZe_hist(:,8:20,:,:); % only value > -27.5 dBZe 
 
clear CloudSat_height_v_dBZe_hist ;
end

% average to make the 2dim vector 
cloud1=squeeze(nanmean(cloud,4)); 
cloud2=squeeze(nansum(cloud1,2));
cloud3=squeeze(nanmean(cloud2,3));

% Create the plot
figure;
pcolor(Latitude,Radar_bin_heights,cloud3);shading flat;
colorbar
colormap(a)
ylabel('ALTITUDE (KM)')
xlabel('LATITUDE')
title('CloudSat CF for JFM07-08')
