Skip to content
Snippets Groups Projects
Commit 8aedf8aa authored by gael.alory_legos.obs-mip.fr's avatar gael.alory_legos.obs-mip.fr
Browse files

gestion de la carte pour les tours du monde

parent f9ec853a
No related branches found
No related tags found
No related merge requests found
......@@ -31,20 +31,28 @@ ind = find( tsg.DAYD >= dateLim(1) & tsg.DAYD <= dateLim(2));
if ~isempty( ind )
latMin = min( tsg.LATX(ind) ) - 2;
latMin = min( tsg.LATX(ind) );
if latMin < -90
latMin = -90;
end
latMax = max( tsg.LATX(ind) ) + 2;
latMax = max( tsg.LATX(ind) );
if latMax > 90
latMax = 90;
end
lonMin = min( tsg.LONX(ind) ) - 2;
lonMax = max( tsg.LONX(ind) ) + 2;
lonMin = min( tsg.LONX(ind) );
lonMax = max( tsg.LONX(ind) );
%oversize window due to the large frame
%--------------------------------------
latRange = (latMax-latMin);
latMin = max(latMin - 0.05*latRange, -90);
latMax = min(latMax + 0.05*latRange, 90);
if lonMax > (lonMin+360)
lonMin = 0;
lonMax = 360;
lonMax = lonMin+360;
end
lonRange = (lonMax-lonMin);
lonMin = lonMin - 0.03*lonRange;
lonMax = lonMax + 0.03*lonRange;
% Positionning the right axes
% ----------------------------
......
......@@ -32,8 +32,7 @@ NO_CONTROL = s.code;
% Suppress longitude discontinuity at -180 or 180 crossing
% --------------------------------------------------------
deflon=find(isfinite(tsg.LONX));
dlon=circshift(tsg.LONX(deflon),-1)-tsg.LONX(deflon);
dlon=dlon(1:end-1);
dlon=diff(tsg.LONX(deflon));
tsg.indcross=find(abs(dlon)>180);
if ~isempty(tsg.indcross)
tsg.loncross=sign(dlon(tsg.indcross))*360;
......@@ -47,7 +46,7 @@ end
% -----------------------------------------------------------------
tsg.SOUTH_LATX = min(tsg.LATX);
tsg.NORTH_LATX = max(tsg.LATX);
if max(tsg.LONX)>(min(tsg.LONX)+360)
if (max(tsg.LONX)-min(tsg.LONX))>360
tsg.WEST_LONX = -180;
tsg.EAST_LONX = 180;
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment