%Small scale Georges Bank basemap
%RLimeburner   Jul 94
%modified even more by karen 1/99
%clear
%% REQURES MAP.MAT
figure;
clf
load map
% matrix with 1999 Broadscale Stations
%         Sta #    Lat(2)     Lon(3)     Depth(4)  NM(5)     PRIORITY(6)
gbsta=[  1.0000   41.0000  -68.9900   83.0000   21.0000    4.0000;...
2.0000   40.6500  -68.9900   67.0000   26.0000    3.0000;...
41.0000   40.3000  -68.9900   93.0000   21.0000    3.0000;...
3.0000   40.5300  -68.4480   92.0000   30.0000    1.0000;...
4.0000   41.0000  -68.2500   52.0000   14.0000    2.0000;...
5.0000   40.8500  -68.0000   63.0000   15.0000    3.0000;...
6.0000   40.6670  -67.7700   78.0000   25.0000    3.0000;...
7.0000   40.4500  -67.3000  270.0000   28.0000    1.0000;...
8.0000   40.8700  -67.0500   89.0000   14.0000    3.0000;...
9.0000   40.9680  -67.3200   78.0000   17.0000    1.0000;...
10.0000   41.0830  -67.6500   55.0000   17.0000    4.0000;...
11.0000   41.2300  -67.9600   50.0000   22.0000    3.0000;...
12.0000   41.4070  -67.5420   41.0000   19.0000    1.0000;...
13.0000   41.2700  -67.1700   55.0000   11.0000    2.0000;...
14.0000   41.2000  -66.9500   70.0000   15.0000    3.0000;...
15.0000   41.0330  -66.7000   79.0000   13.0000    4.0000;...
16.0000   40.9200  -66.4500  875.0000   17.0000    1.0000;...
17.0000   41.2000  -66.4500   92.0000   17.0000    2.0000;...
18.0000   41.4100  -66.7000   80.0000   17.0000    1.0000;...
19.0000   41.6000  -66.9800   62.0000   22.0000    3.0000;...
20.0000   41.7330  -66.5330   70.0000   13.0000    1.0000;...
21.0000   41.5400  -66.4000   88.0000   17.0000    3.0000;...
22.0000   41.5500  -66.0300  114.0000   17.0000    4.0000;...
23.0000   41.8000  -66.1900   84.0000   10.0000    2.0000;...
24.0000   41.8750  -66.0000  100.0000   26.0000    4.0000;...
25.0000   42.2980  -65.8480  219.0000   13.0000    2.0000;...
39.0000   42.1280  -66.0120  214.0000   19.0000    2.0000;...
26.0000   42.0670  -66.4330   86.0000   14.0000    3.0000;...
27.0000   41.9400  -66.7000   68.0000   13.0000    2.0000;...
28.0000   42.1000  -66.9000   66.0000   12.0000    4.0000;...
29.0000   42.3000  -66.9000  295.0000   27.0000    1.0000;...
30.0000   41.9170  -67.2330   49.0000   25.0000    2.0000;...
40.0000   42.1670  -67.6670  183.0000   10.0000    3.0000;...
31.0000   42.0000  -67.6170   49.0000   19.0000    4.0000;...
32.0000   41.6900  -67.6550   55.0000   18.0000    2.0000;...
33.0000   41.8300  -68.0000   61.0000   14.0000    4.0000;...
34.0000   41.8500  -68.3000  208.0000   16.0000    2.0000;...
35.0000   41.6000  -68.4500   73.0000   14.0000    4.0000;...
36.0000   41.4000  -68.3000   54.0000   15.0000    1.0000;...
37.0000   41.3000  -68.6000   69.0000   20.0000    3.0000;...
38.0000   41.4900  -68.9500  153.0000         0    1.0000];

gbl=length(gbsta);

isobath4000m1b(592,4)=-63.3889;
newcoastline3(2674,3)=50;newcoastline3(2674,3)=50;
newcoastline3(2674,4)=-72;
newcoastline3(2676,:)=newcoastline3(2675,:);
newcoastline3(2675,3)=50;
newcoastline1(848,:)=newcoastline1(847,:);
newcoastline1(847,3)=45;

cgw=[.991 .991 .991];
cg1b=[.97 .97 .97];
cg1a=[.94 .94 .94];
cg1=[.87 .87 .87];
cg2=[.8 .8 .8];
cg3=[.6 .6 .6];
cg4=[.5 .5 .5];
cg5=[.4 .4 .4];
cg6=[.3 .3 .3];
cgb=[.0001 .0001 .0001];
%%%%% CHANGE ISOBATHS ON OFF (black line [000], or 'none')
ecvar=[0 0 0];  %%was 'none'

