[Dart-dev] DART/branches Revision: 13141

dart at ucar.edu dart at ucar.edu
Tue Apr 30 13:58:14 MDT 2019


thoar at ucar.edu
2019-04-30 13:58:14 -0600 (Tue, 30 Apr 2019)
39
trellis plot of vertical performance 




Added: DART/branches/reanalysis/diagnostics/matlab/two_experiments_overview.m
===================================================================
--- DART/branches/reanalysis/diagnostics/matlab/two_experiments_overview.m	                        (rev 0)
+++ DART/branches/reanalysis/diagnostics/matlab/two_experiments_overview.m	2019-04-30 19:58:14 UTC (rev 13141)
@@ -0,0 +1,596 @@
+function two_experiments_overview(file1,label1,file2,label2,varargin)
+%% two_experiments_overview create a trellis-plot-like view of the comparison of two experiments.
+%
+% EXAMPLE :
+%
+% file1 = 'Diags_2010.08.15-31_0-500m/obs_diag_output.nc';
+% file2 = 'Diags_2010.08.15-31_Fixed_0-500m/obs_diag_output.nc';
+% label1 = 'Experiment 1';
+% label2 = 'Experiment 2';
+% two_experiments_overview(file1, label1, file2, label2)
+%
+% EXAMPLE : specifying a 'flag level' to indicate 'weak' areas:
+% In this case any region/level with only 10% of the max obs is 'weak'.
+%
+% two_experiments_overview(file1,label1,file2,label2,'FlagLevel',0.10)
+%
+% verticalobs = { ...
+%     'RADIOSONDE_U_WIND_COMPONENT', 'RADIOSONDE_V_WIND_COMPONENT', ...
+%     'RADIOSONDE_TEMPERATURE',      'RADIOSONDE_SPECIFIC_HUMIDITY', ...
+%     'ACARS_U_WIND_COMPONENT',      'ACARS_V_WIND_COMPONENT', ...
+%     'ACARS_TEMPERATURE',           'GPSRO_REFRACTIVITY', ...
+%     'AIRCRAFT_U_WIND_COMPONENT',   'AIRCRAFT_V_WIND_COMPONENT', ...
+%     'AIRCRAFT_TEMPERATURE',        'SAT_HORIZONTAL_WIND'};
+%
+% two_experiments_overview(file1,label1,file2,label2,'obsnames',verticalobs)
+
+% DART software - Copyright UCAR. This open source software is provided
+% by UCAR, "as is", without charge, subject to all terms of use at
+% http://www.image.ucar.edu/DAReS/DART/DART_download
+%
+% DART $Id$
+
+%%--------------------------------------------------------------------
+% Decode,Parse,Check the input
+%---------------------------------------------------------------------
+
+defaultFlagLevel   = 0.00;   % ten percent would be 0.10
+defaultVarCheck    = -1;
+default_verbosity  = true;
+default_markersize = 12;
+default_pause      = false;
+default_range      = [NaN NaN];
+default_obsnames   = {'all'};
+default_papertype  = 'uslegal';
+
+p = inputParser;
+
+addRequired(p,'file1' , @ischar);
+addRequired(p,'label1', @ischar);
+addRequired(p,'file2' , @ischar);
+addRequired(p,'label2', @ischar);
+
+if (exist('inputParser/addParameter','file') == 2)
+    addParameter(p, 'FlagLevel',  defaultFlagLevel,   @isnumeric);
+    addParameter(p, 'VarCheck',   defaultVarCheck,    @isnumeric);
+    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, 'obsnames',   default_obsnames,   @iscell);
+    addParameter(p, 'papertype',  default_papertype,  @ischar);
+else
+    addParamValue(p, 'FlagLevel', defaultFlagLevel,   @isnumeric); %#ok<NVREPL>
+    addParamValue(p, 'VarCheck',  defaultVarCheck,    @isnumeric); %#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>
+    addParamValue(p, 'obsnames',  default_obsnames,   @iscell);    %#ok<NVREPL>
+    addParamValue(p, 'papertype', default_papertype,  @ischar);    %#ok<NVREPL>
+end
+
+p.parse(file1,label1,file2,label2,varargin{:}) % parse inputs
+
+global figuredata
+figuredata.MarkerSize = p.Results.MarkerSize;
+figuredata.range      = p.Results.range;
+figuredata.verbose    = p.Results.verbose;
+
+%% collect the results of parsing (makes code easier to read)
+
+FileA     = p.Results.file1;
+FileB     = p.Results.file2;
+LabelA    = p.Results.label1;
+LabelB    = p.Results.label2;
+VarCheck  = p.Results.VarCheck;
+FlagLevel = p.Results.FlagLevel;
+
+if (exist(FileA,'file') ~= 2), error('File %s does not exist.',FileA); end
+if (exist(FileB,'file') ~= 2), error('File %s does not exist.',FileB); end
+
+%% prepare the figures
+% These positions fit 12 variables on a single page.
+
+f1 = gcf;    set_figure(f1, p.Results.papertype);
+f2 = figure; set_figure(f2, p.Results.papertype);


More information about the Dart-dev mailing list