[Dart-dev] DART/releases Revision: 11507

dart at ucar.edu dart at ucar.edu
Tue Apr 18 17:53:32 MDT 2017


thoar at ucar.edu
2017-04-18 17:53:31 -0600 (Tue, 18 Apr 2017)
357
Small change to the logic behind plotting the time series when
there are more temporal bins than data. Better annotation along
time series axis when time series are short.

All of these functions were indented a'la matlab.
The profile functions did not change meaningfully.

This will facilitate removing the third-party toolboxes 
if/when that day comes.




Modified: DART/releases/Lanai/diagnostics/matlab/plot_bias_xxx_profile.m
===================================================================
--- DART/releases/Lanai/diagnostics/matlab/plot_bias_xxx_profile.m	2017-04-18 23:35:46 UTC (rev 11506)
+++ DART/releases/Lanai/diagnostics/matlab/plot_bias_xxx_profile.m	2017-04-18 23:53:31 UTC (rev 11507)
@@ -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.
@@ -72,12 +72,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
 
 %%--------------------------------------------------------------------
@@ -111,7 +111,7 @@
 % Matlab wants character matrices to be Nx1 instead of 1xN.
 
 if (plotdat.nregions == 1 && (size(plotdat.region_names,2) == 1) )
-   plotdat.region_names = deblank(plotdat.region_names');
+    plotdat.region_names = deblank(plotdat.region_names');
 end
 
 % Coordinate between time types and dates
@@ -132,7 +132,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);
@@ -155,149 +155,149 @@
 % 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
-
-   guessdims = nc_var_dims(  fname, plotdat.guessvar);
-   analydims = nc_var_dims(  fname, plotdat.analyvar);
-   varinfo   = nc_getvarinfo(fname, plotdat.analyvar);
-
-   % 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(guessdims{2},'surface')))
-      fprintf('%s is a surface field.\n',plotdat.guessvar)
-      fprintf('Cannot display a surface field this way.\n')
-      continue
-   elseif (~ isempty(strfind(guessdims{2},'undef')))
-      fprintf('%s has no vertical definition.\n',plotdat.guessvar)
-      fprintf('Cannot display this field this way.\n')
-      continue
-   end
-
-   [level_org, level_units, nlevels, level_edges, Yrange] = FindVerticalInfo(fname, plotdat.guessvar);
-   plotdat.level_org   = level_org;
-   plotdat.level_units = level_units;
-   plotdat.nlevels     = nlevels;
-   plotdat.level_edges = level_edges;
-   plotdat.Yrange      = Yrange;


More information about the Dart-dev mailing list