%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%                    LATEXtools                         %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%  This  file  is  free software ;  it  is distributed  in  %
%%  the hope that  it  will  be  useful,  but  without  any  %
%%  warranty.  You  can  redistribute  it and/or modify  it  %
%%  under  the  terms  of  the  GNU  General Public License  %
%%  as  published  by  the   Free  Software  Foundation  at  %
%%       http://www.gnu.org/copyleft/gpl.html                %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Script for draw a geographical map with FSLE manifolds
%%%
%%% INPUT : coastline .mat file
%%%
%%% OUTPUT: m_map figure 
%%%
%%% ALGORITHM: calcuate de projection and
%%%            plot
%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 24/06/13 : andrea.doglioli@univ-amu.fr : first official release
%%
%% Credits: F.Nencioli, A.Doglioli, L.Rousselet
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
help map_FSLE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear;close all;
%%
LATEXtools_param
%
%- Date of FSLE map
year=2010;
month=9;
day=11;
%
%- FSLE Caption position
lon_text=3.9;
lat_text=42.16;
%
%- ADCP Data directory -%
fname='final_ADCP_Saved.mat';
%
%- ADCP Time interval -%
interval=[datenum(2010,9,11,0,0,0) datenum(2010,9,12,0,0,0)];
%%% for IO check
% interval=[datenum(2010,9,20,20,15,22) datenum(2010,9,21,1,46,25)];
% interval2=[ datenum(2010,9,21,1,46,25) datenum(2010,9,21,7,11,25)];
%
%- Depth -%
depth=15 ;%[m] positive
%
%- Plot Options
myopt='b';
myopt2='r';
%
%- Legend Options
myscale=5;
legend_unit=0.2;
legend_lon=4.1;
legend_lat=42.5;
%
%- Map boundaries -%
lonmin=3;
lonmax=4.5;
latmin=42;
latmax=42.9;
%
%- Geographic projection for m_map -%
projection = 'mercator';
%
%- User coast in dirin -%
UserCoast='GOL.mat'; % in "sub_functions" directory
%
%- Plot the figure
figure(1); hold on; 
m_proj('mercator','lon',[lonmin lonmax],'lat',[latmin latmax])
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%
plot_FSLE(dirin_FSLE,year,month,day,lon_text,lat_text)
%
plot_ADCP(dirin_ADCP,fname,interval,depth,myopt,myscale,legend_unit,legend_lon,legend_lat);
%plot_ADCP(dirin_ADCP,fname,interval2,depth,myopt2,myscale,legend_unit,legend_lon,legend_lat);
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%- Figure title -%
title(['LATEX 2010 map-FSLE-ADCP'])
%
%- NW Mediterranean High Resolution Isobaths -%
plot_BATHY(dirin_BATHY,[200 500]);
%
%- User's High Resolution Coastline -%
m_usercoast(UserCoast,'patch',[.7 .7 .7],'edgecolor','k');
%m_coast('patch',[.7 .7 .7],'edgecolor','k');
%
%- Geographical Axis -%
m_grid('box','fancy','tickdir','in');
xlabel('Longtitude');
ylabel('Latitude');
%
%- Figure Printing -%
print(1,[figdir,'map_FSLE_ADCP.png'],'-dpng','-r200');
%
disp(' ');
disp('----- END ---')