%%%%%% CHANGE HERE FOR COLORS OF SHALLOWEST %%%%%%%%%%
cg1a=[.6 .6 .2 ]; % 60 meter isobath
cgb=[0 0 0]; % land
cgw=[.5 .2 0]; % top of bank
cg1=[.97 .97 .97];
%%cg3=[0 0 .4]; % deeper than 200


%%%%%%%%%%%%%%%BLUE SCALE%%%%%%%%

%% MAKE COLORS BLUE
cgw=[.9 .9 .991];% top of bank
cg1b=[0 0 .97];
cg1a=[.7 .7 .94]; % 60 meters
cg1=cg1a;
cg2=cg1a;
%%cg1=[0 0 .8]; % 100 meters
%%cg2=[.0 0 .5]; % 200 meters
cg3=[.1 .1 .4]; %  200 to 2000  meters? was .3.3.4
cg4=cg3;
cg5=cg3;
cg6=cg3;
%cg4=[.2 .2 .3];  % to 4000 meters
%cg5=[.1 .1 .2];  % below 4000 meters
%cg6=[.5 .5 .1];
cgb=[0 0 0];

%%%%%%%%%%%%%%%%%%%%%%%
%axes('position',[.16,.20,.70,.65])
ax1=axes;
axis([-71 -65 39.5 43.5])
hold on
box, 'on'

