%% Bin underway

procit=0;

if procit
uw = [823:1:827];

for N=1:length(uw);
   infile = [int2str(uw(N)) '00']; eval(['load ' infile]);
   lat=X.lat; lon=X.lon; t=X.data(:,30); s=X.data(:,33); f=X.data(:,31);
   time=X.time;
   %% Rebin to 10 second averages
   mintime-min(time); maxtime=max(time);
   rtime=[mintime:10:maxtime];
   for a=1:length(rtime)-1
      idx=find(time>=rtime(a)& time<rtime(a+1));
      clat=mean(lat(idx)); clon=mean(lon(idx)); 
   if N==1; 
      LAT=X.lat; LON=X.lon; T=X.data(:,30); S=X.data(:,33); F=X.data(:,31);
   else
      LAT=[LAT;X.lat]; LON=[LON;X.lon]; T=[T;X.data(:,30)]; S=[S;X.data(:,33)]; F=[F;X.data(:,31)];
   end
end
   XI=linspace(min(LON),max(LON),200); YI=[linspace(min(LAT),max(LAT),200)]';
   TG=griddata(LON,LAT,T,XI,YI);
	SG=griddata(LON,LAT,S,XI,YI);
   FG=griddata(LON,LAT,F,XI,YI);
end

   addpath c:\muse\auv\day\ryjo\
   load wcoastline.dat
   AX=[-122.5 -121.8 36.6 37.2];
   
   figure(1); clf; % giffig
   subplot(311); pcolor(XI,YI,TG); shading interp
   hold on; plot(wcoastline(:,1), wcoastline(:,2),'k');
   plot_iso([100 500 800],AX,'k'); axis(AX);
   p=plot(L
   subplot(312); pcolor(XI,YI,SG); shading interp
	hold on; plot(wcoastline(:,1), wcoastline(:,2),'k');
   plot_iso([100 500 800],AX,'k'); axis(AX);
	subplot(313); pcolor(XI,YI,FG); shading interp
	hold on; plot(wcoastline(:,1), wcoastline(:,2),'k');
	plot_iso([100 500 800],AX,'k'); axis(AX);


