[Dart-dev] DART/branches Revision: 12993
dart at ucar.edu
dart at ucar.edu
Fri Mar 1 14:05:02 MST 2019
thoar at ucar.edu
2019-03-01 14:05:02 -0700 (Fri, 01 Mar 2019)
408
plot_evolution.m uses 'standard' DART colorscheme and cleanly handles
obs_diag_output.nc files that do not have posterior observation values.
get_copy_index now uses parameter,value arguments.
This extends the concept of 'context' and allows for non-fatal behavior if so desired.
If there is no dart QC 8 copy, you can query for it without dying.
It returns a -1 if there is no copy of the desired name.
Modified: DART/branches/recam/diagnostics/matlab/plot_evolution.m
===================================================================
--- DART/branches/recam/diagnostics/matlab/plot_evolution.m 2019-03-01 18:37:12 UTC (rev 12992)
+++ DART/branches/recam/diagnostics/matlab/plot_evolution.m 2019-03-01 21:05:02 UTC (rev 12993)
@@ -73,6 +73,7 @@
default_level = -1;
default_obsname = 'none';
+default_verbosity = 'yes';
default_range = [NaN NaN];
p = inputParser;
@@ -82,10 +83,12 @@
addParameter(p,'obsname',default_obsname, at ischar);
addParameter(p,'range',default_range, at isnumeric);
addParameter(p,'level',default_level, at isnumeric);
+ addParameter(p,'verbose',default_verbosity, at ischar);
else
addParamValue(p,'obsname',default_obsname, at ischar);
addParamValue(p,'range',default_range, at isnumeric);
addParamValue(p,'level',default_level, at isnumeric);
+ addParamValue(p,'verbose',default_verbosity, at ischar);
end
p.parse(fname, copy, varargin{:});
@@ -101,6 +104,13 @@
disp(p.Unmatched)
end
+global verbose
+if (strncmpi(p.Results.verbose,'y',1))
+ verbose = 1;
+else
+ verbose = 0;
+end
+
if (numel(p.Results.range) ~= 2)
error('range must be an array of length two ... [bottom top]')
end
@@ -185,19 +195,11 @@
plotdat.NQC5index = get_copy_index(fname,'N_DARTqc_5');
plotdat.NQC6index = get_copy_index(fname,'N_DARTqc_6');
plotdat.NQC7index = get_copy_index(fname,'N_DARTqc_7');
+plotdat.NQC8index = get_copy_index(fname,'N_DARTqc_8','fatal','no');
-%
-
+global figuredata
figuredata = setfigure();
-plotdat.ges_color = 'k';
-plotdat.anl_color = 'r';
-plotdat.ges_marker = '+';
-plotdat.anl_marker = 'x';
-plotdat.ges_linestyle = '-';
-plotdat.anl_linestyle = '-';
-plotdat.ges_linewidth = figuredata.linewidth;
-plotdat.anl_linewidth = figuredata.linewidth;
%%---------------------------------------------------------------------
% Loop around (time-copy-level-region) observation types
@@ -205,19 +207,19 @@
psfname = cell(plotdat.nvars);
for ivar = 1:plotdat.nvars
-
+
% create the variable names of interest.
-
+
plotdat.myvarname = plotdat.varnames{ivar};
plotdat.guessvar = sprintf('%s_guess',plotdat.varnames{ivar});
plotdat.analyvar = sprintf('%s_analy',plotdat.varnames{ivar});
-
+
plotdat.trusted = nc_read_att(fname, plotdat.guessvar, 'TRUSTED');
if (isempty(plotdat.trusted)), plotdat.trusted = 'NO'; end
-
+
% remove any existing postscript file - will simply append each
% level as another 'page' in the .ps file.
-
+
for iregion = 1:plotdat.nregions
psfname{iregion} = sprintf('%s_%s_evolution_region%d.ps', ...
plotdat.varnames{ivar}, plotdat.copystring, iregion);
@@ -224,21 +226,21 @@
fprintf('Removing %s from the current directory.\n',psfname{iregion})
system(sprintf('rm %s',psfname{iregion}));
end
-
+
% remove any existing log file -
-
+
lgfname = sprintf('%s_%s_obscount.txt',plotdat.varnames{ivar},plotdat.copystring);
fprintf('Removing %s from the current directory.\n',lgfname)
system(sprintf('rm %s',lgfname));
logfid = fopen(lgfname,'wt');
fprintf(logfid,'%s\n',lgfname);
-
More information about the Dart-dev
mailing list