Commit 22d64a8d authored by Dany Dumont's avatar Dany Dumont
Browse files

Ajout de map_egsl.m et des dependances

parent 4abdf561
function col=bathy(m)
% BATHY - A colormap suited for bathymetry.
%
% Use COLORMAP(BATHY).
%
% See also PHYTO, HOT, JET, PINK, FLAG, COLORMAP, RGBPLOT.
% Dany Dumont 15/11/2015
if nargin < 1,
m=size(get(gcf,'colormap'),1);
end
c=[ 220 240 240;
0 80 140]./255;
for i=1:3;
col(:,i) = interp1([0 1],c(:,i)',linspace(0,1,m))';
end;
File added
function map_egsl_test(region)
% MAP_EGSL -
% Syntax: map_egsl(region)
%
% Inputs:
% region - A number indicating the map domain:
% 1: Lower St.Lawrence Estuary (LSLE)
% 2: The St.Lawrence Estuary (SLE)
% 3: The Gulf of St. Lawrence (GSL)
%
% Other m-files required: The m_map toolbox
% Subfunctions: none
% MAT-files required: bathy_gsl.mat
%
% See also:
%
% Author: Dany Dumont
% UQAR/ISMER
% April 2019;
% ______________________________________________________________________
% Limites de la carte
if region == 1
% LSLE
latMin = 48.0; latMax = 49.5;
lonMin = -69.5; lonMax = -67.5;
elseif region == 2
% SLE
latMin = 47.0; latMax = 49.5;
lonMin = -70.5; lonMax = -67.0;
elseif region == 3
% GSL
latMin = 45.3; latMax = 52.0;
lonMin = -70.5; lonMax = -56.0;
else
disp(' Error: Choose a valid region number')
disp(' 1 - Lower St.Lawrence Estuary');
disp(' 2 - St.Lawrence Estuary');
disp(' 3 - Gulf of St.Lawrence');
disp(' 4 - Saguenay Fjord -> not yet implemented');
return
end
figure(1); clf
% Projection (see m_map for other possible projections)
m_proj('mercator', 'long',[lonMin lonMax],'lat',[latMin latMax]);
%% Bathymetry
load bathy_gsl
if region == 1 || region == 2
m_contourf(lon_stp,lat_stp,dep_stp); hold on
m_contour(lon_stp,lat_stp,dep_stp);
caxis([0 150])
elseif region == 3
m_contourf(lon_gsl,lat_gsl,dep_gsl); hold on
m_contour(lon_gsl,lat_gsl,dep_gsl);
caxis([0 400])
end
colormap(bathy)
shading flat
c = colorbar('FontName','Times New Roman');
c.Label.String = 'Depth (m)';
xlabel('Longitude','FontSize',12,'Interpreter','latex')
ylabel('Latitude','FontSize',12,'Interpreter','latex')
%% Coastline
landColor = [200/255 200/255 200/255]; % Gris
%landColor = [255/255 255/255 224/255]; % Jaune carte marine
if region == 1 || region == 2
m_gshhs_f('patch',landColor);
elseif region == 3
m_gshhs_h('patch',landColor);
end
%% Plot a box
bnd_lon = [-69.5 -68.0 -67.8 -69.5 -69.5];
bnd_lat = [ 48.5 49.5 48.0 47.5 48.5];
m_line(bnd_lon,bnd_lat,'linewidth',2,'color','k'); % Area outline ...
m_hatch(bnd_lon,bnd_lat,'single',30,5,'color','k'); % ...with hatching added.
%% Plot some stations
PAO_lon = -68.44;
PAO_lat = 49.04;
PAB_lon = -69.14;
PAB_lat = 48.58;
PAP_lon = -68.48;
PAP_lat = 48.50;
STF_lon = -68.23;
STF_lat = 48.60;
m_plot(PAO_lon,PAO_lat,'xr','MarkerSize',10)
m_plot(PAB_lon,PAB_lat,'xr','MarkerSize',10)
m_plot(PAP_lon,PAP_lat,'xr','MarkerSize',10)
m_plot(STF_lon,STF_lat,'xr','MarkerSize',10)
%% Makes nice (fancy) map-like axes
m_grid('box','fancy','fontsize',12,'linestyle','none','fontname','times','interpreter','latex');
hold off
%% Print figure
% Figure dimension
paperWidth = 12; %cm
paperHeight = 12; %cm
set(gcf,'PaperUnits','centimeters');
set(gcf,'PaperSize',[paperWidth paperHeight]);
set(gcf,'PaperPosition',[0 0 paperWidth paperHeight]);
if region == 1
print('-dpng','map_lsle.png');
print('-depsc2','map_lsle.eps');
elseif region == 2
print('-dpng','map_sle.png');
print('-depsc2','map_sle.eps');
elseif region == 3
print('-dpng','map_gsl.png');
print('-depsc2','map_gsl.eps');
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment