[Dart-dev] DART/branches Revision: 13094

dart at ucar.edu dart at ucar.edu
Tue Apr 2 15:34:21 MDT 2019


thoar at ucar.edu
2019-04-02 15:34:21 -0600 (Tue, 02 Apr 2019)
184
refactored ... calling functions in the private directory

instead of repeating nearly identical code for setting the figure,
reading the static data from an obs_diag netCDF file ...




Modified: DART/branches/qc8diags/diagnostics/matlab/plot_evolution.m
===================================================================
--- DART/branches/qc8diags/diagnostics/matlab/plot_evolution.m	2019-04-01 20:23:56 UTC (rev 13093)
+++ DART/branches/qc8diags/diagnostics/matlab/plot_evolution.m	2019-04-02 21:34:21 UTC (rev 13094)
@@ -27,7 +27,7 @@
 %            Possible values are available in the netcdf 'CopyMetaData' variable.
 %            (ncdump -v CopyMetaData obs_diag_output.nc)
 %
-% varargin: optional, parameter-value pairs. Supported parameters are described below.
+% 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.
@@ -38,6 +38,13 @@
 % range    : 'range' of the value being plotted. Default is to
 %                automatically determine range based on the data values.
 %
+% 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 last plotted.
 %         A postscript file containing a page for each level - each region.
 %         The other file is a simple text file containing summary information
@@ -45,6 +52,7 @@
 %         Both of these filenames contain the observation type,
 %         copy and region as part of the name.
 %
+%
 % EXAMPLE 1 - plot the evolution of the bias for all observation types, all levels
 %
 % fname   = 'obs_diag_output.nc';
@@ -64,8 +72,8 @@
 % EXAMPLE 3 - plot the evolution of the rmse for just the radiosonde temperature obs
 %             for the 4th level and force the vertical axis of the 'rmse' to be 0,10
 %
-% plotdat    = plot_evolution(fname, copy, 'obsname', 'RADIOSONDE_TEMPERATURE', ...
-%                             'level', 4, 'range', [0 10]);
+% plotdat    = plot_evolution(fname, 'rmse', 'obsname', 'RADIOSONDE_TEMPERATURE', ...
+%                             'level', 4, 'range', [0 10], 'pause', false);
 
 %% DART software - Copyright UCAR. This open source software is provided
 % by UCAR, "as is", without charge, subject to all terms of use at
@@ -76,9 +84,9 @@
 default_obsname = 'none';
 default_range = [NaN NaN];
 default_level = -1;
-default_verbosity = 'yes';
+default_verbosity = true;
 default_markersize = 8;
-default_pause = 'no';
+default_pause = false;
 p = inputParser;
 
 addRequired(p,'fname', at ischar);
@@ -85,18 +93,18 @@
 addRequired(p,'copy', at ischar);
 if (exist('inputParser/addParameter','file') == 2)
     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);
     addParameter(p,'level',      default_level,      @isnumeric);
-    addParameter(p,'verbose',    default_verbosity,  @ischar);
-    addParameter(p,'MarkerSize', default_markersize, @isnumeric);
-    addParameter(p,'pause',      default_pause,      @ischar);
 else
     addParamValue(p,'obsname',   default_obsname,    @ischar);
+    addParamValue(p,'verbose',   default_verbosity,  @islogical);
+    addParamValue(p,'MarkerSize',default_markersize, @isnumeric);
+    addParamValue(p,'pause',     default_pause,      @islogical);
     addParamValue(p,'range',     default_range,      @isnumeric);
     addParamValue(p,'level',     default_level,      @isnumeric);
-    addParamValue(p,'verbose',   default_verbosity,  @ischar);
-    addParamValue(p,'MarkerSize',default_markersize, @isnumeric);
-    addParamValue(p,'pause',     default_pause,      @ischar);
 end
 p.parse(fname, copy, varargin{:});
 
@@ -105,13 +113,6 @@
     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
@@ -131,51 +132,9 @@
 % Harvest plotting info/metadata from netcdf file.
 %---------------------------------------------------------------------
 


More information about the Dart-dev mailing list