%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%                    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
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 03/05/16 AD: new version
%% 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
LATEXtools_cruise
%
%- SPASSO FSLE fname
fname=[dirin_FSLE filesep '20151018_nrt_med_2014_d0_lambda_only.mat']
%fname=[dirin_FSLE filesep '20160407_nrt_med_2014_d0_lambda_only.mat']

%- Plot the figure
figure(1); hold on; 
m_proj('mercator','lon',[lonmin lonmax],'lat',[latmin latmax])
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
% plot the manifolds
plot_FSLE(fname,0.01);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%- Figure title -%
title([fname], 'Interpreter','none')
%
%- 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.png'],'-dpng','-r200');
%
disp(' ');
disp('----- END ---')
