[Dart-dev] [4611] DART/trunk/models/cam/matlab/PeterFigures.m: The hemispheres are swapped (the dateline is repeated),

nancy at ucar.edu nancy at ucar.edu
Fri Dec 17 14:00:19 MST 2010


Revision: 4611
Author:   thoar
Date:     2010-12-17 14:00:19 -0700 (Fri, 17 Dec 2010)
Log Message:
-----------
The hemispheres are swapped (the dateline is repeated),
the ticks and labels match the other figures in the paper,
the aspect ratio is similar (if not identical) to the others figures,
the fonts were increased. Finally, they are all preserved as EPS files,
all as Peter requested. Save any highlighting box, these are done.

Modified Paths:
--------------
    DART/trunk/models/cam/matlab/PeterFigures.m

-------------- next part --------------
Modified: DART/trunk/models/cam/matlab/PeterFigures.m
===================================================================
--- DART/trunk/models/cam/matlab/PeterFigures.m	2010-12-17 00:26:31 UTC (rev 4610)
+++ DART/trunk/models/cam/matlab/PeterFigures.m	2010-12-17 21:00:19 UTC (rev 4611)
@@ -38,7 +38,8 @@
 
 %% Get all the data so we can determine consistent limits
 % TJH - all the other figures in the paper are [-180,180], which
-% is not what we have. Should swap halves to be consistent
+% is not what we have. Should swap halves to be consistent,
+% and repeat the wrap longitude so we can label [-180,180]
 
 % Undamped ... the noisy one.
 
@@ -47,8 +48,10 @@
 undamped.lat   = nc_varget(undamped.fname,'lat');
 undamped.lev   = nc_varget(undamped.fname,'lev');
 undamped.time  = nc_varget(undamped.fname,'time');
-undamped.VS    = nc_varget(undamped.fname,'VS');
+myVS           = nc_varget(undamped.fname,'VS');
+undamped.VS    = [myVS(:,73:144)  myVS(:,1:73)]; % swap the hemispheres, repeat Greenwich
 
+
 % damped ... 
 
 damped.fname = '/gpfs/ptmp/raeder/Single_CAM/Halo-diff_12-5-2000/caminput_VS_266.nc';
@@ -56,7 +59,8 @@
 damped.lat   = nc_varget(damped.fname,'lat');
 damped.lev   = nc_varget(damped.fname,'lev');
 damped.time  = nc_varget(damped.fname,'time');
-damped.VS    = nc_varget(damped.fname,'VS');
+myVS         = nc_varget(damped.fname,'VS');
+damped.VS    = [myVS(:,73:144)  myVS(:,1:73)]; % swap the hemispheres
 
 % difference ... 
 
@@ -65,44 +69,86 @@
 diffed.lat   = nc_varget(diffed.fname,'lat');
 diffed.lev   = nc_varget(diffed.fname,'lev');
 diffed.time  = nc_varget(diffed.fname,'time');
-diffed.VS    = nc_varget(diffed.fname,'VS');
+myVS         = nc_varget(diffed.fname,'VS');
+diffed.VS    = [myVS(:,73:144)  myVS(:,1:73)]; % swap the hemispheres
 
 %% Make some plots
+% To be comparable with the other figures in the article, the hemispheres 
+% need to be [-180,180], the major ticks and labels are every 30 degrees.
+% no titles.
+% bigger fonts
+% Peter wanted .eps or .ps - good - can use 'painters'
 
 datmat = [undamped.VS(:); damped.VS(:)];
 datmin = min(datmat);
 datmax = max(datmat);
 clim = [datmin datmax];
 
-figure(1); clf; orient landscape; colormap(bob)
-imagesc(undamped.lon, undamped.lat, undamped.VS, clim)
-set(gca,'YDir','normal','TickDir','out','XMinorTick','on')
-title('Meridional wind with gridpoint-scale noise')
-worldmap;
-colorbar('vert')
+% to reflect the swap
+dlon = mean(diff(undamped.lon));
+slon = [undamped.lon(73)-180:dlon: undamped.lon(144)+2*dlon] - 180;
+slon = [-180 180];
 
