[Dart-dev] DART/branches Revision: 13096
dart at ucar.edu
dart at ucar.edu
Wed Apr 3 16:24:25 MDT 2019
thoar at ucar.edu
2019-04-03 16:24:25 -0600 (Wed, 03 Apr 2019)
110
Tested and ready to go.
There is an optional argument for 'range' that is not implemented across-the-board.
Modified: DART/branches/qc8diags/diagnostics/matlab/plot_bias_xxx_profile.m
===================================================================
--- DART/branches/qc8diags/diagnostics/matlab/plot_bias_xxx_profile.m 2019-04-02 23:00:30 UTC (rev 13095)
+++ DART/branches/qc8diags/diagnostics/matlab/plot_bias_xxx_profile.m 2019-04-03 22:24:25 UTC (rev 13096)
@@ -3,8 +3,8 @@
% Part of the observation-space diagnostics routines.
%
% 'obs_diag' produces a netcdf file containing the diagnostics.
-% obs_diag condenses the obs_seq.final information into summaries for a few specified
-% regions - on a level-by-level basis.
+% 'obs_diag' condenses the obs_seq.final information into summaries for a few
+% specified regions - on a level-by-level basis.
%
% The number of observations possible reflects only those observations
% that have incoming QC values of interest. Any observation with a DART
@@ -19,7 +19,7 @@
% For TRUSTED observations, this is different than the number used to calculate
% bias, rmse, spread, etc.
%
-% USAGE: plotdat = plot_bias_xxx_profile(fname, copy);
+% USAGE: plotdat = plot_bias_xxx_profile(fname, copy [,varargin]);
%
% fname : netcdf file produced by 'obs_diag'
%
@@ -27,10 +27,20 @@
% Possible values are available in the netcdf 'CopyMetaData' variable.
% (ncdump -v CopyMetaData obs_diag_output.nc)
%
-% obsname : Optional. If present, The strings of each observation type to plot.
+% varargin: optional parameter-value pairs. Supported parameters are described below.
+%
+% obsname : The strings of each observation type to plot.
% Each observation type will be plotted in a separate graphic.
% Default is to plot all available observation types.
%
+%
+% verbose : true/false to control amount of run-time output
+%
+% MarkerSize : integer controlling the size of the symbols
+%
+% pause : true/false to conrol pausing after each figure is created.
+% true will require hitting any key to continue to next plot
+%
% OUTPUT: 'plotdat' is a structure containing what was plotted.
% A .pdf of each graphic is created. Each .pdf has a name that
% reflects the variable, quantity, and region being plotted.
@@ -59,138 +69,95 @@
%---------------------------------------------------------------------
default_obsname = 'none';
+default_verbosity = true;
+default_markersize = 8;
+default_pause = false;
+default_range = [NaN NaN];
p = inputParser;
addRequired(p,'fname', at ischar);
addRequired(p,'copy', at ischar);
if (exist('inputParser/addParameter','file') == 2)
- addParameter(p,'obsname',default_obsname, at ischar);
+ addParameter(p,'obsname', default_obsname, @ischar);
+ addParameter(p,'verbose', default_verbosity, @islogical);
+ addParameter(p,'MarkerSize', default_markersize, @isnumeric);
+ addParameter(p,'pause', default_pause, @islogical);
+ addParameter(p,'range', default_range, @isnumeric);
else
- addParamValue(p,'obsname',default_obsname, at ischar); %#ok<NVREPL>
+ addParamValue(p,'obsname', default_obsname, @ischar); %#ok<NVREPL>
+ addParamValue(p,'verbose', default_verbosity, @islogical);%#ok<NVREPL>
+ addParamValue(p,'MarkerSize',default_markersize, @isnumeric);%#ok<NVREPL>
+ addParamValue(p,'pause', default_pause, @islogical);%#ok<NVREPL>
+ addParamValue(p,'range', default_range, @isnumeric);%#ok<NVREPL>
end
-
p.parse(fname, copy, varargin{:});
-% if you want to echo the input
-% disp(['fname : ', p.Results.fname])
-% disp(['copy : ', p.Results.copy])
-% disp(['obsname : ', p.Results.obsname])
-
if ~isempty(fieldnames(p.Unmatched))
disp('Extra inputs:')
disp(p.Unmatched)
end
+if strcmp(p.Results.obsname,'none')
+ nvars = 0;
+else
+ obsname = p.Results.obsname;
+ nvars = 1;
+end
+
if (exist(fname,'file') ~= 2)
error('file/fname <%s> does not exist',fname)
end
+if (numel(p.Results.range) ~= 2)
+ error('range must be an array of length two ... [bottom top]')
+end
+
More information about the Dart-dev
mailing list