[Dart-dev] DART/branches Revision: 12014

dart at ucar.edu dart at ucar.edu
Wed Oct 25 10:55:00 MDT 2017


thoar at ucar.edu
2017-10-25 10:54:58 -0600 (Wed, 25 Oct 2017)
355
Using the hgtransform method to plot the flat earth representation under scatterplots for georeferencing.
Renaming the helper function 'myworldmap' -> 'FlatEarth' and putting it in the private directory.
The add_gray_color() function adds a light gray color as the lowest entry in the colormap and changes
the clim to preserve the original data limits.
 



Modified: DART/branches/rma_trunk/diagnostics/matlab/plot_obs_netcdf.m
===================================================================
--- DART/branches/rma_trunk/diagnostics/matlab/plot_obs_netcdf.m	2017-10-24 15:55:08 UTC (rev 12013)
+++ DART/branches/rma_trunk/diagnostics/matlab/plot_obs_netcdf.m	2017-10-25 16:54:58 UTC (rev 12014)
@@ -169,6 +169,7 @@
 pstruct.region = region;
 pstruct.str1   = sprintf('%s',obsstruct.ObsTypeString);
 pstruct.str3   = sprintf('%s - %s',obsstruct.timestring(1,:),obsstruct.timestring(2,:));
+pstruct.Ztype  = obsstruct.Ztyp(1);
 
 subplot('position',positions(1,:))
 
@@ -188,7 +189,7 @@
    else
       pstruct.scalearray = 30.0 * ones(size(obsstruct.obs));
    end
-   pstruct.clim   = [min(obsstruct.obs) max(obsstruct.obs)];
+   pstruct.clim   = [min(obsstruct.obs)-0.5 max(obsstruct.obs)+0.5];
    pstruct.str2   = sprintf('%s (%d locations)',obsstruct.CopyString,length(obsstruct.obs));
 
    % If all the observations live on the same level ... make a 2D plot.
@@ -195,7 +196,7 @@
 
    if ( zmin == zmax )
 
-      pstruct.axis = [xmin xmax ymin ymax];
+      pstruct.axis = [xmin xmax ymin ymax zmin-0.5 zmax+0.5];
 
       plot_2D(obsstruct, pstruct);
 
@@ -256,7 +257,7 @@
          (length(flaggedobs.obs) + length(obsstruct.obs));
    pstruct.scalearray = 30 * ones(size(flaggedobs.obs));
    pstruct.colorbarstring = QCString;
-   pstruct.clim = [min(flaggedobs.qc) max(flaggedobs.qc)];
+   pstruct.clim = [min(flaggedobs.qc)-1.0 max(flaggedobs.qc)+1.0];
    pstruct.str1 = sprintf('%s level (%.2f - %.2f)',obsstruct.ObsTypeString,zmin,zmax);
    pstruct.str2 = sprintf('%s (%d ''good'', %d ''flagged'' -- %.2f %%)', obsstruct.CopyString, ...
                       length(obsstruct.obs), length(flaggedobs.obs), prej);
@@ -270,7 +271,7 @@
 
    else
 
-      pstruct.axis = [xmin xmax ymin ymax];
+      pstruct.axis = [xmin xmax ymin ymax zmin-0.5 zmin+0.5];
 
       plot_2D(flaggedobs, pstruct);
 
@@ -306,90 +307,6 @@
 
 
 
-function h = myworldmap
-
-%%--------------------------------------------------------------------------
-% GET THE ELEVATION DATA AND SET UP THE ASSOCIATED COORDINATE DATA
-%---------------------------------------------------------------------------
-
-load topo;               % GET Matlab-native [180x360] ELEVATION DATASET
-lats = -89.5:89.5;       % CREATE LAT ARRAY FOR TOPO MATRIX
-lons = 0.5:359.5;        % CREATE LON ARRAY FOR TOPO MATRIX
-nlon = length(lons);
-nlat = length(lats);
-
-%%--------------------------------------------------------------------------
-% IF WE NEED TO SWAP HEMISPHERES, DO SO NOW.
-% If we didn't explicitly tell it, make a guess.
-%---------------------------------------------------------------------------
-
-ax   = axis;
-
-if (ax(1) < -2)
-   lons = lons - 180.0;
-   topo = [ topo(:,nlon/2+1:nlon) topo(:,1:nlon/2) ];
-end
-
-%%--------------------------------------------------------------------------
-% We need to determine the geographic subset of the elevation matrix.
-%---------------------------------------------------------------------------
-
-lon_ind1 = find(ax(1) <= lons, 1);
-lon_ind2 = find(ax(2) <= lons, 1);
-lat_ind1 = find(ax(3) <= lats, 1);
-lat_ind2 = find(ax(4) <= lats, 1);
-
-if (isempty(lon_ind1)), lon_ind1 = 1;    end;
-if (isempty(lon_ind2)), lon_ind2 = nlon; end;
-if (isempty(lat_ind1)), lat_ind1 = 1;    end;
-if (isempty(lat_ind2)), lat_ind2 = nlat; end;
-
-elev = topo(lat_ind1:lat_ind2,lon_ind1:lon_ind2);
-x    = lons(lon_ind1:lon_ind2);
-y    = lats(lat_ind1:lat_ind2);
-
-%%--------------------------------------------------------------------------
-% Contour the "subset"
-% There are differences between 6.5 and 7.0 that make changing the colors
-% of the filled contours a real pain.
-%---------------------------------------------------------------------------
-
-orgholdstate = ishold;


More information about the Dart-dev mailing list