Skip to content

Commit

Permalink
revision2updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Camille Pagniello committed Aug 28, 2023
1 parent 63dc1f8 commit 35b9fc2
Show file tree
Hide file tree
Showing 227 changed files with 757 additions and 124 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified code/.DS_Store
Binary file not shown.
Binary file modified code/matlab/.DS_Store
Binary file not shown.
27 changes: 13 additions & 14 deletions code/matlab/Irish_Tuna.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@

%% Figure 1

run figure_1a
run figure_1b
run figure_1

%% Figure 2

Expand All @@ -80,21 +79,25 @@

run figure_6

%% Figure 7 and Table 4
%% Figure 7 and 8

run figure_7_and_table_4
run figure_7_and_8

%% Figure 9 and Table 4

run figure_9_and_table_4

%% Table S9 to S16

run table_S9_to_S16

%% Figure 8
%% Figure 10

run figure_8
run figure_10

%% Figure 9
%% Figure 11

run figure_9
run figure_11

%% Table 3 and Table S7 and S8

Expand All @@ -116,10 +119,6 @@

run figure_S3

%% Figure S4 to S6

run figure_S4_to_S6

%% Figure S7 to S11
%% Figure S4

run figure_S7_to_S11
run figure_S4
Binary file modified code/matlab/sub_functions/.DS_Store
Binary file not shown.
Binary file modified code/matlab/sub_functions/figures/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,14 @@
%% Plot ocean regions.

m_line(regions.NB.bndry(1,:),regions.NB.bndry(2,:),'linewi',2,'color','k');
%m_text(-53,51.5,'Newfoundland Basin','FontWeight','bold');

m_line(regions.CI.bndry(1,:),regions.CI.bndry(2,:),'linewi',2,'color','k');
%m_text(-20.5,61.2,'Coastal Ireland','FontWeight','bold');

m_line(regions.Biscay.bndry(1,:),regions.Biscay.bndry(2,:),'linewi',2,'color','k');
%m_text(-2,51,'Bay of Biscay','FontWeight','bold');

m_line(regions.WEB.bndry(1,:),regions.WEB.bndry(2,:),'linewi',2,'color','k');
%m_text(-2,51,'West European Basin','FontWeight','bold');

m_line(regions.Med.bndry(1,:),regions.Med.bndry(2,:),'linewi',2,'color','k');
%m_text(-4.5,32,'Mediterranean','FontWeight','bold');

%% Create figure border.

Expand All @@ -69,13 +64,12 @@

set(gca,'Position',p);

clear cmap
clear p

%% Save

cd([fdir 'figures']);
exportgraphics(gcf,'figure_1b.png','Resolution',300)
exportgraphics(gcf,'figure_1.png','Resolution',300)

%% Clear

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%% figure_8
%% figure_10
% Sub-function of Irish_Tuna.m; plots zoomed in bin map, ADT
% and EKE in Newfoundland Basin hotspot

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%% figure_9
%% figure_11
% Sub-function of Irish_Tuna.m; plot ADT and EKE for WEB, CI, BoB and Med.

%% West European Basin - ADT
Expand Down
92 changes: 20 additions & 72 deletions code/matlab/sub_functions/figures/figure_2.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
%% figure_2.m
% Sub-function of Irish_Tuna.m; plots SSM tracks of all tags in each season
% colored by month.
% Sub-function of Irish_Tuna.m; plots bin map of all tags in each season.

%% Loop through each season

Expand All @@ -15,14 +14,15 @@
LATLIMS = [20 70]; LONLIMS = [-80 40];
m_proj('miller','lon',LONLIMS,'lat',LATLIMS);

%% Plot bathymetry.
%% Bin SSM Positions

[cs,ch] = m_etopo2('contourf',-8000:500:0,'edgecolor','none');
binned.LONedges = -80:1:40;
binned.LATedges = 20:1:70;

h1 = m_contfbar([.3 .7],.05,cs,ch,'endpiece','no','FontSize',16);
xlabel(h1,'Bottom Depth (m)');
[binned.N,binned.LONmid,binned.LATmid] = twodhist(META.Longitude(META.Season == i),META.Latitude(META.Season == i),...
binned.LONedges,binned.LATedges);

colormap(m_colmap('blue'));
m_pcolor(binned.LONmid-0.25,binned.LATmid-0.25,binned.N);

hold on

Expand All @@ -32,78 +32,21 @@

hold on

%% Set colormap by month.