a=fill(isobath4000m1b(:,4),isobath4000m1b(:,3),cg5);set(a,'edgecolor',ecvar);
a=fill(isobath4000m1a(:,4),isobath4000m1a(:,3),cg4);set(a,'edgecolor',ecvar);
a=fill(isobath4000m2(:,4),isobath4000m2(:,3),cg4);set(a,'edgecolor',ecvar);
clear isobath4000m1a isobath4000m1b isobath4000m2
a=fill(isobath2000m1(:,4),isobath2000m1(:,3),cg3);set(a,'edgecolor',ecvar);
a=fill(isobath2000m2(:,4),isobath2000m2(:,3),cg3);set(a,'edgecolor',ecvar);
a=fill(isobath2000m3(:,4),isobath2000m3(:,3),cg3);set(a,'edgecolor',ecvar);
a=fill(isobath2000m4(:,4),isobath2000m4(:,3),cg3);set(a,'edgecolor',ecvar);
a=fill(isobath2000m5(:,4),isobath2000m5(:,3),cg3);set(a,'edgecolor',ecvar);
clear isobath2000m1 isobath2000m2 isobath2000m3 isobath2000m4 isobath2000m5
a=fill(isobath200m1(:,4),isobath200m1(:,3),cg2);set(a,'edgecolor',ecvar);
a=fill(isobath200m2(:,4),isobath200m2(:,3),cg3);set(a,'edgecolor',ecvar);
a=fill(isobath200m3(:,4),isobath200m3(:,3),cg3);set(a,'edgecolor',ecvar);
a=fill(isobath200m4(:,4),isobath200m4(:,3),cg3);set(a,'edgecolor',ecvar);
a=fill(isobath200m5(:,4),isobath200m5(:,3),cg3);set(a,'edgecolor',ecvar);
a=fill(isobath200m6(:,4),isobath200m6(:,3),cg3);set(a,'edgecolor',ecvar);
a=fill(isobath200m7(:,4),isobath200m7(:,3),cg3);set(a,'edgecolor',ecvar);
a=fill(isobath200m8(:,4),isobath200m8(:,3),cg3);set(a,'edgecolor',ecvar);
a=fill(isobath200m9(:,4),isobath200m9(:,3),cg3);set(a,'edgecolor',ecvar);
a=fill(isobath200m10(:,4),isobath200m10(:,3),cg3);set(a,'edgecolor',ecvar);
a=fill(isobath200m11(:,4),isobath200m11(:,3),cg3);set(a,'edgecolor',ecvar);
a=fill(isobath200m12(:,4),isobath200m12(:,3),cg3);set(a,'edgecolor',ecvar);
a=fill(isobath200m13(:,4),isobath200m13(:,3),cg3);set(a,'edgecolor',ecvar);
a=fill(isobath200m14(:,4),isobath200m14(:,3),cg3);set(a,'edgecolor',ecvar);
a=fill(isobath200m15(:,4),isobath200m15(:,3),cg3);set(a,'edgecolor',ecvar);
a=fill(isobath200m16(:,4),isobath200m16(:,3),cg3);set(a,'edgecolor',ecvar);
clear isobath200m1 isobath200m2 isobath200m3 isobath200m4 isobath200m5
clear isobath200m6 isobath200m7 isobath200m8 isobath200m9 isobath200m10
clear isobath200m11 isobath200m12 isobath200m13 isobath200m14 isobath200m15 isobath200m16
%% 100 METER ISOBATHS
a=fill(isobath100m1(:,4),isobath100m1(:,3),cg1);set(a,'edgecolor',ecvar);
a=fill(isobath100m2(:,4),isobath100m2(:,3),cg1);set(a,'edgecolor',ecvar);
a=fill(isobath100m3(:,4),isobath100m3(:,3),cg1);set(a,'edgecolor',ecvar);
a=fill(isobath100m4(:,4),isobath100m4(:,3),cg1);set(a,'edgecolor',ecvar);
a=fill(isobath100m5(:,4),isobath100m5(:,3),cg1);set(a,'edgecolor',ecvar);
a=fill(isobath100m6(:,4),isobath100m6(:,3),cg1);set(a,'edgecolor',ecvar);
a=fill(isobath100m7(:,4),isobath100m7(:,3),cg1);set(a,'edgecolor',ecvar);
a=fill(isobath100m8(:,4),isobath100m8(:,3),cg1);set(a,'edgecolor',ecvar);
a=fill(isobath100m9(:,4),isobath100m9(:,3),cg1);set(a,'edgecolor',ecvar);
a=fill(isobath100m10(:,4),isobath100m10(:,3),cg1);set(a,'edgecolor',ecvar);
a=fill(isobath100m11(:,4),isobath100m11(:,3),cg1);set(a,'edgecolor',ecvar);
a=fill(isobath100m12(:,4),isobath100m12(:,3),cg1);set(a,'edgecolor',ecvar);
a=fill(isobath100m13(:,4),isobath100m13(:,3),cg1);set(a,'edgecolor',ecvar);
a=fill(isobath100m14(:,4),isobath100m14(:,3),cg1);set(a,'edgecolor',ecvar);
clear isobath100m1 isobath100m2 isobath100m3 isobath100m4 isobath100m5
clear isobath100m6 isobath100m7 isobath100m8 isobath100m9 isobath100m10
clear isobath100m11 isobath100m12 isobath100m13 isobath100m14 
%% 60 METER ISOBATHS
a=fill(isobath60m1(:,4),isobath60m1(:,3),cg1a);set(a,'edgecolor',ecvar);
a=fill(isobath60m2(:,4),isobath60m2(:,3),cg1a);set(a,'edgecolor',ecvar);
a=fill(isobath60m3(:,4),isobath60m3(:,3),cg1a);set(a,'edgecolor',ecvar);
a=fill(isobath60m4(:,4),isobath60m4(:,3),cg1a);set(a,'edgecolor',ecvar);
a=fill(isobath60m5(:,4),isobath60m5(:,3),cg1a);set(a,'edgecolor',ecvar);
clear isobath60m1 isobath60m2 isobath60m3 isobath60m4 isobath60m5
%% 40 METER ISOBATHS COMMENTED OUT
%a=fill(isobath40m1(:,4),isobath40m1(:,3),cgw);set(a,'edgecolor','none');
%a=fill(isobath40m2(:,4),isobath40m2(:,3),cgw);set(a,'edgecolor','none');
%a=fill(isobath40m3(:,4),isobath40m3(:,3),cgw);set(a,'edgecolor','none');
%a=fill(isobath40m4(:,4),isobath40m4(:,3),cgw);set(a,'edgecolor','none');
%a=fill(isobath40m5(:,4),isobath40m5(:,3),cgw);set(a,'edgecolor','none');
%a=fill(isobath40m6(:,4),isobath40m6(:,3),cgw);set(a,'edgecolor','none');
%a=fill(isobath40m7(:,4),isobath40m7(:,3),cgw);set(a,'edgecolor','none');
%a=fill(isobath40m8(:,4),isobath40m8(:,3),cgw);set(a,'edgecolor','none');
%a=fill(isobath40m9(:,4),isobath40m9(:,3),cgw);set(a,'edgecolor','none');
%a=fill(isobath40m10(:,4),isobath40m10(:,3),cgw);set(a,'edgecolor','none');
clear isobath40m1 isobath40m2 isobath40m3 isobath40m4 isobath40m5 isobath40m6 isobath40m7
clear isobath40m8 isobath40m9 isobath40m10

