function plotValues=plotband(channel,currentTimeInfo,currentVar,plotValues,displayAxis,doflipud,dofliplr,currentColormap,rectVals)
% Gets data from an AIRS Level 1B infrared data file and plots based on the selected channel
% Input: channel to plot,selected band,radiance data, axis to display, 
% Kevin Baggett
% Tue Jul 16 16:38:36 UTC 2002

colormap(currentColormap);

axes(displayAxis);
cla;

[x,y]=size(plotValues);
if nargin > 8 % if rectangle specified
    plotValues=getPlotValues(plotValues,doflipud,dofliplr,rectVals);
else
    plotValues=getPlotValues(plotValues,doflipud,dofliplr);
end

imagesc(plotValues);

set(gca,'XTick',[],'YTick',[]);
if nargin > 8
    title(sprintf('Channel %10.4f, %s Data',channel,currentVar));
else
    currentDate=getDateFromSecsSince1993(currentTimeInfo);
    title(sprintf('Channel %10.4f, %s Data, Scan Starting at %s',channel,currentVar,currentDate));
end
cmin=min(min(plotValues));
cmax=max(max(plotValues));
%cmin and cmax will not be different if nighttime and visible
if cmin~=cmax
    set(gca,'CLim',[cmin,cmax]);
    c=colorbar;
    set(c,'Units','Pixels');
    label=get(c,'XLabel');
    switch currentVar
    case 'Radiance'
        set(label,'String','Radiance (W/m^2/ster/cm^{-1})');
    case 'Brightness Temperature'
        set(label,'String','Brightness Temperature (K)');
    end
end
