Back to home page

MITgcm

 
 

    


Warning, /utils/matlab/cs_grid/read_cs/crossmap.m is written in an unsupported language. File is not indexed.

view on githubraw file Latest commit bbb0f377 on 2013-03-12 16:32:37 UTC
bbb0f3777d Dimi*0001 function crossmap(TS,cx,label)
6da4c7104b Dimi*0002 
                0003 % Function crossmap(fld,cx)
                0004 % plot a cube sphere field as a cross
                0005 %
                0006 % INPUTS
                0007 % fld   input cube sphere field (n,6,n) where n is the face dimension
                0008 % cx    two element vector [cmin cmax] sets scaling for caxis
bbb0f3777d Dimi*0009 % label colorbar label
6da4c7104b Dimi*0010 
                0011 if nargin<2
                0012 cx=[min(TS(:)) max(TS(:))];
bbb0f3777d Dimi*0013 end
                0014 
                0015 if nargin<3
                0016 label='';
6da4c7104b Dimi*0017 end
                0018 
                0019 a1=squeeze(TS(:,1,:));
                0020 a2=squeeze(TS(:,2,:));
                0021 a3=squeeze(TS(:,3,:));
                0022 a4=squeeze(TS(:,4,:));
                0023 a5=squeeze(TS(:,5,:));
                0024 a6=squeeze(TS(:,6,:));
                0025 
                0026 tmp=cat(1,a2,rot90(a4,-1),rot90(a5,-1),a1);
                0027 
                0028 subplot('position',[.05 .35 .9 .3])
                0029 h1=pcolor(tmp');shading flat
bbb0f3777d Dimi*0030 set(gca,'visible','off')
6da4c7104b Dimi*0031 pos=get(gca,'position');
                0032 
                0033 ax3=axes('position',[pos(1)+pos(3)/4*2 pos(2)+pos(4) pos(3)/4 pos(4)]);
                0034 h31=pcolor(rot90(a3',2));shading flat
bbb0f3777d Dimi*0035 set(gca,'visible','off')
f25702b122 Dimi*0036 
6da4c7104b Dimi*0037 ax6=axes('position',[pos(1)+pos(3)/4*2 pos(2)-pos(4) pos(3)/4 pos(4)]);
                0038 h61=pcolor(rot90(a6'));shading flat
bbb0f3777d Dimi*0039 set(gca,'visible','off')
6da4c7104b Dimi*0040 
                0041 axx=findobj(gcf,'type','axes');
                0042 set(axx,'clim',cx)
                0043 
                0044 %old versions
                0045 %ax=colorbar('position',[pos(1)+pos(3)/4/2/2 pos(2)+pos(4)*1.5 pos(3)/4*1.5 pos(4)/5]);
                0046 %colorbar(ax)
                0047 
                0048 %new for R2009
                0049 ax=colorbar('location','southoutside');
                0050 set(ax,'position',[pos(1)+pos(3)/4/2/2 pos(2)+pos(4)*1.5 pos(3)/4*1.5 pos(4)/5]);
bbb0f3777d Dimi*0051 set(get(ax,'xlabel'),'string',label)