function [] = his_noise_plots(print_flag,filedate)

%
%       function [] = his_noise_plots(filedate)
%
%   ....Plots the noise estimates from the HIS QC files.
%       print_flag = 1 for printing.
%
%       Written by Von P. Walden
%                  14 May 1998
%

%
%   ....Sets hardwired directory structure.
%
direc = 'd:\fireiii\data\HIS\';    % This line is changed depending on the dir structure.
direc = [direc,'ac',num2str(filedate),'\'];

%
%   ....Reads in HIS QC data.
%
his1 = umereader([direc,'qc\hc1']);
his3 = umereader([direc,'qc\hc3']);
his5 = umereader([direc,'qc\hc5']);

%
%   Average radiance plot.
%
b5 = find(his5.freq > 600  & his5.freq < 1080);
b3 = find(his3.freq > 1080 & his3.freq < 1850);
b1 = find(his1.freq > 1850 & his1.freq < 2800);
plot(his5.freq(b5),his5.rad(21,b5),'b',his3.freq(b3),his3.rad(21,b3),'b',his1.freq(b1),his1.rad(21,b1),'b')
axis([600 2800 -5 160])
xlabel('Wavenumber (cm^{-1})');
ylabel('Radiance [mW m^{-2} sr^{-1} (cm^{-1})^{-1}]')
h = text(1400,140,['Ave. radiance ',num2str(filedate),' FIRE-III']);
set(h,'color','b');
title(['Average HIS Radiance for all channels: ',num2str(filedate)]);
set(gcf,'PaperPositionMode','auto');
eval(['print -djpeg ',direc,'AveRad_',num2str(filedate),'.jpg']);
if print_flag print -dwinc; end

%   SW band
plot(his1.freq,his1.rad(24,:),'r',his1.freq,his1.rad(26,:),'b')
axis([2000 2800 0 0.5])
xlabel('Wavenumber (cm^{-1})')
ylabel('Noise Equivalent Radiance [mW m^{-2} sr^{-1} (cm^{-1})^{-1}]')
h = text(2300,0.425,['HBB SD Band 3 ',num2str(filedate),' FIRE III']);
set(h,'color','r');
h = text(2300,0.4,'CBB');
set(h,'color','b');
title(['Noise Estimate for HIS: ',num2str(filedate),'  SW band'])
set(gcf,'PaperPositionMode','auto');
eval(['print -djpeg ',direc,'SWnoise_',num2str(filedate),'.jpg']);
if print_flag print -dwinc; end

%   MW band
plot(his3.freq,his3.rad(24,:),'r',his3.freq,his3.rad(26,:),'b')
axis([1080 1800 0 2])
xlabel('Wavenumber (cm^{-1})')
ylabel('Noise Equivalent Radiance [mW m^{-2} sr^{-1} (cm^{-1})^{-1}]')
h = text(1300,1.8,['HBB SD Band 2 ',num2str(filedate),' FIRE III']);
set(h,'color','r');
h = text(1300,1.7,'CBB');
set(h,'color','b');
title(['Noise Estimate for HIS: ',num2str(filedate),'  MW band'])
set(gcf,'PaperPositionMode','auto');
eval(['print -djpeg ',direc,'MWnoise_',num2str(filedate),'.jpg']);
if print_flag print -dwinc; end

%   LW band
plot(his5.freq,his5.rad(24,:),'r',his5.freq,his5.rad(26,:),'b')
axis([600 1080 0 5])
xlabel('Wavenumber (cm^{-1})')
ylabel('Noise Equivalent Radiance [mW m^{-2} sr^{-1} (cm^{-1})^{-1}]')
h = text(750,4.5,['HBB SD Band 1 ',num2str(filedate),' FIRE III']);
set(h,'color','r');
h = text(750,4,'CBB');
set(h,'color','b');
title(['Noise Estimate for HIS: ',num2str(filedate),'  LW band'])
set(gcf,'PaperPositionMode','auto');
eval(['print -djpeg ',direc,'LWnoise_',num2str(filedate),'.jpg']);
if print_flag print -dwinc; end
