
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% PLOT CEILOMETER DAILY AND COMPOSITE TIME SERIES AND BACKSCATTER
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% INTENSITY
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
pltflg = 0;  % Save plot flag DEW 952007
data = [processed_data_path jdn '_' fn '.txt'];
scatter_data = [processed_data_path 'backscatter_' jdn '_' fn '.mat'];
ceil_series = load(data);
load(scatter_data);

ceil_time = ceil_series(:,5)+ceil_series(:,6)/60+ceil_series(:,7)/3600;
if ceil_time(length(ceil_time))==0
    step=diff(ceil_time);
    ceil_time(length(ceil_time))=ceil_time(length(ceil_time)-1)+step(1);
end;

figure(5)
set(gcf,'DefaultAxesFonts',12);
plot(ceil_time,ceil_series(:,2),'b.');
xlim([0 24]); set(gca,'xtick',[0:4:24]);ylim([0 7700]);
xlabel('Time (UTC)','FontName','times','FontSize',16);
ylabel('Height (m)','FontName','times','FontSize',12);
title(['AMMA 2007 ' jdn '/' fn(1:2) '-' fn(4:5) '-' fn(7:8) ', Ceilometer Cloud Base'],'FontName','times','FontSize',12);
if pltflg
print_buffer = ['F:/AMMA_2007/RHB/ceilometer/Raw_Images/', cruise_name, jdn '_' fn, '_base.jpg'];
print('-djpeg90 ', print_buffer);
%print_buffer = [process_images_path, cruise_name,'cb',jdn,'.jpg'];
%print('-djpeg90 ', print_buffer);
end

figure(6)
set(gcf,'DefaultAxesFonts',12);
imagesc(ceil_time,height*1000,log10(abs(ceil_b)));
axis xy; colorbar;
xlim([0 24]); set(gca,'xtick',[0:4:24]);ylim([0 7700]);
xlabel('Time (UTC)','FontName','times','FontSize',12);
ylabel('Height (m)','FontName','times','FontSize',12);
title(['AMMA 2007 ' jdn '/' fn(1:2) '-' fn(4:5) '-' fn(7:8) ', Ceilometer Backscatter'],'FontName','times','FontSize',12);
if pltflg
print_buffer = [process_images_path, cruise_name, jdn '_' fn, '_backscatter.jpg'];
print('-djpeg90 ', print_buffer);
end