function fig=viewadcp(jdaytime,east,north)

% View adcp data, similar to RDI's WinADCP software
global xhand adcp;

colordepth=100;
[m,n]=size(east);
spd=sqrt(east.*east + north.*north);
spd(spd>1e5)=nan;
adcp.spd=spd;
direc=atan2(east, north)*180/pi;
indx=find(direc<0);
direc(indx)=360+direc(indx);
adcp.dir=direc;
adcp.time=jdaytime;

xhand.adcp=figure('Integerhandle','off',...
	'Interruptible','off',...
	'NumberTitle','off', ...
	'name','ADCP VIEW',...
	'unit','norm',...
	'colormap',jet(colordepth),...
	'Tag','fig-adcpview');
xhand.spdprofile=axes('parent',xhand.adcp,...
	'position',[1/32 19/32 6/32 12/32],...
	'xgrid','on');
xhand.dirprofile=axes('parent',xhand.adcp,...
	'position',[1/32 5/32 6/32 12/32],...
	'xgrid','on');
xhand.spdimage=axes('parent',xhand.adcp,...
	'position',[9/32 19/32 22/32 12/32],...
	'xticklabel','');
xhand.dirimage=axes('parent',xhand.adcp,...
	'position',[9/32 5/32 22/32 12/32]);
xhand.ensambleslide = uicontrol('Parent',xhand.adcp,...
	'units','norm',...
	'Position',[9/32 1/32 22/32 3/32], ...
	'Style','slider',...
	'callback','viewingadcp(1)');
xhand.tstamp=uicontrol('parent',xhand.adcp,...
	'units','norm',...
	'position',[1/32 0 6/32 3/32],...
	'style','text',...
	'HorizontalAlignment','left', ...
	'fontsize',10,...
	'backgroundcolor','white',...
	'foregroundcolor',[.5 0 0]);	

viewingadcp(1);