%a=fill(isobath20m1(:,4),isobath20m1(:,3),cg1b);set(a,'edgecolor','none');
%a=fill(isobath20m2(:,4),isobath20m2(:,3),cg1b);set(a,'edgecolor','none');
%a=fill(isobath20m3(:,4),isobath20m3(:,3),cg1b);set(a,'edgecolor','none');
%a=fill(isobath20m4(:,4),isobath20m4(:,3),cg1b);set(a,'edgecolor','none');
%a=fill(isobath20m5(:,4),isobath20m5(:,3),cg1b);set(a,'edgecolor','none');
%a=fill(isobath20m6(:,4),isobath20m6(:,3),cg1b);set(a,'edgecolor','none');
%a=fill(isobath20m7(:,4),isobath20m7(:,3),cg1b);set(a,'edgecolor','none');
clear isobath20m1 isobath20m2 isobath20m3 isobath20m4 isobath20m5 isobath20m6 isobath20m7


a=fill(newcoastline1(:,4),newcoastline1(:,3),cgb);set(a,'edgecolor','none');
a=fill(newcoastline2(:,4),newcoastline2(:,3),cgb);set(a,'edgecolor','none');
a=fill(newcoastline3(:,4),newcoastline3(:,3),cgb);set(a,'edgecolor','none');
a=fill(newcoastline4(:,4),newcoastline4(:,3),cgb);set(a,'edgecolor','none');
a=fill(newcoastline5(:,4),newcoastline5(:,3),cgb);set(a,'edgecolor','none');
a=fill(newcoastline6(:,4),newcoastline6(:,3),cgb);set(a,'edgecolor','none');
a=fill(newcoastline7(:,4),newcoastline7(:,3),cgb);set(a,'edgecolor','none');
a=fill(newcoastline8(:,4),newcoastline8(:,3),cgb);set(a,'edgecolor','none');
a=fill(newcoastline9(:,4),newcoastline9(:,3),cgb);set(a,'edgecolor','none');
a=fill(newcoastline10(:,4),newcoastline10(:,3),cgb);set(a,'edgecolor','none');
a=fill(newcoastline11(:,4),newcoastline11(:,3),cgb);set(a,'edgecolor','none');
a=fill(newcoastline12(:,4),newcoastline12(:,3),cgb);set(a,'edgecolor','none');
a=fill(newcoastline13(:,4),newcoastline13(:,3),cgb);set(a,'edgecolor','none');
a=fill(newcoastline14(:,4),newcoastline14(:,3),cgb);set(a,'edgecolor','none');
a=fill(newcoastline15(:,4),newcoastline15(:,3),cgb);set(a,'edgecolor','none');
a=fill(newcoastline16(:,4),newcoastline16(:,3),cgb);set(a,'edgecolor','none');
a=fill(newcoastline17(:,4),newcoastline17(:,3),cgb);set(a,'edgecolor','none');
a=fill(newcoastline18(:,4),newcoastline18(:,3),cgb);set(a,'edgecolor','none');
a=fill(newcoastline19(:,4),newcoastline19(:,3),cgb);set(a,'edgecolor','none');
a=fill(newcoastline20(:,4),newcoastline20(:,3),cgb);set(a,'edgecolor','none');
a=fill(newcoastline21(:,4),newcoastline21(:,3),cgb);set(a,'edgecolor','none');
a=fill(newcoastline22(:,4),newcoastline22(:,3),cgb);set(a,'edgecolor','none');
a=fill(newcoastline23(:,4),newcoastline23(:,3),cgb);set(a,'edgecolor','none');
clear newcoastline1 newcoastline2 newcoastline3 newcoastline4 newcoastline5
clear newcoastline6 newcoastline7 newcoastline8 newcoastline9 newcoastline10
clear newcoastline11 newcoastline12 newcoastline13 newcoastline14 newcoastline15
clear newcoastline16 newcoastline17 newcoastline18 newcoastline19 newcoastline20
clear newcoastline21 newcoastline22 newcoastline23 

% Improve axes labels
set(ax1,'TickDir','out')
yt=[39.5:0.25: 43.5 ];
set(ax1,'Ytick',yt)
set(ax1,'Yticklabel', '||40||||41||||42||||43||||')
xt=[-71:0.25: -65];

