[Dart-dev] DART/branches Revision: 11506

dart at ucar.edu dart at ucar.edu
Tue Apr 18 17:35:48 MDT 2017


thoar at ucar.edu
2017-04-18 17:35:46 -0600 (Tue, 18 Apr 2017)
211
These support the case when there are more bins than actual data.
The axes used to get screwed up.
The evolution plots have better annotation for short time spans.
Tested with R2015b without third-party tools.




Modified: DART/branches/rma_trunk/diagnostics/matlab/plot_bias_xxx_profile.m
===================================================================
--- DART/branches/rma_trunk/diagnostics/matlab/plot_bias_xxx_profile.m	2017-04-18 20:53:10 UTC (rev 11505)
+++ DART/branches/rma_trunk/diagnostics/matlab/plot_bias_xxx_profile.m	2017-04-18 23:35:46 UTC (rev 11506)
@@ -32,7 +32,7 @@
 %            Default is to plot all available observation types.
 %
 % OUTPUT: 'plotdat' is a structure containing what was plotted.
-%         A .pdf of each graphic is created. Each .pdf has a name that 
+%         A .pdf of each graphic is created. Each .pdf has a name that
 %         reflects the variable, quantity, and region being plotted.
 %
 % EXAMPLE 1: All the observation types possible are plotted in separate figures.
@@ -69,7 +69,7 @@
     addParamValue(p,'obsname',default_obsname, at ischar);
 end
 
-parse(p, fname, copy, varargin{:});
+p.parse(fname, copy, varargin{:});
 
 % if you want to echo the input
 % disp(['fname   : ', p.Results.fname])
@@ -77,12 +77,12 @@
 % disp(['obsname : ', p.Results.obsname])
 
 if ~isempty(fieldnames(p.Unmatched))
-   disp('Extra inputs:')
-   disp(p.Unmatched)
+    disp('Extra inputs:')
+    disp(p.Unmatched)
 end
 
 if (exist(fname,'file') ~= 2)
-   error('file/fname <%s> does not exist',fname)
+    error('file/fname <%s> does not exist',fname)
 end
 
 %%--------------------------------------------------------------------
@@ -108,7 +108,7 @@
 plotdat.hlevel_edges  = local_ncread(fname, 'hlevel_edges');
 plotdat.bincenters    = ncread(fname, 'time');
 plotdat.binedges      = ncread(fname, 'time_bounds');
-plotdat.region_names  = ncread(fname, 'region_names')';
+plotdat.region_names  = strtrim(ncread(fname, 'region_names')');
 [plotdat.nregions,~]  = nc_dim_info(fname,'region');
 
 % Coordinate between time types and dates
@@ -128,7 +128,7 @@
 plotdat.Nbins         = length(plotdat.bincenters);
 plotdat.toff          = plotdat.binedges(1) + iskip;
 plotdat.timespan      = sprintf('%s through %s', datestr(plotdat.toff), ...
-                        datestr(max(plotdat.binedges(:))));
+    datestr(max(plotdat.binedges(:))));
 plotdat.xlabel        = sprintf('bias (%s) and %s',plotdat.biasconv,copy);
 
 [plotdat.allvarnames, plotdat.allvardims] = get_varsNdims(fname);
@@ -151,140 +151,140 @@
 % Either use all the variables or just the one optionally specified.
 
 if strcmp(p.Results.obsname,'none')
-   varlist = 1:plotdat.nvars;
+    varlist = 1:plotdat.nvars;
 else
-   varlist = find (strcmpi(p.Results.obsname,plotdat.varnames));
-   if isempty(varlist)
-      error('%s is not in the list of observations',p.Results.obsname)
-   end
+    varlist = find (strcmpi(p.Results.obsname,plotdat.varnames));
+    if isempty(varlist)
+        error('%s is not in the list of observations',p.Results.obsname)
+    end
 end
 
 for ivar = varlist
-
-   % create the variable names of interest.
-
-   plotdat.myvarname = plotdat.varnames{ivar};
-   plotdat.guessvar  = sprintf('%s_VPguess',plotdat.varnames{ivar});
-   plotdat.analyvar  = sprintf('%s_VPanaly',plotdat.varnames{ivar});
-
-   plotdat.trusted   = nc_read_att(fname, plotdat.guessvar, 'TRUSTED');
-   if (isempty(plotdat.trusted)), plotdat.trusted = 'NO'; end
-
-   % get appropriate vertical coordinate variable
-
-   [dimnames,~] = nc_var_dims(fname, plotdat.guessvar);
-
-   % this is a superfluous check ... FindVerticalVars already weeds out
-   % variables only present on surface or undef because obs_diag
-   % does not time-average statistics for these.
-
-   if (~ isempty(strfind(dimnames{2},'surface')))
-      fprintf('%s is a surface field.\n',plotdat.guessvar)
-      fprintf('Cannot display a surface field this way.\n')
-      continue
-   elseif (~ isempty(strfind(dimnames{2},'undef')))
-      fprintf('%s has no vertical definition.\n',plotdat.guessvar)
-      fprintf('Cannot display this field this way.\n')
-      continue
-   end


More information about the Dart-dev mailing list