[Dart-dev] DART/trunk Revision: 11502

dart at ucar.edu dart at ucar.edu
Mon Apr 17 20:26:51 MDT 2017


thoar at ucar.edu
2017-04-17 20:26:48 -0600 (Mon, 17 Apr 2017)
490
fixed a problem where only a subset of the declared bins had data.
The x axis limits are originally determined based on the valid data (a subset)
and then the number of obs possible (zeros) would get plotted for
times outside the first x axis limits.

May have also fixed a problem when the entire timeframe being 
plotted is less than a day - the X axis ticks are much more 
legible and have meaningful values. Had to remove the 'keepticks' 
option to 'datetick' ... in this application.




Modified: DART/trunk/diagnostics/matlab/plot_evolution.m
===================================================================
--- DART/trunk/diagnostics/matlab/plot_evolution.m	2017-04-17 22:53:12 UTC (rev 11501)
+++ DART/trunk/diagnostics/matlab/plot_evolution.m	2017-04-18 02:26:48 UTC (rev 11502)
@@ -79,13 +79,13 @@
 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,'range',default_range, at isnumeric);
-   addParameter(p,'level',default_level, at isnumeric);
+    addParameter(p,'obsname',default_obsname, at ischar);
+    addParameter(p,'range',default_range, at isnumeric);
+    addParameter(p,'level',default_level, at isnumeric);
 else
-   addParamValue(p,'obsname',default_obsname, at ischar);
-   addParamValue(p,'range',default_range, at isnumeric);
-   addParamValue(p,'level',default_level, at isnumeric);
+    addParamValue(p,'obsname',default_obsname, at ischar);
+    addParamValue(p,'range',default_range, at isnumeric);
+    addParamValue(p,'level',default_level, at isnumeric);
 end
 parse(p, fname, copy, varargin{:});
 
@@ -97,23 +97,23 @@
 % fprintf('range   : %f %f \n', p.Results.range)
 
 if ~isempty(fieldnames(p.Unmatched))
-   disp('Extra inputs:')
-   disp(p.Unmatched)
+    disp('Extra inputs:')
+    disp(p.Unmatched)
 end
 
 if (numel(p.Results.range) ~= 2)
-   error('range must be an array of length two ... [bottom top]')
+    error('range must be an array of length two ... [bottom top]')
 end
 
 if strcmp(p.Results.obsname,'none')
-   nvars = 0;
+    nvars = 0;
 else
-   obsname = p.Results.obsname;
-   nvars = 1;
+    obsname = p.Results.obsname;
+    nvars = 1;
 end
 
 if (exist(fname,'file') ~= 2)
-   error('file/fname <%s> does not exist',fname)
+    error('file/fname <%s> does not exist',fname)
 end
 
 %%--------------------------------------------------------------------
@@ -136,7 +136,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
 
 dimensionality        = nc_read_att(fname, nc_global, 'LocationRank');
@@ -156,12 +156,12 @@
 timebase     = sscanf(timeunits,'%*s%*s%d%*c%d%*c%d'); % YYYY MM DD
 timeorigin   = datenum(timebase(1),timebase(2),timebase(3));
 if ( isempty(time_to_skip) == 1)
-   iskip = 0;
+    iskip = 0;
 elseif ( numel(time_to_skip) == 6)
-   skip_seconds = time_to_skip(4)*3600 + time_to_skip(5)*60 + time_to_skip(6);
-   iskip        = time_to_skip(3) + skip_seconds/86400;
+    skip_seconds = time_to_skip(4)*3600 + time_to_skip(5)*60 + time_to_skip(6);
+    iskip        = time_to_skip(3) + skip_seconds/86400;
 else
-   error('time_to_skip variable has unusual length. Should be either 0 or 6.')
+    error('time_to_skip variable has unusual length. Should be either 0 or 6.')
 end
 
 % set up a structure with all static plotting components
@@ -172,12 +172,12 @@
 plotdat.toff       = plotdat.bincenters(1) + iskip;
 
 if (nvars == 0)
-   [plotdat.allvarnames, plotdat.allvardims] = get_varsNdims(fname);
-   [plotdat.varnames,    plotdat.vardims]    = FindTemporalVars(plotdat);
-   plotdat.nvars       = length(plotdat.varnames);
+    [plotdat.allvarnames, plotdat.allvardims] = get_varsNdims(fname);
+    [plotdat.varnames,    plotdat.vardims]    = FindTemporalVars(plotdat);
+    plotdat.nvars       = length(plotdat.varnames);
 else
-   plotdat.varnames{1} = obsname;
-   plotdat.nvars       = nvars;
+    plotdat.varnames{1} = obsname;
+    plotdat.nvars       = nvars;
 end
 
 plotdat.copyindex   = get_copy_index(fname,copy);
@@ -196,163 +196,163 @@
 psfname = cell(plotdat.nvars);


More information about the Dart-dev mailing list