[Dart-dev] [3793] DART/trunk/diagnostics/matlab: Now checks for existence of input file, and
nancy at ucar.edu
nancy at ucar.edu
Thu Mar 19 14:26:15 MDT 2009
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/dart-dev/attachments/20090319/627715da/attachment.html
-------------- next part --------------
Modified: DART/trunk/diagnostics/matlab/plot_bias_xxx_profile.m
===================================================================
--- DART/trunk/diagnostics/matlab/plot_bias_xxx_profile.m 2009-03-18 16:12:41 UTC (rev 3792)
+++ DART/trunk/diagnostics/matlab/plot_bias_xxx_profile.m 2009-03-19 20:26:14 UTC (rev 3793)
@@ -31,11 +31,11 @@
% $Revision$
% $Date$
-%----------------------------------------------------------------------
-% Get plotting metadata from obs_diag run.
-%----------------------------------------------------------------------
+if (exist(fname,'file') ~= 2)
+ error('file/fname <%s> does not exist',fname)
+end
-% Harvest info from netcdf file.
+% Harvest plotting info/metadata from netcdf file.
plotdat.fname = fname;
plotdat.copystring = copystring;
@@ -410,17 +410,32 @@
function x = FindRange(y)
+% Trying to pick 'nice' limits for plotting.
+% Completely ad hoc ... and not well posed.
+%
% In this scope, y is bounded from below by 0.0
+%
+% If the numbers are very small ...
-glommed = [y.ges_copy(:); y.ges_bias(:); ...
- y.anl_copy(:); y.anl_bias(:)];
-
-Yrange = [floor(min(glommed)) ceil(max(glommed))];
+bob = [y.ges_copy(:) ; y.ges_bias(:); ...
+ y.anl_copy(:) ; y.anl_bias(:)];
+inds = find(isfinite(bob));
-if ( isfinite(Yrange) )
+if ( isempty(inds) )
+ x = [0 1];
+else
+ glommed = bob(inds);
+ ymin = min(glommed);
+ ymax = max(glommed);
+
+ if ( ymax > 1.0 )
+ ymin = floor(min(glommed));
+ ymax = ceil(max(glommed));
+ end
+
+ Yrange = [ymin ymax];
+
x = [min([Yrange(1) 0.0]) Yrange(2)];
-else
- x = [0 1];
end
Modified: DART/trunk/diagnostics/matlab/plot_evolution.m
===================================================================
--- DART/trunk/diagnostics/matlab/plot_evolution.m 2009-03-18 16:12:41 UTC (rev 3792)
+++ DART/trunk/diagnostics/matlab/plot_evolution.m 2009-03-19 20:26:14 UTC (rev 3793)
@@ -29,11 +29,11 @@
% $Revision$
% $Date$
-%----------------------------------------------------------------------
-% Get plotting metadata from obs_diag run.
-%----------------------------------------------------------------------
+if (exist(fname,'file') ~= 2)
+ error('file/fname <%s> does not exist',fname)
+end
-% Harvest info from netcdf file.
+% Harvest plotting info/metadata from netcdf file.
plotdat.fname = fname;
plotdat.copystring = copystring;
@@ -371,7 +371,8 @@
%
% If the numbers are very small ...
-bob = [y.ges_copy(:) ; y.anl_copy(:)];
+bob = [y.ges_copy(:) ; ...
+ y.anl_copy(:)];
inds = find(isfinite(bob));
if ( isempty(inds) )
Modified: DART/trunk/diagnostics/matlab/plot_profile.m
===================================================================
--- DART/trunk/diagnostics/matlab/plot_profile.m 2009-03-18 16:12:41 UTC (rev 3792)
+++ DART/trunk/diagnostics/matlab/plot_profile.m 2009-03-19 20:26:14 UTC (rev 3793)
@@ -31,11 +31,11 @@
% $Revision$
% $Date$
-%----------------------------------------------------------------------
-% Get plotting metadata from obs_diag run.
-%----------------------------------------------------------------------
+if (exist(fname,'file') ~= 2)
+ error('file/fname <%s> does not exist',fname)
+end
-% Harvest info from netcdf file.
+% Harvest plotting info/metadata from netcdf file.
plotdat.fname = fname;
plotdat.copystring = copystring;
@@ -404,21 +404,34 @@
function x = FindRange(y)
+% Trying to pick 'nice' limits for plotting.
+% Completely ad hoc ... and not well posed.
+%
% In this scope, y is bounded from below by 0.0
+%
+% If the numbers are very small ...
-glommed = [y.ges_copy(:); ...
- y.anl_copy(:)];
-
-Yrange = [floor(min(glommed)) ceil(max(glommed))];
+bob = [y.ges_copy(:); ...
+ y.anl_copy(:)];
+inds = find(isfinite(bob));
-if ( isfinite(Yrange) )
- x = [min([Yrange(1) 0.0]) Yrange(2)];
+if ( isempty(inds) )
+ x = [0 1];
else
- x = [0 1];
-end
+ glommed = bob(inds);
+ ymin = min(glommed);
+ ymax = max(glommed);
+ if ( ymax > 1.0 )
+ ymin = floor(min(glommed));
+ ymax = ceil(max(glommed));
+ end
+ Yrange = [ymin ymax];
+ x = [min([Yrange(1) 0.0]) Yrange(2)];
+end
+
function Stripes(x,edges)
% EraseMode: [ {normal} | background | xor | none ]
Modified: DART/trunk/diagnostics/matlab/plot_rmse_xxx_evolution.m
===================================================================
--- DART/trunk/diagnostics/matlab/plot_rmse_xxx_evolution.m 2009-03-18 16:12:41 UTC (rev 3792)
+++ DART/trunk/diagnostics/matlab/plot_rmse_xxx_evolution.m 2009-03-19 20:26:14 UTC (rev 3793)
@@ -30,11 +30,11 @@
% $Revision$
% $Date$
-%----------------------------------------------------------------------
-% Get plotting metadata from obs_diag run.
-%----------------------------------------------------------------------
+if (exist(fname,'file') ~= 2)
+ error('file/fname <%s> does not exist',fname)
+end
-% Harvest info from netcdf file.
+% Harvest plotting info/metadata from netcdf file.
plotdat.fname = fname;
plotdat.copystring = copystring;
@@ -389,7 +389,8 @@
%
% If the numbers are very small ...
-bob = [y.ges_copy(:) ; y.anl_copy(:)];
+bob = [y.ges_copy(:) ; y.ges_rmse(:) ; ...
+ y.anl_copy(:) ; y.anl_rmse(:) ];
inds = find(isfinite(bob));
if ( isempty(inds) )
Modified: DART/trunk/diagnostics/matlab/plot_rmse_xxx_profile.m
===================================================================
--- DART/trunk/diagnostics/matlab/plot_rmse_xxx_profile.m 2009-03-18 16:12:41 UTC (rev 3792)
+++ DART/trunk/diagnostics/matlab/plot_rmse_xxx_profile.m 2009-03-19 20:26:14 UTC (rev 3793)
@@ -31,11 +31,11 @@
% $Revision$
% $Date$
-%----------------------------------------------------------------------
-% Get plotting metadata from obs_diag run.
-%----------------------------------------------------------------------
+if (exist(fname,'file') ~= 2)
+ error('file/fname <%s> does not exist',fname)
+end
-% Harvest info from netcdf file.
+% Harvest plotting info/metadata from netcdf file.
plotdat.fname = fname;
plotdat.copystring = copystring;
@@ -413,21 +413,34 @@
function x = FindRange(y)
+% Trying to pick 'nice' limits for plotting.
+% Completely ad hoc ... and not well posed.
+%
% In this scope, y is bounded from below by 0.0
+%
+% If the numbers are very small ...
-glommed = [y.ges_copy(:); y.ges_rmse(:); ...
- y.anl_copy(:); y.anl_rmse(:)];
-
-Yrange = [floor(min(glommed)) ceil(max(glommed))];
+bob = [y.ges_copy(:) ; y.ges_rmse(:) ; ...
+ y.anl_copy(:) ; y.anl_rmse(:) ];
+inds = find(isfinite(bob));
-if ( isfinite(Yrange) )
- x = [min([Yrange(1) 0.0]) Yrange(2)];
+if ( isempty(inds) )
+ x = [0 1];
else
- x = [0 1];
-end
+ glommed = bob(inds);
+ ymin = min(glommed);
+ ymax = max(glommed);
+ if ( ymax > 1.0 )
+ ymin = floor(min(glommed));
+ ymax = ceil(max(glommed));
+ end
+ Yrange = [ymin ymax];
+ x = [min([Yrange(1) 0.0]) Yrange(2)];
+end
+
function Stripes(x,edges)
% EraseMode: [ {normal} | background | xor | none ]
More information about the Dart-dev
mailing list