diff --git a/tsg_util/plot_map.m b/tsg_util/plot_map.m index f59d3b01f0d05a9b4c9a4ed13bd5041a5fb41944..8e0f84d71f8e845345854f9d8fd7813f33c3d597 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 0bad867efc5971dcc63049953a1e4b9d472b833c..e975da62d9683d7156fca87b9c04e84f95b0dc3c 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 bd2c1250b237e7178f79919ee7d08a198921d8df..198c7393ef50721ec0220be9e8eb6fa53d99a08a 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 % -----------------------------------------------------------