diff --git a/tsg_util/plot_map.m b/tsg_util/plot_map.m index 33922e4f8a4b29e5ba5d868b17b25c341813e480..cd7ec462f43f0adaccd54814475c3004b2a4de85 100644 --- a/tsg_util/plot_map.m +++ b/tsg_util/plot_map.m @@ -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 % ---------------------------- diff --git a/tsg_util/updateTsgStruct.m b/tsg_util/updateTsgStruct.m index c104410b056f3abd15778e58012c8771539ea606..0bad867efc5971dcc63049953a1e4b9d472b833c 100644 --- a/tsg_util/updateTsgStruct.m +++ b/tsg_util/updateTsgStruct.m @@ -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