-figure(2); clf; orient landscape; colormap(bob)
-imagesc(damped.lon, damped.lat, damped.VS, clim)
-set(gca,'YDir','normal','TickDir','out','XMinorTick','on')
-title('Meridional wind with del^4 damping')
-worldmap;
-colorbar('vert')
+% define matching labels
 
-figure(3); clf; orient landscape; colormap(bob)
-imagesc(diffed.lon, diffed.lat, diffed.VS)
-set(gca,'YDir','normal','TickDir','out','XMinorTick','on')
-title('difference')
-worldmap;
-colorbar('vert')
+xticks = [-180:30:180];
+yticks = [ -90:30:90 ];
 
-print(1,'-dpng','VS_undamped')
-print(2,'-dpng','VS_damped')
-print(3,'-dpng','undamped-damped')
+xticklabels = ['180 ';'150W';'120W';'90W ';'60W ';'30W ';'  0 ';...
+               '30E ';'60E ';'90E ';'120E';'150E';'180 '];
+yticklabels = ['90S';'60S';'30S';' 0 ';'30N';'60N';'90N'];
 
-print(1,'-dpsc','VS_undamped')
-print(2,'-dpsc','VS_damped')
-print(3,'-dpsc','undamped-damped')
+figure(1); clf; orient landscape; colormap(bob); set(gcf,'renderer','painters')
+imagesc(slon, undamped.lat, undamped.VS, clim)
+set(gca,'YDir','normal','TickDir','out','XMinorTick','on','FontSize',14)
+set(gca,'XTick',xticks,'XTickLabel',xticklabels)
+set(gca,'YTick',yticks,'YTickLabel',yticklabels)
+% title('Meridional wind with gridpoint-scale noise')
+worldmap('hollow','dateline');
+axis image
+h = colorbar('vert');
+set(h,'FontSize',14)
+set(get(h,'YLabel'),'String','m/s','FontSize',14);
 
+figure(2); clf; orient landscape; colormap(bob); set(gcf,'renderer','painters')
+imagesc(slon, damped.lat, damped.VS, clim)
+set(gca,'YDir','normal','TickDir','out','XMinorTick','on','FontSize',14)
+set(gca,'XTick',xticks,'XTickLabel',xticklabels)
+set(gca,'YTick',yticks,'YTickLabel',yticklabels)
+% title('Meridional wind with del^4 damping')
+worldmap('hollow','dateline');
+axis image
+h = colorbar('vert');
+set(h,'FontSize',14)
+set(get(h,'YLabel'),'String','m/s','FontSize',14);
+
+figure(3); clf; orient landscape; colormap(bob); set(gcf,'renderer','painters')
+imagesc(slon, diffed.lat, diffed.VS)
+set(gca,'YDir','normal','TickDir','out','XMinorTick','on','FontSize',14)
+set(gca,'XTick',xticks,'XTickLabel',xticklabels)
+set(gca,'YTick',yticks,'YTickLabel',yticklabels)
+% title('difference')
+worldmap('hollow','dateline');
+axis image
+h = colorbar('vert');
+set(h,'FontSize',14)
+set(get(h,'YLabel'),'String','m/s','FontSize',14);
+
+% print the graphics
+
+print(1,'-depsc','VS_undamped')
+print(2,'-depsc','VS_damped')
+print(3,'-depsc','undamped-damped')
+
+% For whatever reason, the 'painters' renderer is just miserable with
+% pdf files - but great with postscript. Both OpenGL and zbuffer seem
+% to generate decent pdf files - the default font size is a bit fuzzy,
+% so I'm not sure these aren't being rasterized.
+
+set(1,'renderer','OpenGL'); print(1,'-dpdf','VS_undamped');
+set(2,'renderer','OpenGL'); print(2,'-dpdf','VS_damped');
+set(3,'renderer','OpenGL'); print(3,'-dpdf','undamped-damped');
+
 % Turns out - index 113 (of 256) is precisely zero on the difference plot.
 % figure(3)
 % bob = gauss3; bob(113,:) = 1; colormap(bob)


More information about the Dart-dev mailing list