-
Joe Taylor authoredJoe Taylor authored
cris_ru_plot.m 3.96 KiB
function f_h = cris_ru_plot(RU,pname_out,fname_out);
% function f_h = cris_ru_plot(RU,pname_out,fname_out);
%
% This is a function to plot the granule mean (all FOVs, all FORs, all scans) brightness temperature,
% and 3-sigma (k=3 coverage factor) RU in the same 9-panel format as figure 1 in the
% NASA Cross-track Infrared Sounder (CrIS) Level 1B Radiometric Uncertainty Description Document
%
% Inputs
% RU RU structure generated by cris_gran_RU_ncparam.m
% pname_out full path to output directory where figure will be saved in .png format
% fname_out name of output file that figure will be saved to in .png format (.png extension will be added to fname_out)
%
% Outputs
% f_h handle to figure
%
% JKT, University of Wisconsin-Madison Space Science and Engineering Center (UW-SSEC)
rucol(1,:) = [0.8431,0.1882,0.1529];
rucol(2,:) = [0.9961,0.8784,0.5451];
rucol(3,:) = [0.6510,0.8510,0.4157];
rucol(4,:) = [0.1020,0.5961,0.3137];
rucol(5,:) = [0.3294,0.1529,0.5608];
rucol(6,:) = [0.8706,0.4667,0.6824];
rucol(7,:) = [0,0,0];
cmap_btscat = parula(128);
%% Fontsize and Fontweight
fs = 8;fw = 'n';
ML = 0.1; % margin left
MR = 0.225; % margin right
MB = 0.2; % margin bottom
MT = 0.1; % margin top
HS = 0.03; % horizontal spacing
VS = 0.08; % vertical spacing
ylims_dbt = [-0.25 0.32];
ylims_dbtscatter = [0 0.32];
bands{1} = 'lw';
bands{2} = 'mw';
bands{3} = 'sw';
w = 12;
h = 10;
p = 0.01;
f_h = figure;
clf
set(f_h,'Units','inches');
screenpos = get(f_h,'Position');
set(f_h,...
'Position',[screenpos(1:2) w h],...
'PaperUnits','inches',...
'PaperPosition',[p*w p*h w h],...
'PaperSize',[w*(1+2*p) h*(1+2*p)]);
for ii = 1:length(bands)
clear leg_str
v = RU.(bands{ii}).v;
rad1 = squeeze(nanmean(RU.(bands{ii}).rad,2));
radu.T_ict = squeeze(nanmean(RU.(bands{ii}).ru_rad.dT_ict,2));
leg_str{1} = 'u(T_{ICT})';
radu.e_ict = squeeze(nanmean(RU.(bands{ii}).ru_rad.de_ict,2));
leg_str{2} = 'u(\epsilon_{ICT})';
radu.refl_meas = squeeze(nanmean(RU.(bands{ii}).ru_rad.refl_meas,2));
leg_str{3} = 'u(T_{Refl,meas})';
radu.refl_mod = squeeze(nanmean(RU.(bands{ii}).ru_rad.refl_mod,2));
leg_str{4} = 'u(T_{Refl,model})';
radu.polarization = squeeze(nanmean(RU.(bands{ii}).ru_rad.pol,2));
leg_str{5} = 'u(Pol Corr)';
radu.NLC = squeeze(nanmean(RU.(bands{ii}).ru_rad.dnlc,2));
leg_str{6} = 'u(NLC)';
radu.total = squeeze(nanmean(RU.(bands{ii}).ru_rad.total,2));
leg_str{7} = 'Total RU';
bt1 = rad2bt_l1b(v,rad1);
ru_flds = fieldnames(radu);
for iflds = 1:length(ru_flds)
btu.(ru_flds{iflds}) = rad2bt_l1b(v,rad1+radu.(ru_flds{iflds}))-bt1;
end
ru_ax(ii) = subplot(3,3,ii);
plot(v,nanmean(bt1(:,:),2),'color',[0.1294,0.4431,0.7098],'linewidth',1)
set(gca,'FontSize',fs,'FontWeight',fw,'XLim',[min(v)-20 max(v)+20],'YLim',[180 300])
if ii == 1
ylabel('BT (K)');
end
if ii == 2
title(sprintf('%s, All FOV mean',strrep(fname_out,'_','\_')));
end
grid on
ru_ax(ii+3) = subplot(3,3,ii+3);
hold on
for iflds = 1:length(ru_flds)
dy = btu.(ru_flds{iflds});
plot(v,nanmean(dy(:,:),2),'color',rucol(iflds,:),'linewidth',1)
end
set(gca,'FontSize',fs,'FontWeight',fw,'XLim',[min(v)-20 max(v)+20],'YLim',ylims_dbt)
xlabel('wavenumber');
if ii == 1
ylabel('3-sigma RU (K)')
end
grid on
if ii == 3
pos = get(gca,'position');
h_l = legend(leg_str);
h_pos = get(h_l,'Pos');
set(h_l,'Position',[1-h_pos(3),h_pos(2:4)]);
end
ru_ax(ii+6) = subplot(3,3,ii+6);
scatter(nanmean(bt1(:,:),2),nanmean(btu.total(:,:),2),5,v,'filled');
set(gca,'FontSize',fs,'FontWeight',fw,'YLim',[ylims_dbtscatter],'Box','on','XLim',[200 300])
xlabel('BT (K)');
if ii == 1
ylabel('3-sigma RU (K)');
end
grid on
pos = get(gca,'position');
hc = colorbar('hor');set(hc,'FontSize',8,'FontWeight',fw);
set(ru_ax(ii+6),'Position',pos);
set(get(hc,'XLabel'),'String','wavenumber','FontSize',8,'FontWeight','n')
cbpos = get(hc,'Pos');
set(hc,'Position',[cbpos(1) cbpos(2)+0.01 cbpos(3) cbpos(4)])
colormap(cmap_btscat)
end
print('-dpng',fullfile(pname_out,sprintf('RU_%s_%02d.png',fname_out,1)));
return