MM = unique(month(META.Date));
%cmap = getPyPlot_cMap('Paired',12);
cmap = [0.122,0.122,1; 0,0.773,1; 0.149,0.451,0; 0.298,0.902,0;...
0.914,1,0.745; 1,1,0; 1,0.666,0; 1,0,0; 0.659,0,0; 0.8,0.745,0.639;...
0.663,0,0.902; 1,1,1];
cmap_v2 = [0.122,0.122,1; 0,0.773,1; 0.149,0.451,0; 0.298,0.902,0;...
0.914,1,0.745; 0.9843,0.6039,0.6000; 1,0,0; 0.659,0,0; 0.9365,0.4000,0.0681; 1,0.666,0; 0.9943,0.8627,0.7294;...
0.6510,0.8078,0.8902];

%% Plot SSM positions of tuna colored by month.

% Plot each tag.
for j = 1:length(MM)
if i == 1 && (j == 12 || j == 1 || j == 2)
m(j) = m_plot(META.Longitude(MM(j) == month(META.Date)),...
META.Latitude(MM(j) == month(META.Date)),...
'ko','MarkerFaceColor',cmap_v2(j,:),'MarkerEdgeColor','k','MarkerSize',3);
hold on
else
m(j) = m_plot(-100,100,'o','MarkerFaceColor',cmap_v2(j,:),'MarkerEdgeColor','k','MarkerSize',3);
end
if i == 2 && (j == 3 || j == 4 || j == 5)
m(j) = m_plot(META.Longitude(MM(j) == month(META.Date)),...
META.Latitude(MM(j) == month(META.Date)),...
'ko','MarkerFaceColor',cmap_v2(j,:),'MarkerEdgeColor','k','MarkerSize',3);
hold on
else
m(j) = m_plot(-100,100,'o','MarkerFaceColor',cmap_v2(j,:),'MarkerEdgeColor','k','MarkerSize',3);
end

if i == 3 && (j == 6 || j == 7 || j == 8)
m(j) = m_plot(META.Longitude(MM(j) == month(META.Date)),...
META.Latitude(MM(j) == month(META.Date)),...
'ko','MarkerFaceColor',cmap_v2(j,:),'MarkerSize',3,'MarkerEdgeColor','k');
hold on
else
m(j) = m_plot(-100,100,'o','MarkerFaceColor',cmap_v2(j,:),'MarkerEdgeColor','k','MarkerSize',3);
end

if i == 4 && (j == 9 || j == 10 || j == 11)
m(j) = m_plot(META.Longitude(MM(j) == month(META.Date)),...
META.Latitude(MM(j) == month(META.Date)),...
'ko','MarkerFaceColor',cmap_v2(j,:),'MarkerSize',3,'MarkerEdgeColor','k');
hold on
else
m(j) = m_plot(-100,100,'o','MarkerFaceColor',cmap_v2(j,:),'MarkerEdgeColor','k','MarkerSize',3);
end
end
clear j

%% Plot ICCAT regions.

m_line([-45 -45],[20 70],'linewi',2,'color','k','linestyle','--')

%% Plot ocean regions.

m_line(regions.NB.bndry(1,:),regions.NB.bndry(2,:),'linewi',2,'color','k');
%m_text(-53,51.5,'Newfoundland Basin','FontWeight','bold');

m_line(regions.CI.bndry(1,:),regions.CI.bndry(2,:),'linewi',2,'color','k');
%m_text(-20.5,61.2,'Coastal Ireland','FontWeight','bold');

m_line(regions.Biscay.bndry(1,:),regions.Biscay.bndry(2,:),'linewi',2,'color','k');
%m_text(-2,51,'Bay of Biscay','FontWeight','bold');

m_line(regions.WEB.bndry(1,:),regions.WEB.bndry(2,:),'linewi',2,'color','k');
%m_text(-2,51,'West European Basin','FontWeight','bold');

m_line(regions.Med.bndry(1,:),regions.Med.bndry(2,:),'linewi',2,'color','k');
%m_text(-4.5,32,'Mediterranean','FontWeight','bold');

%% Create figure border.

Expand All @@ -126,13 +69,19 @@
title('Fall','FontSize',26);
end

%% Add Legend
%% Add colorbar

% p = get(gca,'Position');

% h = colorbar('FontSize',16);
colormap(flipud(hot(1500)));
% ylabel(h,'Number of Daily Geolocations','FontSize',16);
caxis([0 50]);
% h.Ticks = 0:10:50;

% set(gca,'Position',p);

% [~,icon] = legend(m,{'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'},'FontSize',14,'Location','bestoutside');
% icons = findobj(icon, 'type', 'line');
% set(icons,'MarkerSize',12);
% clear MM
% clear icon*
% clear p

