From 926225a1cf6865e1b499dd4660eff5c396289a34 Mon Sep 17 00:00:00 2001 From: Gael Alory <gael.alory@legos.obs-mip.fr> Date: Mon, 2 Nov 2009 15:25:42 +0000 Subject: [PATCH] gestion de la carte pour les tours du monde --- tsg_util/plot_map.m | 28 +++++++++++++++++++++++----- tsg_util/updateTsgStruct.m | 2 ++ tsgqc.m | 5 +++-- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/tsg_util/plot_map.m b/tsg_util/plot_map.m index f59d3b0..8e0f84d 100644 --- a/tsg_util/plot_map.m +++ b/tsg_util/plot_map.m @@ -47,12 +47,21 @@ if ~isempty( ind ) latRange = (latMax-latMin); latMin = max(min(latMin - 0.05*latRange, latMin - 2), -90); latMax = min(max(latMax + 0.05*latRange, latMax + 2), 90); - if lonMax > (lonMin+360) - lonMax = lonMin+360; - end + lonRange = (lonMax-lonMin); lonMin = min(lonMin - 0.03*lonRange, lonMin -2); lonMax = max(lonMax + 0.03*lonRange, lonMax +2); + + lonRange = (lonMax-lonMin); + if lonRange>=360 + lonMin = -183.6;%to account for fancy frame + lonMax = 183.6; + tsg.lonplus = 180; + tsg.lonmod = 360; + else + tsg.lonplus = 0; + tsg.lonmod = 0; + end % Positionning the right axes % ---------------------------- @@ -121,8 +130,13 @@ if ~isempty( ind ) % ---------------------------------------------- ind = find( tsg.SSPS_QC == qcCode & isnan(tsg.SSPS) == 0); if ~isempty( ind ) - m_line(tsg.LONX(ind),tsg.LATX(ind), 'LineStyle', 'none', 'marker','*',... - 'markersize',2,'color',qcColor); +% if lonRange>=360 + m_line(mod(tsg.LONX(ind)+tsg.lonplus,tsg.lonmod)-tsg.lonplus,tsg.LATX(ind), 'LineStyle', 'none', 'marker','*',... + 'markersize',2,'color',qcColor); +% else +% m_line(tsg.LONX(ind),tsg.LATX(ind), 'LineStyle', 'none', 'marker','*',... +% 'markersize',2,'color',qcColor); +% end end end @@ -134,5 +148,9 @@ if ~isempty( ind ) set(hLines(i), 'Tag', ['TAG_PLOT4_LINE_MAP' int2str(i)]); end + % Save tsg structure + % ------------------ + setappdata( hTsgGUI, 'tsg_data', tsg); + end end diff --git a/tsg_util/updateTsgStruct.m b/tsg_util/updateTsgStruct.m index 0bad867..e975da6 100644 --- a/tsg_util/updateTsgStruct.m +++ b/tsg_util/updateTsgStruct.m @@ -41,6 +41,8 @@ if ~isempty(tsg.indcross) tsg.LONX(tsg.indcross(i)+1:end)=tsg.LONX(tsg.indcross(i)+1:end)-tsg.loncross(i); end end +tsg.lonplus = 0; +tsg.lonmod = 0; % get min and max values for position and set to globals attributes % ----------------------------------------------------------------- diff --git a/tsgqc.m b/tsgqc.m index bd2c125..198c739 100644 --- a/tsgqc.m +++ b/tsgqc.m @@ -2326,10 +2326,11 @@ hrbInterpCancel = uicontrol( ... % Plot a Marker (Red point) on the ship track % ------------------------------------------- - hMarker = m_line( tsg.LONX(indCursor(1)), tsg.LATX(indCursor(1)),... + hMarker = m_line( mod(tsg.LONX(indCursor(1))+tsg.lonplus,tsg.lonmod)-tsg.lonplus,... + tsg.LATX(indCursor(1)),... 'Marker','o','MarkerSize',5, ... 'Color','r', 'MarkerFaceColor','r'); - + % Put a tag on the Marker - This tag allows to get the handle % of the Marker % ----------------------------------------------------------- -- GitLab