[Dart-dev] [4404] DART/trunk: Made some tweaks to the plot_obs_netcdf script to allow
nancy at ucar.edu
nancy at ucar.edu
Wed Jun 30 22:16:05 MDT 2010
Revision: 4404
Author: thoar
Date: 2010-06-30 22:16:05 -0600 (Wed, 30 Jun 2010)
Log Message:
-----------
Made some tweaks to the plot_obs_netcdf script to allow
continental transparency in a 2D view.
alphabetically sorted the path_names_obs_diag file
Added three example scripts to explore a series of
panels for the distribution and value of an observation.
Modified Paths:
--------------
DART/trunk/diagnostics/matlab/plot_obs_netcdf.m
DART/trunk/models/wrf/work/path_names_obs_diag
Added Paths:
-----------
DART/trunk/models/wrf/matlab/ObsPlot.m
DART/trunk/models/wrf/matlab/ObsTimeCheck.m
DART/trunk/models/wrf/matlab/ThreePanel.m
-------------- next part --------------
Modified: DART/trunk/diagnostics/matlab/plot_obs_netcdf.m
===================================================================
--- DART/trunk/diagnostics/matlab/plot_obs_netcdf.m 2010-06-30 22:48:15 UTC (rev 4403)
+++ DART/trunk/diagnostics/matlab/plot_obs_netcdf.m 2010-07-01 04:16:05 UTC (rev 4404)
@@ -33,7 +33,7 @@
%
% bob = plot_obs_netcdf(fname, ObsTypeString, region, CopyString, QCString, maxgoodQC, verbose, twoup);
-%% DART software - Copyright \xA9 2004 - 2010 UCAR. This open source software is
+%% DART software - Copyright � 2004 - 2010 UCAR. This open source software is
% provided by UCAR, "as is", without charge, subject to all terms of use at
% http://www.image.ucar.edu/DAReS/DART/DART_download
%
@@ -137,7 +137,7 @@
else
- pstruct.axis = [xmin xmax ymin ymax];
+ pstruct.axis = [xmin xmax ymin ymax ];
pstruct.str1 = sprintf('%s',obsstruct.ObsTypeString);
plot_2D(obsstruct, pstruct);
@@ -293,14 +293,19 @@
fcolor = [0.7 0.7 0.7]; % light grey
+myclim = get(gca,'CLim');
[c,h] = contourf(x,y,elev,[0.0 0.0],'k-');
+set(gca,'CLim',myclim)
h_patch = get(h, 'Children');
for i = 1:numel(h_patch)
y = get(h_patch(i), 'YData');
s = size(y);
- set(h_patch(i), 'ZData', zlevel*ones(s),'FaceColor',fcolor);
+ if ( exist('zlevel','var') )
+ set(h_patch(i), 'ZData', zlevel*ones(s));
+ end
+ set(h_patch(i),'FaceColor',fcolor);
set(h_patch(i),'AlphaDataMapping','none','FaceVertexAlphaData',0.3)
set(h_patch(i),'FaceAlpha',0.3)
end
@@ -373,7 +378,7 @@
function h1 = plot_2D(obsstruct, pstruct)
-axis(pstruct.axis); hold on; worldmap('light');
+axis(pstruct.axis);
if (pstruct.clim(1) == pstruct.clim(2))
cmap = colormap;
@@ -384,7 +389,7 @@
else
- scatter(obsstruct.lons, obsstruct.lats, ...
+ scatter3(obsstruct.lons, obsstruct.lats, zeros(size(obsstruct.obs)), ...
pstruct.scalearray, obsstruct.obs, 'd', 'filled');
end
@@ -395,7 +400,9 @@
xlabel('longitude')
ylabel('latitude')
+myworldmap;
set(gca,'CLim',clim)
-h = colorbar;
-set(get(h,'YLabel'),'String',pstruct.colorbarstring,'Interpreter','none')
-hold off
+hb = colorbar;
+set(get(hb,'YLabel'),'String',pstruct.colorbarstring,'Interpreter','none')
+view(0,90)
+
Added: DART/trunk/models/wrf/matlab/ObsPlot.m
===================================================================
--- DART/trunk/models/wrf/matlab/ObsPlot.m (rev 0)
+++ DART/trunk/models/wrf/matlab/ObsPlot.m 2010-07-01 04:16:05 UTC (rev 4404)
@@ -0,0 +1,120 @@
+%% ObsPlot - plots a series of variables - over a series of times.
+% The input files are netcdf files created by obs_seq_to_netcdf.
+% The list of observations types must be hand-edited to reflect
+% the observation types of interest.
+%
+% The intent is that you have a gigantic screen and can tile
+% a bunch of figure windows - one pertaining to each netcdf file.
+% If you do it right - you get a series of frames and can update
+% each frame one-at-a-time.
+%
+% As it is - this is set up to create 8 figures. If each figure
+% is 3 hours ... you get one day per view.
+%
+% This is not a function - the contents must be edited. The original is
+% under svn control, so you can always 'svn revert ObsPlot.m' and be good.
+
+%% DART software - Copyright © 2004 - 2010 UCAR. This open source software is
+% provided by UCAR, "as is", without charge, subject to all terms of use at
+% http://www.image.ucar.edu/DAReS/DART/DART_download
+%
+% <next few lines under version control, do not edit>
+% $URL$
+% $Id$
+% $Revision$
+% $Date$
+
+
+ObsTypes = {'RADIOSONDE_U_WIND_COMPONENT', ...
+ 'RADIOSONDE_V_WIND_COMPONENT', ...
+ 'RADIOSONDE_TEMPERATURE', ...
+ 'RADIOSONDE_SPECIFIC_HUMIDITY', ...
+ 'AIRCRAFT_U_WIND_COMPONENT', ...
+ 'AIRCRAFT_V_WIND_COMPONENT', ...
+ 'AIRCRAFT_TEMPERATURE', ...
+ 'ACARS_U_WIND_COMPONENT', ...
+ 'ACARS_V_WIND_COMPONENT', ...
+ 'ACARS_TEMPERATURE', ...
+ 'MARINE_SFC_U_WIND_COMPONENT', ...
+ 'MARINE_SFC_V_WIND_COMPONENT', ...
+ 'MARINE_SFC_TEMPERATURE', ...
+ 'MARINE_SFC_SPECIFIC_HUMIDITY', ...
+ 'SAT_U_WIND_COMPONENT', ...
+ 'SAT_V_WIND_COMPONENT', ...
+ 'RADIOSONDE_SURFACE_ALTIMETER', ...
+ 'MARINE_SFC_ALTIMETER', ...
+ 'LAND_SFC_ALTIMETER', ...
+ 'VORTEX_LAT', ...
+ 'VORTEX_LON', ...
+ 'VORTEX_PMIN', ...
+ 'VORTEX_WMAX', ...
+ 'SAT_U_WIND_COMPONENT', ...
+ 'SAT_V_WIND_COMPONENT'};
+
+fname = 'obs_epoch_003.nc';
+region = [0 360 -90 90 -Inf Inf];
+region = [80 175 -10 60 -Inf Inf];
+CopyString = 'NCEP BUFR observation';
+QCString = 'NCEP QC index';
+maxgoodQC = 99;
+verbose = 0;
+twoup = 0;
+
+for j = 1:length(ObsTypes)
+for i = 1:16 % or 168 ... or ...
+
+ fname = sprintf('obs_epoch_%03d.nc',i);
+
+ fignum = mod(i,8);
+ if fignum == 0, fignum = 8; end
+
+ figure(fignum)
+
+% bob = plot_obs_netcdf(fname, 'VORTEX_PMIN', region, ...
+ bob = plot_obs_netcdf(fname, ObsTypes{j}, region, ...
+ CopyString, QCString, maxgoodQC, verbose, twoup);
+
+ view(0,90)
+ fprintf('Pausing on %s, hit any key to continue ...',fname)
+ pause
+
+end
+end
+
+
+% ObsTypeString = 'ALL';
+% for i = 1:length(ObsTypes)
+% fprintf('Observation Type %s\n', ObsTypes{i})
+% bob = plot_obs_netcdf(fname, ObsTypes{i}, region, ...
+% CopyString, QCString, maxgoodQC, verbose, twoup);
+% view(0,90)
+% disp('Pausing, hit any key to continue ...')
+% pause
+% end
+
+
+% 1 'RADIOSONDE_U_WIND_COMPONENT'
+% 2 'RADIOSONDE_V_WIND_COMPONENT'
+% 3 'RADIOSONDE_TEMPERATURE'
+% 4 'RADIOSONDE_SPECIFIC_HUMIDITY'
+% 5 'AIRCRAFT_U_WIND_COMPONENT'
+% 6 'AIRCRAFT_V_WIND_COMPONENT'
+% 7 'AIRCRAFT_TEMPERATURE'
+% 8 'ACARS_U_WIND_COMPONENT'
+% 9 'ACARS_V_WIND_COMPONENT'
+% 10 'ACARS_TEMPERATURE'
+% 11 'MARINE_SFC_U_WIND_COMPONENT'
+% 12 'MARINE_SFC_V_WIND_COMPONENT'
+% 13 'MARINE_SFC_TEMPERATURE'
+% 14 'MARINE_SFC_SPECIFIC_HUMIDITY'
+% 15 'SAT_U_WIND_COMPONENT'
+% 16 'SAT_V_WIND_COMPONENT'
+% 17 'RADIOSONDE_SURFACE_ALTIMETER'
+% 18 'MARINE_SFC_ALTIMETER'
+% 19 'LAND_SFC_ALTIMETER'
+% 20 'VORTEX_LAT'
+% 21 'VORTEX_LON'
+% 22 'VORTEX_PMIN'
+% 23 'VORTEX_WMAX'
+% 24 'SAT_U_WIND_COMPONENT'
+% 25 'SAT_V_WIND_COMPONENT'
Property changes on: DART/trunk/models/wrf/matlab/ObsPlot.m
___________________________________________________________________
Added: svn:mime-type
+ text/x-matlab
Added: svn:keywords
+ Date Rev Author HeadURL Id
Added: svn:eol-style
+ native
Added: DART/trunk/models/wrf/matlab/ObsTimeCheck.m
===================================================================
--- DART/trunk/models/wrf/matlab/ObsTimeCheck.m (rev 0)
+++ DART/trunk/models/wrf/matlab/ObsTimeCheck.m 2010-07-01 04:16:05 UTC (rev 4404)
@@ -0,0 +1,40 @@
+%% ObsTimeCheck - This is a function to explore the spatio-temporal distribution
+% of the observations in a netCDF file created by obs_seq_to_netcdf.
+
+%% DART software - Copyright © 2004 - 2010 UCAR. This open source software is
+% provided by UCAR, "as is", without charge, subject to all terms of use at
+% http://www.image.ucar.edu/DAReS/DART/DART_download
+%
+% <next few lines under version control, do not edit>
+% $URL$
+% $Id$
+% $Revision$
+% $Date$
+
+region = [80 175 -10 60 -Inf Inf];
+CopyString = 'NCEP BUFR observation';
+QCString = 'NCEP QC index';
+maxgoodQC = 99;
+verbose = 1;
+twoup = 0;
+
+clf;
+orient landscape
+
+for i = 1:168
+
+ fname = sprintf('obs_epoch_%03d.nc',i);
+
+ fignum = mod(i,8);
+ if fignum == 0, fignum = 8; end
+
+ figure(fignum)
+
+ bob = plot_obs_netcdf(fname, 'MARINE_SFC_TEMPERATURE', region, ...
+ CopyString, QCString, maxgoodQC, verbose, twoup);
+
+ view(0,90)
+ disp('Pausing, hit any key to continue ...')
+ pause
+
+end
Property changes on: DART/trunk/models/wrf/matlab/ObsTimeCheck.m
___________________________________________________________________
Added: svn:mime-type
+ text/x-matlab
Added: svn:keywords
+ Date Rev Author HeadURL Id
Added: svn:eol-style
+ native
Added: DART/trunk/models/wrf/matlab/ThreePanel.m
===================================================================
--- DART/trunk/models/wrf/matlab/ThreePanel.m (rev 0)
+++ DART/trunk/models/wrf/matlab/ThreePanel.m 2010-07-01 04:16:05 UTC (rev 4404)
@@ -0,0 +1,143 @@
+%% ThreePanel - plots three graphics on one figure - uses Hui's data files.
+
+%% DART software - Copyright © 2004 - 2010 UCAR. This open source software is
+% provided by UCAR, "as is", without charge, subject to all terms of use at
+% http://www.image.ucar.edu/DAReS/DART/DART_download
+%
+% <next few lines under version control, do not edit>
+% $URL$
+% $Id$
+% $Revision$
+% $Date$
+
+clf; orient landscape; wysiwyg
+clear all;
+
+posmat = [0.250 0.5 0.500 0.5;
+ 0.075 0.1 0.400 0.4;
+ 0.525 0.1 0.400 0.4];
+fontsize = 16;
+
+subplot('position', posmat(1,:),'FontSize',fontsize)
+fname = 'wrfinput_d01';
+
+xlat = nc_varget(fname,'XLAT');
+xlon = nc_varget(fname,'XLONG');
+truelat1 = nc_attget(fname, nc_global, 'TRUELAT1');
+truelat2 = nc_attget(fname, nc_global, 'TRUELAT2');
+cen_lat = nc_attget(fname, nc_global, 'CEN_LAT');
+stand_lon = nc_attget(fname, nc_global, 'STAND_LON');
+
+minlon = min(xlon(:)); maxlon = max(xlon(:));
+minlat = min(xlat(:)); maxlat = max(xlat(:));
+
+ax = axesm('lambert','Origin',[0 stand_lon 0], ...
+ 'MapParallels',[truelat1 truelat2], ...
+ 'MapLatLimit',[minlat maxlat], ...
+ 'MapLonLimit',[minlon maxlon] );
+
+% this sets the limits for the entire projected domain
+% [xlim ylim] = mfwdtran([xlat(1,1) xlat(end,end)],[xlon(1,1) xlon(end,end)]);
+% set(gca,'xlim',xlim);
+% set(gca,'ylim',ylim);
+
+% This restricts the view to a subset of the domain
+%set(gca,'xlim',[-0.1162 0.3084]);
+%set(gca,'ylim',[ 0.1385 0.4089]);
+
+% mlabel(16);
+% plabel(-70);
+% mlabel('on')
+
+load ernesto2418.txt;
+load ctl25.txt;
+load gps25.txt;
+
+lat_obs = ernesto2418(:, 3);
+lon_obs = ernesto2418(:, 4);
+
+lat_ctl = ctl25(:, 5);
+lon_ctl = ctl25(:, 6);
+
+lat_gps = gps25(:, 5);
+lon_gps = gps25(:, 6);
+
+plotm( lat_obs,lon_obs,'rx--', 'markersize', 8.0, 'LineWidth', 2.0);
+plotm( lat_ctl,lon_ctl,'bx--', 'markersize', 8.0, 'LineWidth', 2.0);
+plotm( lat_gps,lon_gps,'gv--', 'markersize', 8.0, 'LineWidth', 2.0);
+legend('OBS', 'CTL', 'GPS'); legend boxoff
+
+%coloring continent, slow
+%geoshow(ax, xlat, xlon, 'DisplayType', 'texturemap', 'FaceColor', [1. 1. 1.])
+bbox = zeros(2,2);
+bbox(:) = [minlon minlat; maxlon maxlat];
+landareas = shaperead('landareas', 'UseGeoCoords', true, ...
+ 'BoundingBox', bbox);
+h = geoshow([landareas.Lat],[landareas.Lon],'Color','black');
+% geoshow('landareas.shp', 'FaceColor', 'black');
+
+%plotm( lat_non,lon_non,'g.--', 'markersize', 8.0);
+
+%----------------------------------------------------------------------
+% Track Error axis
+%----------------------------------------------------------------------
+
+subplot('position', posmat(2,:),'FontSize',fontsize)
+
+lat_obs = ernesto2418(:, 3)*3.1415/180.0;
+lon_obs = ernesto2418(:, 4)*3.1415/180.0;
+int_obs = ernesto2418(:, 5);
+
+lat_ctl = ctl25(:, 5)*3.1415/180.0;
+lon_ctl = ctl25(:, 6)*3.1415/180.0;
+int_ctl = ctl25(:, 7);
+
+lat_gps = gps25(:, 5)*3.1415/180.0;
+lon_gps = gps25(:, 6)*3.1415/180.0;
+int_gps = gps25(:, 7);
+
+%--------
+lon_dist = lon_ctl - lon_obs;
+for i= 1: size(lon_ctl);
+ctl_dist(i) = acos(sin(lat_ctl(i)) * sin(lat_obs(i)) + cos(lat_ctl(i)) * cos(lat_obs(i)) * cos(lon_dist(i)))*6400.0;
+end
+
+lon_dist = lon_gps - lon_obs;
+for i= 1: size(lon_ctl);
+gps(i) = acos(sin(lat_gps(i)) * sin(lat_obs(i)) + cos(lat_gps(i)) * cos(lat_obs(i)) * cos(lon_dist(i)))*6400.0;
+end
+
+dd = ernesto2418(:,2)/2400.0 + ernesto2418(:,1);
+
+plot( dd, ctl_dist,'bx--', dd, gps,'gv--', 'LineWidth', 2.0)
+axis([25 28 0 150])
+grid
+xlabel('Day of August 2006)');
+ylabel('Track error (km)');
+
+legend('CTRL', 'GPS', 'Location', 'NorthWest'); legend boxoff
+
+
+
+%----------------------------------------------------------------------
+% Track Error axis
+%----------------------------------------------------------------------
+
+dd = ernesto2418(:,2)/2400.0 + ernesto2418(:,1);
+
+subplot('position', posmat(3,:),'FontSize',fontsize)
+
+plot( dd, int_obs,'rx-', dd, int_ctl,'bx--', dd, int_gps,'gv--', ...
+ 'LineWidth', 2.0);
+% change here
+axis([25 28 990 1010])
+set(gca,'YAxisLocation','right')
+grid
+xlabel('Day of August 2006');
+ylabel('Surface Pressure Minimum (hPa)');
+%legend('OBS', 'CTRL', 'GPS', 'Location', 'East')
+legend('OBS', 'CTL', 'GPS','Location','SouthWest'); legend boxoff
+
+
+print -dpng track25.png
+
Property changes on: DART/trunk/models/wrf/matlab/ThreePanel.m
___________________________________________________________________
Added: svn:mime-type
+ text/x-matlab
Added: svn:keywords
+ Date Rev Author HeadURL Id
Added: svn:eol-style
+ native
Modified: DART/trunk/models/wrf/work/path_names_obs_diag
===================================================================
--- DART/trunk/models/wrf/work/path_names_obs_diag 2010-06-30 22:48:15 UTC (rev 4403)
+++ DART/trunk/models/wrf/work/path_names_obs_diag 2010-07-01 04:16:05 UTC (rev 4404)
@@ -1,15 +1,15 @@
+assim_model/assim_model_mod.f90
+common/types_mod.f90
diagnostics/threed_sphere/obs_diag.f90
-sort/sort_mod.f90
-obs_sequence/obs_sequence_mod.f90
-obs_kind/obs_kind_mod.f90
-obs_def/obs_def_mod.f90
-assim_model/assim_model_mod.f90
+location/threed_sphere/location_mod.f90
models/wrf/model_mod.f90
models/wrf/module_map_utils.f90
+mpi_utilities/null_mpi_utilities_mod.f90
+obs_def/obs_def_mod.f90
+obs_kind/obs_kind_mod.f90
+obs_sequence/obs_sequence_mod.f90
+random_nr/random_nr_mod.f90
random_seq/random_seq_mod.f90
-random_nr/random_nr_mod.f90
-location/threed_sphere/location_mod.f90
-common/types_mod.f90
+sort/sort_mod.f90
time_manager/time_manager_mod.f90
utilities/utilities_mod.f90
-mpi_utilities/null_mpi_utilities_mod.f90
More information about the Dart-dev
mailing list