%plot points on track line;
% x = lon, y=lat, f=data
cruiseids=['9808';]
%'9808';'9901';'E320';'9906'];

[rcid, ccid]=size(cruiseids);
%load stations.mat % depthsta latsta lonsta distnext stasta prista
%seawifsids=['clim9806';'clim9812';'clim9824';...
    % 'clim9906';'clim9912';'clim9924'];


%numlist=[1 2 4 8 16 32 64 128 256 512];
for idex=1:rcid
   cruise=cruiseids(idex,:)
   load(['ESS' cruise '.mat']) % day fluor sal temp xlon ylat GB
%   load(['wp' cruise 'f.mat']); % wavelet data


%%for k=1:10
	%eval(['GODAT=DAT' num2str(numlist(k)) ';'])
GODAT=f';
x=x;y=y;
xdiff=diff(x);
ydiff=diff(y);
xdiff=[diff(x); xdiff(length(xdiff))];
ydiff=[diff(y); ydiff(length(ydiff))];

[tdiff1, rdiff1]=cart2pol(xdiff, ydiff);
%fdat=f./(max(f)*10);
[xdiff2, ydiff2]=pol2cart(tdiff1+(pi/2), (rdiff1+GODAT'));


gbmapls2000
hold on
divfac=10000;
xreplot=x+xdiff2./divfac;
yreplot=y+ydiff2./divfac;

%plot with colors to make more legible
factorby=(mean(GODAT)-min(GODAT))./7
%factorby=0.001
%coldots=['m.';'b.';'c.';'go';'yx';'r*'];
coldots=['mo';'bo';'co';'go';'yo';'ro'];
colmat=[1 0 1; 0 0 1; 0 1 1; 0 1 0; 1 1 0; 1 0 0]
pieceplot1=plot(xreplot, yreplot, 'k');
grayt=gray;
set(pieceplot1, 'linew', 8)

for j=1:64
hiGO=ceil((1+GODAT)*10);
ec=grayt(hiGO, :);
%colmat=[.1 .1 .1; .2 .2 .2; .4 .4 .4; .6 .6 .6; .
i=find(abs(hiGO)>=j & abs(hiGO)<(j+1));
%% allplot=plot(xreplot, yreplot, 'k.');
%% set(allplot, 'markersize', 6);
%pieceplot=plot(xreplot(i), yreplot(i), 'k.')
%set(pieceplot, 'markersize', 1);
%fc=[1/j 1/j 1/j];

%ec=1-fc;
fc=ec;

[ri, ci]=size(xreplot);

%pieceplot=plot(xreplot(i), yreplot(i), coldots(j,:));


pieceplot=plot(xreplot(i), yreplot(i), 'w.');

set(pieceplot, 'markersize', 5, 'markerfacecol', grayt(j,:), ...
'markeredgecol', grayt(j,:), 'marker', 'o')
ax1=gca;


end
%title(['Variation in  Fluorescence on ' cruise])
h=colorbar;colormap(gray);set(h, 'yticklabel',...
'0|0.5|1.0|1.5|2.0|2.5|3.0|3.5|4.0|4.5|5.0 VOLTS')

		xf=xlabel('Degrees Longitude ')
		yf=ylabel('Degrees Latitude ')
		set(xf, 'fontsize', 16, 'fontweight', 'bold');
		set(yf, 'fontsize', 16, 'fontweight', 'bold');
		set(ax1, 'fontsize', 16, 'fontweight', 'bold');
		orient landscape
		%axis tight
		[m,map]=capture;
		imwrite(m,map, [cruise 'fluorortho.tif']);
		print -dtiffnocompression fluortho.tif
		print -dpict fluortho.pict
%%print -dps2
%%end
end