%% Save figure.

Expand All @@ -141,7 +90,7 @@

%% Clear

clear ax* c* h* m M *LIMS
clear ax* c* h* *LIMS
clear ans

close gcf
Expand All @@ -150,4 +99,3 @@

clear i
clear tmp
clear MM
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
%% figure_S3_to_S5
%% figure_7_and_8
% Sub-function of Irish_Tuna.m; plots timeseries and track for 3 tags. Need
% to manually edit filename each time.

%% Define filename.

% 5116034
% 5116043
% 5120057

cd([fdir 'data/archival']);

% filename = '5116034_14P0031_clean.csv';
filename = '5116043_16P1265_clean.csv';
filename = '5116034_14P0031_clean.csv';
% filename = '5116043_16P1265_clean.csv';
% filename = '5120057_L330-2973_clean.csv';

%% Load PAT data.
Expand Down Expand Up @@ -143,9 +142,12 @@
hold on

MM = unique(month(META.Date));
cmap = [0.122,0.122,1; 0,0.773,1; 0.149,0.451,0; 0.298,0.902,0;...
0.914,1,0.745; 0.9843,0.6039,0.6000; 1,0,0; 0.659,0,0; 0.9365,0.4000,0.0681; 1,0.666,0; 0.9943,0.8627,0.7294;...
0.6510,0.8078,0.8902];
cmap = [0.122,0.122,1 ; 0,0.773,1; 0.149,0.451,0; 0.298,0.902,0;...
0.914,1,0.745; 1,1,0; 1,0.666,0; 1,0,0; 0.659,0,0; 0.8,0.745,0.639;...
0.663,0,0.902; 1,1,1];
% cmap = [0.122,0.122,1; 0,0.773,1; 0.149,0.451,0; 0.298,0.902,0;...
% 0.914,1,0.745; 0.9843,0.6039,0.6000; 1,0,0; 0.659,0,0; 0.9365,0.4000,0.0681; 1,0.666,0; 0.9943,0.8627,0.7294;...
% 0.6510,0.8078,0.8902];

tmp.lon = META.Longitude(META.TOPPid == str2double(filename(1:7)));
tmp.lat = META.Latitude(META.TOPPid == str2double(filename(1:7)));
Expand All @@ -160,12 +162,12 @@

for j = 1:length(MM)
if isempty(tmp.lon(MM(j) == month(tmp.date)))
m(j) = m_plot(-100,100,'o','MarkerFaceColor',cmap(j,:),'MarkerEdgeColor','k','MarkerSize',5);
m(j) = m_plot(-100,100,'o','MarkerFaceColor',cmap(j,:),'MarkerEdgeColor','k','MarkerSize',6);
hold on
else
m(j) = m_plot(tmp.lon(MM(j) == month(tmp.date)),...
tmp.lat(MM(j) == month(tmp.date)),...
'ko','MarkerFaceColor',cmap(j,:),'MarkerEdgeColor','k','MarkerSize',5);
'ko','MarkerFaceColor',cmap(j,:),'MarkerEdgeColor','k','MarkerSize',6);
hold on
end
end
Expand All @@ -178,16 +180,16 @@
m_line(regions.WEB.bndry(1,:),regions.WEB.bndry(2,:),'linewi',2,'color','k');
m_line(regions.Med.bndry(1,:),regions.Med.bndry(2,:),'linewi',2,'color','k');

m_grid('linewi',2,'tickdir','in','linest','none','fontsize',24);
m_grid('linewi',2,'tickdir','in','linest','none','fontsize',20);

m_northarrow(-75,65,4,'type',2,'linewi',2);
m_ruler([.78 .98],.1,2,'fontsize',16,'ticklength',0.01);

cd([fdir 'figures']);
if str2double(filename(1:7)) == 5116034
exportgraphics(gcf,'figure_S4b.png','Resolution',300);
exportgraphics(gcf,'figure_7b.png','Resolution',300);
elseif str2double(filename(1:7)) == 5116043
exportgraphics(gcf,'figure_S5b.png','Resolution',300);
exportgraphics(gcf,'figure_8b.png','Resolution',300);
elseif str2double(filename(1:7)) == 5120057
exportgraphics(gcf,'figure_S6b.png','Resolution',300);
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%% figure_7_and_table_4.m
%% figure_9_and_table_4.m
% Sub-function of Irish_Tuna.m; plots eddy histograms with each region and
% compute eddy statistics.

Expand Down
Loading

0 comments on commit 35b9fc2

Please sign in to comment.