set(ax1,'Xtick',xt,'fontname','times','fontsize',24,'fontw','bold')
set(ax1, 'Xticklabel', '-71||||-70||||-69||||-68||||-67||||-66||||-65')
%ax1=gca;

%TITLE
t=title('US GLOBEC Broadscale Survey Stations');
set(t, 'fontname', 'times', 'fontsize', 28, 'fontw', 'bold');

% Add Depth labels
fontsizer=16;
cgb=[0 0 0];
t1=text(-70.5,40.15,'200 m');
%set(t1,'Rotation',40)
set(t1,'col',cgb)
set(t1,'fontname','times','fontsize',fontsizer)
set(t1,'fontw','bold')


t1=text(-70.4,40.45,'100 m');
set(t1,'fontname','times','fontsize',fontsizer)
set(t1,'fontw','bold')
set(t1,'col',cgb)

t1=text(-70.3,40.7,'60 m');
set(t1,'fontname','times','fontsize',fontsizer)
set(t1,'fontw','bold')
set(t1,'col',cgb)

%t1=text(-70.2,41.0,'40 m');
%set(t1,'col',cgb)
%set(t1,'fontname','times','fontsize',fontsizer)
%set(t1,'fontw','bold')
%set(t1,'col',cgb)



clear t1 t2 cgw cgb cg1 cg2 cg3 cg4 cg5 cg6
clear a fourcorners xt yt

%% Plot track line
plot(gbsta(:,3), gbsta(:,2), 'y-', 'linewidth', 3)

%% Find out priorities of various stations
msizer=8;

[i,j]=find(gbsta(:,6)<2);
hp=plot(gbsta(i,3), gbsta(i,2), 'yo');% was rp
set(hp, 'MarkerFaceColor', 'r', 'MarkerSize', 10);
set(hp, 'MarkerFaceColor', 'k', 'MarkerSize', msizer);

[i,j]=find(gbsta(:,6)>3);
ht=plot(gbsta(i,3), gbsta(i,2), 'yo');%was b^
set(ht, 'MarkerFaceColor', 'b', 'MarkerSize', 6);
set(ht, 'MarkerFaceColor', 'k', 'MarkerSize', msizer);
gbsta(i,6)=gbsta(i,6)-3;


[i,j]=find(gbsta(:,6)>2);
hd=plot(gbsta(i,3), gbsta(i,2), 'yo'); % was cd
set(hd, 'MarkerFaceColor', 'c', 'MarkerSize', 7);
set(hd, 'MarkerFaceColor', 'k', 'MarkerSize', msizer);
gbsta(i,6)=gbsta(i,6)-2;

[i,j]=find(gbsta(:,6)>1);
hc=plot(gbsta(i,3), gbsta(i,2), 'yo');% was go
set(hc, 'MarkerFaceColor', 'g', 'Markersize', 7);
set(hc, 'MarkerFaceColor', 'k', 'Markersize', msizer);

H=[hp; hc; hd; ht];

aspect(41.5); % runs aspect.m to give right ratio
%%leghandle=legend(H, 'Priority 1', 'Priority 2', 'Priority 3', 'Priority 4', 4);
%%set(leghandle, 'FontSize', 8, 'FontName', 'times')
%%% ADDS STATION NUMBERS

%for j=1:gbl
%	x=(gbsta(j,1));
%	thd=text(gbsta(j,3), gbsta(j,2), ['  ', num2str(x)]);
%	set(thd, 'FontName', 'times', 'fontw', 'bold', 'fontsize', 16);
%end

%add thick border line for regions
%box=[-69.355 42.55; -69.355 40.155;-65.555 40.155;-65.555 42.55;-69.355 42.55];
%box=[-69.355 42.55; -69.355 42.55];
%box=[-67.75 42.55;-69.155 41.5;-69.155 40.155;-67.055 40.155; -65.555 41.25;-65.555 42.55;-67.75 42.55];
%h=plot(box(:,1),box(:,2));set(h,'linewidth',2)
newliner=[-69.355 41.5; ];
yoyo=plot(newliner(:,1), newliner(:,2), 'r')

clear box h

%ax2=axes('Position', get(ax1, 'Position'),...
         %'XAxisLocation', 'top',...
		 %'YAxisLocation', 'right',...
		 %'color', 'none','xcolor', 'k', 'ycolor','k')
        
set(ax1, 'layer', 'top', 'xgrid', 'on', 'ygrid', 'on')


print -dtiff gbbsstations.tiff
