clear


adcpid = '30'; % sw29adcp.mat, sw30adcp.mat, sw32adcp.mat, sw33adcp.mat


irun = 12;


% ---- load HOPS data at adcpid location ---

dir = ['/home/logutov/awacs/'];
subdir  = ['PJH', num2str(irun),'/'];

dirhops = [dir, subdir];
hops_mods_file = [dirhops, 'hops_at_awacs_adcps_PJH',num2str(irun)];
load(hops_mods_file)

command = ['hops.time =  hops.adcp', adcpid, '.time;'];
eval(command)

command = ['hops.lon =  hops.adcp', adcpid, '.lon;'];
eval(command)

command = ['hops.lat =  hops.adcp', adcpid, '.lat;'];
eval(command)

command = ['hops.z =  hops.adcp', adcpid, '.z;'];
eval(command)

command = ['hops.u =  hops.adcp', adcpid, '.u;'];
eval(command)

command = ['hops.v =  hops.adcp', adcpid, '.v;'];
eval(command)



	 
% --- select var to plot

depthid = 1; % 1 - deep layer, 2 - upper layer


deplev=[1, 16]; % adcp data are bad above level 16
kobs = deplev(depthid);

hops.z_med = median(hops.z,1);
hops.time_med = median(hops.time,2);



var = 'v';

	 
  switch var,
		
   case 'u',
    uvmax = 40.;
    uvmin = -40;
    
    datamodel = hops.u';
    zmodel = -hops.z_med;
    
    case 'v',
     uvmax = 40.;
     uvmin = -40;
  
     datamodel = hops.v';
     zmodel = -hops.z_med;
     
   otherwise
    error('requested to plot an unknown var ...')
  end;
	 
	 
% ---------  plot data  ------------

disp('plotting ...')


figure(3)
clf
grid on
hold on

pcolor_oleg(hops.time_med,zmodel,datamodel);

datetick('x',6,'keepticks','keeplimits')

ylabel([var, ' [cm/s]'],'FontSize',15)

caxis([uvmin uvmax])
colorbar
