Home > utilities > do_surface_plotVel.m

do_surface_plotVel

PURPOSE ^

reads image and plots tracks or stations

SYNOPSIS ^

function [Plots]=do_surface_plotVel(plotOPTS,FVCOM)

DESCRIPTION ^

 reads image and plots tracks or stations

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [Plots]=do_surface_plotVel(plotOPTS,FVCOM)
0002 % reads image and plots tracks or stations
0003 m_mappath;
0004 
0005 figure(plotOPTS.figure)
0006 % set(gcf,'units','normalized','outerposition',[0 0 0.5 0.5])
0007 clf
0008 m_proj('UTM','lon',[plotOPTS.range_lon],'lat',[plotOPTS.range_lat],'zon',plotOPTS.zone,'ell','grs80')
0009 m_grid('box','fancy')
0010 set(gca,'FontSize',18)
0011 
0012 m_usercoast(plotOPTS.coastline_file,'Color','k','LineWidth',3);
0013 [X,Y]=m_ll2xy(plotOPTS.mesh.lon,plotOPTS.mesh.lat,'clip','on');
0014 
0015 
0016 if isfield(plotOPTS,'Time_record') & isfield(FVCOM,'mattime')
0017     if length(plotOPTS.Time_record)==1
0018         [dump,igoodT] = min(abs(plotOPTS.Time_record(1)-FVCOM.mattime));
0019     else
0020         
0021         igoodT = find( plotOPTS.Time_record(1) <= FVCOM.mattime &   FVCOM.mattime <=  plotOPTS.Time_record(end) );
0022     end
0023 else
0024     igoodT=(1:length(FVCOM.(plotOPTS.var_plot)));
0025 end
0026 
0027 
0028 for aa=igoodT
0029     % plot map with plotOPTS.var_plot
0030     hold on
0031     try
0032         % 3D data (i.e. DYE, pH etc.)
0033         Plots(1).handles=patch('Vertices',[X,Y],'Faces',plotOPTS.mesh.tri,...
0034             'FaceVertexCdata',squeeze(FVCOM.(plotOPTS.var_plot)(:,plotOPTS.nz_plot,aa)),...
0035             'CDataMapping','scaled','edgecolor','none','FaceColor','flat');
0036 %          Plots(1).handles=scatter(plotOPTS.mesh.xc,plotOPTS.mesh.yc,20,squeeze(FVCOM.(plotOPTS.var_plot)(:,plotOPTS.nz_plot,aa)),'filled')
0037     catch
0038         % 2D data only (i.e. zeta etc.)
0039         Plots(1).handles=patch('Vertices',[X,Y],'Faces',plotOPTS.mesh.tri,...
0040             'FaceVertexCdata',squeeze(FVCOM.(plotOPTS.var_plot)(:,aa)),...
0041             'CDataMapping','scaled','edgecolor','none','FaceColor','flat');
0042 %          Plots(1).handles=scatter(plotOPTS.mesh.xc,plotOPTS.mesh.yc,20,squeeze(FVCOM.(plotOPTS.var_plot)(:,aa)),'filled')
0043     end
0044     fprintf('Time step %i of %i\n',aa,length(plotOPTS.Time_record))
0045     display(['Time ',datestr(FVCOM.mattime(aa))])
0046     caxis(plotOPTS.clims)
0047     colorbar
0048     set(get(colorbar,'YLabel'),'String',plotOPTS.var_plot,'FontSize',14)
0049     % check if mesh elements are required
0050     if plotOPTS.do_mesh
0051         % plot vertices
0052         [X,Y]=m_ll2xy(plotOPTS.mesh.lon,plotOPTS.mesh.lat,'clip','on');
0053         patch('Vertices',[X,Y],'Faces',plotOPTS.mesh.tri,...
0054             'EdgeColor',[0.6 0.6 0.6],'FaceColor','none'); hold on
0055     end
0056     %----------------------------------------------------------------------
0057     % Only in my case it needs adding 6 because proj automatically
0058     % determines a reference long in strides of 6deg while m_map doesn't
0059     %----------------------------------------------------------------------
0060    m_usercoast(plotOPTS.coastline_file,'patch',[0.6, 0.6, 0.6]);
0061    pause(plotOPTS.pause)
0062 %     if aa~=length(plotOPTS.Time_record)
0063 %         delete(Plots(1).handles)
0064 %     end
0065 end
0066 
0067 return
0068

Generated on Wed 10-Aug-2016 16:44:39 by m2html © 2005