function plotem(lat, xyt, d, zc, uv, ts )

% plotem(lat, xyt, d, zc, uv )
%
% make a nice plot of shipboard ADCP data.
% lat = vector of latitudes or longitudes for regriding and plotting
% xyt = position time vector from adcpsect 
% d   = direction index (1=longitude, 2=latitude)
% zc  = depths for contouring
% uv  = velocity data from adcpsect
% ts  = title will be ['Zonal Velocity'|'Meridional Velocity' ts]

u = regrid(uv(:,1:2:end),xyt(d,:),zc,lat,zc,1,3)*100;
v = regrid(uv(:,2:2:end),xyt(d,:),zc,lat,zc,1,3)*100;

set(0,'defaulttextfontsize',14)
set(0,'defaultaxesfontsize',14)
set(0,'defaulttextfontweight','bold')
set(0,'defaultaxesfontweight','bold')
figure
set(gcf,'menubar','none')
set(gcf,'color',[1 1 1])
set(gcf,'posit',[   296    13   727   827])

levs = -100:10:100;

subplot(211)
[c,h] = contourf(lat,zc,u,levs);
a1 = gca;
dcolbar(levs)
%a2 = max(get(gcf,'children'));
%axes(a2)
%ylabel('Velocity (cm s^{-1})')
axes(a1)
caxis([levs(1) levs(end-1)])
if d==1,
 xlabel('longitude')
else
 xlabel('latitude')
end
adddeg(gca,'x');
set(gca,'ydir','reverse') 
ylabel('depth (m)')
title(sprintf('Zonal Velocity%s',ts))
axes(min(get(gcf,'children')))
if min(min(u))>levs(1),
 c = min(min(u));
 a = findobj('cdata',c);
 b = levs( max( find(levs<c) ));
 set(a,'cdata',b)
end
hold on
[c,h] = contour(lat,zc,u,[-200:10:-110 110:10:200],'k');
[c,h] = contour(lat,zc,u,-200:50:200,'k');
set(h,'linewidth',2)

subplot(212)
[c,h] = contourf(lat,zc,v,levs);
dcolbar(levs)
caxis([levs(1) levs(end-1)])
if d==1,
 xlabel('longitude')
else
 xlabel('latitude')
end
adddeg(gca,'x');
set(gca,'ydir','reverse') 
ylabel('depth (m)')
title(sprintf('Meridional Velocity%s',ts))
if min(min(u))>levs(1),
 c = min(min(u));
 a = findobj('cdata',c);
 b = levs( max( find(levs<c) ));
 set(a,'cdata',b)
end
hold on
[c,h] = contour(lat,zc,v,[-200:10:-110 110:10:200],'k');
[c,h] = contour(lat,zc,v,-200:50:200,'k');
set(h,'linewidth',2)
a2 = max(get(gcf,'children'));
axes(a2)
ylabel('Velocity (cm s^{-1})')

set(0,'defaulttextfontsize',10)
set(0,'defaultaxesfontsize',10)

axes
set(gca,'posit',[0.05 0.03 .9 .08])
set(gca,'visible','off')
text(0,0,'Data collected aboard NOAA Ship Ka`imimoana and processed at the University of Hawaii.')

set(0,'defaulttextfontweight','normal')
set(0,'defaultaxesfontweight','normal')

