[Dart-dev] DART/branches Revision: 12015

dart at ucar.edu dart at ucar.edu
Wed Oct 25 12:46:34 MDT 2017


thoar at ucar.edu
2017-10-25 12:46:33 -0600 (Wed, 25 Oct 2017)
329
Removed some unused code.
Reintroduced the zlabel based on which_vert() integer.
Fixed problem with landmasses getting wrong color when
the data range spans zero ... Now the landmasses are always
the lowest color in the colorbar. add_gray_color constucts
a colorbar where the lowest color does not correspond to any data value.




Modified: DART/branches/rma_trunk/diagnostics/matlab/plot_obs_netcdf.m
===================================================================
--- DART/branches/rma_trunk/diagnostics/matlab/plot_obs_netcdf.m	2017-10-25 16:54:58 UTC (rev 12014)
+++ DART/branches/rma_trunk/diagnostics/matlab/plot_obs_netcdf.m	2017-10-25 18:46:33 UTC (rev 12015)
@@ -1,5 +1,5 @@
 function obsstruct = plot_obs_netcdf(fname, ObsTypeString, region, CopyString, ...
-                                     QCString, maxQC, verbose, twoup)
+    QCString, maxQC, verbose, twoup)
 %% plot_obs_netcdf will plot the locations and values of the observations in a DART netcdf file.
 %     any observations with a QC value greater than 'maxgoodQC' will get
 %     plotted on a separate figure ... color-coded to its QC value, not the
@@ -58,56 +58,56 @@
 % DART $Id$
 
 if (exist(fname,'file') ~= 2)
-   error('%s does not exist.',fname)
+    error('%s does not exist.',fname)
 end
 
 if ( twoup > 0 )
-   clf; orient tall
-   positions = [0.1, 0.55, 0.8, 0.35 ; ...
-                0.1, 0.10, 0.8, 0.35 ; ...
-                0.1, 0.02, 0.8, 0.08];
+    clf; orient tall
+    positions = [0.1, 0.55, 0.8, 0.35 ; ...
+        0.1, 0.10, 0.8, 0.35 ; ...
+        0.1, 0.02, 0.8, 0.08];
 else
-   clf; orient landscape
-   positions = [0.1, 0.20, 0.8, 0.65 ; ...
-                0.1, 0.20, 0.8, 0.65 ; ...
-                0.1, 0.05, 0.8, 0.10];
+    clf; orient landscape
+    positions = [0.1, 0.20, 0.8, 0.65 ; ...
+        0.1, 0.20, 0.8, 0.65 ; ...
+        0.1, 0.05, 0.8, 0.10];
 end
 
 %% Read the observation sequence
 
 obsstruct = read_obs_netcdf(fname, ObsTypeString, region, ...
-                    CopyString, QCString, verbose);
+    CopyString, QCString, verbose);
 
 % subset based on qc value
 
 if ( (~ isempty(obsstruct.qc)) && (~ isempty(maxQC)) )
 
-   inds = find(obsstruct.qc > maxQC);
-   obsstruct.numflagged = length(inds);
-   fprintf('%d obs have a %s value greater than %f (i.e. "bad")\n', ...
-                obsstruct.numflagged, QCString, maxQC)
-            
-   if (~isempty(inds))
-       flaggedobs.lons = obsstruct.lons(inds);
-       flaggedobs.lats = obsstruct.lats(inds);
-       flaggedobs.Ztyp = obsstruct.Ztyp(inds);
-       flaggedobs.z    = obsstruct.z(   inds);
-       flaggedobs.obs  = obsstruct.obs( inds);
-       flaggedobs.qc   = obsstruct.qc(  inds);
-   end
+    inds = find(obsstruct.qc > maxQC);
+    obsstruct.numflagged = length(inds);
+    fprintf('%d obs have a %s value greater than %f (i.e. "bad")\n', ...
+        obsstruct.numflagged, QCString, maxQC)
 
-   inds = find(obsstruct.qc <= maxQC);
-   obsstruct.numgood = length(inds);
-   fprintf('%d obs have a %s value less than or equal to %f (i.e. "good")\n', ...
-                obsstruct.numgood, QCString, maxQC)
+    if (~isempty(inds))
+        flaggedobs.lons = obsstruct.lons(inds);
+        flaggedobs.lats = obsstruct.lats(inds);
+        flaggedobs.Ztyp = obsstruct.Ztyp(inds);
+        flaggedobs.z    = obsstruct.z(   inds);
+        flaggedobs.obs  = obsstruct.obs( inds);
+        flaggedobs.qc   = obsstruct.qc(  inds);
+    end
 
-   bob = obsstruct.lons(inds); obsstruct.lons = bob;
-   bob = obsstruct.lats(inds); obsstruct.lats = bob;
-   bob = obsstruct.Ztyp(inds); obsstruct.Ztyp = bob;
-   bob = obsstruct.z(   inds); obsstruct.z    = bob;
-   bob = obsstruct.obs( inds); obsstruct.obs  = bob;
-   bob = obsstruct.qc(  inds); obsstruct.qc   = bob;
+    inds = find(obsstruct.qc <= maxQC);
+    obsstruct.numgood = length(inds);
+    fprintf('%d obs have a %s value less than or equal to %f (i.e. "good")\n', ...
+        obsstruct.numgood, QCString, maxQC)
 
+    bob = obsstruct.lons(inds); obsstruct.lons = bob;
+    bob = obsstruct.lats(inds); obsstruct.lats = bob;
+    bob = obsstruct.Ztyp(inds); obsstruct.Ztyp = bob;
+    bob = obsstruct.z(   inds); obsstruct.z    = bob;
+    bob = obsstruct.obs( inds); obsstruct.obs  = bob;
+    bob = obsstruct.qc(  inds); obsstruct.qc   = bob;
+
 end
 
 %% Separate out all the NaN values


More information about the Dart-dev mailing list