Commit 73326d90 authored by Joe Taylor's avatar Joe Taylor
Browse files

added option 2 support for saveTotalRU_FLAG, which will save RU only and not the radiances

parent 4d6f02f9
Pipeline #37324 passed with stage
in 7 minutes and 24 seconds
......@@ -58,7 +58,8 @@ l1b_pname = '/Users/joet/git/cris_l1b_user/RU/TEST_INPUT'; % set to path to v
ru_code_pname = pwd; % set to path of the RU code
saveTotalRU_FLAG = 1; % set to 1 if you want to save the RSS RU to a mat file
saveTotalRU_FLAG = 1; % set to 1 if you want to save the radiances and RSS RU to a mat file
% set to 2 if you want to save the RSS RU to a mat file
pname_out = fullfile(pwd,'RU_OUT_NC'); % set to path for RU output files
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% END: USER INPUT
......
......@@ -8,7 +8,8 @@ function RU = cris_gran_RU_ncparam(sat_name,l1b_fname,saveTotalRU_FLAG,pname_out
% Inputs
% sat_name satellite name ('J1' or 'SNPP')
% l1b_fname L1b granule name (including path if not in same directory as code)
% saveTotalRU_FLAG set to 1 if you want to save the RSS RU to a mat file
% saveTotalRU_FLAG == 1, save radiances and RSS RU to a mat file
% == 2, save RSS RU to a mat file
% pname_out output directory
%
% JKT 2022-Mar-02
......@@ -283,12 +284,17 @@ for jj = 1:length(bands)
RU_out.(bands{jj}).v = v;
RU_out.(bands{jj}).ru_delta = ru_delta;
RU_out.(bands{jj}).ru_rad_rss = RU.(bands{jj}).ru_rad.total;
RU_out.(bands{jj}).rad = RU.(bands{jj}).rad_polcorr;
if saveTotalRU_FLAG == 1
RU_out.(bands{jj}).rad = RU.(bands{jj}).rad_polcorr;
end
end %%%%%%%%%%%%%%%%%%%% end loop over bands, jj %%%%%%%%%%%%%%%%%%%%
RU_out.opts = opts;
if saveTotalRU_FLAG == 1
fprintf(1,'Saving RU output file\n');
RU_out.opts = opts;
fprintf(1,'Saving radiances and Total RU to output file\n');
save(fullfile(pname_out,sprintf('%s.mat',fname_out)), 'RU_out');
elseif saveTotalRU_FLAG == 2
fprintf(1,'Saving Total RU to output file\n');
save(fullfile(pname_out,sprintf('%s.mat',fname_out)), 'RU_out');
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment