Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TSG QC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
US191
TSG QC
Commits
8d9248ba
Commit
8d9248ba
authored
6 years ago
by
jacques.grelet_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
add print/saveas menu on map with jpeg, png and epsc format
parent
5b1e87a7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
ReleaseNotes
+2
-1
2 additions, 1 deletion
ReleaseNotes
tsg_util/plot_map.m
+9
-3
9 additions, 3 deletions
tsg_util/plot_map.m
tsg_util/tsg_preferences.m
+1
-1
1 addition, 1 deletion
tsg_util/tsg_preferences.m
tsgqc.m
+59
-52
59 additions, 52 deletions
tsgqc.m
with
71 additions
and
57 deletions
ReleaseNotes
+
2
−
1
View file @
8d9248ba
TSG-QC Release notes
Contact: jacques.grelet@ird.fr
v1.48.5rc
3
(2018-09-12)
v1.48.5rc
4
(2018-09-12)
+ add 'debug' command line argument option
+ remove tsg_icon from matlabpath at the end of program tsgqc
+ swap and improve error message in read_Climatology function
...
...
@@ -9,6 +9,7 @@ v1.48.5rc3 (2018-09-12)
+ remove/comment set(hAxes(PlotNum), 'YLimMode', 'auto'); in plot_Tsg.m
+ add print preview and print menu command on map
+ add hypertext link in Command Window to download climatology file when is missing
+ add print/saveas menu on map with jpeg, png and epsc format
v1.48.5rc2 (2018-09-06)
+ regression on labview read file: the use of lat_dec and lon_dec by default
...
...
This diff is collapsed.
Click to expand it.
tsg_util/plot_map.m
+
9
−
3
View file @
8d9248ba
...
...
@@ -98,7 +98,11 @@ if ~isempty( ind )
% plot climatology mean contour if available
% ------------------------------------------
hdl
=
findobj
(
'-regexp'
,
'tag'
,
'PUSHTOOL_CLIM'
);
if
strcmp
(
get
(
hdl
,
'state'
),
'on'
)
% plot climato on map only when the main pushtool button climato is
% selected
% -----------------------------------------------------------------
if
strcmp
(
get
(
hdl
,
'state'
),
'on'
)
climato
=
tsg
.
levitus
.
data
.
([
'WOA_MEAN_'
tsg
.
plot
.
sample
]);
% get last selected climatology structure
s
=
get
(
findobj
(
'Tag'
,
'TAG_UIMENU_CLIMATO_MAIN'
),
'Userdata'
);
...
...
@@ -124,7 +128,7 @@ if ~isempty( ind )
lat
=
LATX
(
indLat
);
% plot 2D climatogogy on map
if
tsg
.
preference
.
map_climatology
if
strcmp
(
tsg
.
preference
.
map_climatology
,
'on'
)
m_pcolor
(
lon
,
lat
,
climato
(
indLat
,
indLon
));
shading
flat
;
%colormap(m_colmap('jet','step',10));
...
...
@@ -132,6 +136,8 @@ if ~isempty( ind )
else
colorbar
(
'off'
);
end
else
colorbar
(
'off'
);
end
% select map type and resolution
...
...
@@ -254,7 +260,7 @@ if ~isempty( ind )
% Write title
% -----------
if
tsg
.
preference
.
map_climatology
% if climato selected on 2D map
if
strcmp
(
tsg
.
preference
.
map_climatology
,
'on'
)
% if climato selected on 2D map
climato_title
=
sprintf
(
' - climatology: %s %s'
,
tsg
.
levitus
.
version
,
...
tsg
.
levitus
.
type
);
else
...
...
This diff is collapsed.
Click to expand it.
tsg_util/tsg_preferences.m
+
1
−
1
View file @
8d9248ba
...
...
@@ -169,7 +169,7 @@ return
preference
.
map_border_string
=
{
'0'
,
'1'
,
'2'
,
'5'
,
'10'
,
'15'
};
preference
.
map_border_value
=
4
;
preference
.
map_border
=
5
;
% default
preference
.
map_climatology
=
0
;
preference
.
map_climatology
=
'off'
;
preference
.
plot_connected_string
=
{
'none'
,
'-'
,
'--'
,
':'
,
'-.'
};
preference
.
plot_connected_value
=
1
;
% 0, line not connected
% QC test
...
...
This diff is collapsed.
Click to expand it.
tsgqc.m
+
59
−
52
View file @
8d9248ba
...
...
@@ -44,7 +44,7 @@ global DEBUGGING
%
0.90
x
->
1.0
RCx
%
-------------------------------------------------------------------
VERSION
=
1.485
;
%
->
1.44
CHAR
_
VERSION
=
'
1.48.5
RC
3
';
CHAR
_
VERSION
=
'
1.48.5
RC
4
';
DATE
_
VERSION
=
'
10
/
09
/
2018
';
%
netcdf
file
version
,
see
DATA
FORMAT
TSG
document
:
...
...
@@ -801,6 +801,32 @@ uimenu(hMapResolutionMenu,'Label','High',...
hdl
=
flipud
(
findobj
(
'-
regexp
',
'
tag
',
'
TAG
_
UIMENU
_
MAP
_
RESOLUTION
_'
))
;
set
(
hdl
(
tsg
.
preference
.
map
_
resolution
)
,
'
checked
',
'
on
'
)
;
%
display
map
Type
menu
%
---------------------
hMapPatchMenu
=
uimenu
(
hMapFig
,'
Label
','
Type
',
...
'
Tag
',
'
TAG
_
UIMENU
_
MAP
_
PATCH
'
)
;
%
preset
map
patch
menu
from
preference
if
tsg
.
preference
.
map
_
patch
_
value
==
2
chk
_
with
_
patch
=
'
on
';
chk
_
without
_
patch
=
'
off
';
else
chk
_
with
_
patch
=
'
off
';
chk
_
without
_
patch
=
'
on
';
end
uimenu
(
hMapPatchMenu
,'
Label
','
Map
without
patch
(
faster
)
',...
'
Checked
',
chk
_
without
_
patch
,...
'
Tag
','
TAG
_
UIMENU
_
MAP
_
WITHOUT
_
PATCH
',...
'
Enable
',
'
on
',...
'
Callback
',
{
@
mapPatchMenuCallback
,
0
})
;
uimenu
(
hMapPatchMenu
,'
Label
','
Map
with
patch
(
slower
)
',...
'
Checked
',
chk
_
with
_
patch
,...
'
Tag
','
TAG
_
UIMENU
_
MAP
_
WITH
_
PATCH
',...
'
Enable
',
'
on
',...
'
Callback
',
{
@
mapPatchMenuCallback
,
1
})
;
%
display
map
Border
menu
%
------------------------
hMapBorderMenu
=
uimenu
(
...
...
...
@@ -849,57 +875,16 @@ uimenu(hMapBorderMenu,'Label','15',...
hdl
=
flipud
(
findobj
(
'-
regexp
',
'
tag
',
'
TAG
_
UIMENU
_
MAP
_
BORDER
_'
))
;
set
(
hdl
(
tsg
.
preference
.
map
_
border
_
value
)
,
'
checked
',
'
on
'
)
;
%
map
Type
menu
%
--------------
hMapPatchMenu
=
uimenu
(
hMapFig
,'
Label
','
Type
',
...
'
Tag
',
'
TAG
_
UIMENU
_
MAP
_
PATCH
'
)
;
%
preset
map
patch
menu
from
preference
if
tsg
.
preference
.
map
_
patch
_
value
==
2
chk
_
with
_
patch
=
'
on
';
chk
_
without
_
patch
=
'
off
';
else
chk
_
with
_
patch
=
'
off
';
chk
_
without
_
patch
=
'
on
';
end
uimenu
(
hMapPatchMenu
,'
Label
','
Map
without
patch
(
faster
)
',...
'
Checked
',
chk
_
without
_
patch
,...
'
Tag
','
TAG
_
UIMENU
_
MAP
_
WITHOUT
_
PATCH
',...
'
Enable
',
'
on
',...
'
Callback
',
{
@
mapPatchMenuCallback
,
0
})
;
uimenu
(
hMapPatchMenu
,'
Label
','
Map
with
patch
(
slower
)
',...
'
Checked
',
chk
_
with
_
patch
,...
'
Tag
','
TAG
_
UIMENU
_
MAP
_
WITH
_
PATCH
',...
'
Enable
',
'
on
',...
'
Callback
',
{
@
mapPatchMenuCallback
,
1
})
;
%
map
Climatology
menu
%
--------------------
hMapClimatologyMenu
=
uimenu
(
hMapFig
,'
Label
','
Climatology
',
...
'
Tag
',
'
TAG
_
UIMENU
_
MAP
_
CLIMATOLOGY
'
)
;
%
preset
map
climatology
menu
from
preference
if
tsg
.
preference
.
map
_
climatology
==
1
chk
_
with
_
climatology
=
'
on
';
chk
_
without
_
climatology
=
'
off
';
else
chk
_
with
_
climatology
=
'
off
';
chk
_
without
_
climatology
=
'
on
';
end
uimenu
(
hMapClimatologyMenu
,'
Label
','
Map
with
surface
climatology
',...
'
Checked
',
chk
_
with
_
climatology
,...
'
Checked
',
tsg
.
preference
.
map
_
climatology
,...
'
Tag
','
TAG
_
UIMENU
_
MAP
_
CLIMATOLOGY
_
WITH
',...
'
Enable
',
'
on
',...
'
Callback
',
{
@
mapClimatologyCallback
,
1
})
;
%
uimenu
(
hMapClimatologyMenu
,'
Label
','
Map
without
surface
climatology
',...
%
'
Checked
',
chk
_
without
_
climatology
,...
%
'
Tag
','
TAG
_
UIMENU
_
MAP
_
CLIMATOLOGY
_
WITHOUT
',...
%
'
Enable
',
'
on
',...
%
'
Callback
',
{
@
mapClimatologyCallback
,
0
})
;
'
Callback
',
{
@
mapClimatologyCallback
})
;
%
map
Print
menu
%
--------------------
...
...
@@ -915,6 +900,10 @@ uimenu(hMapPrintMenu,'Label','Print',...
'
Accelerator
','
P
',...
'
Callback
',
{
@
mapPrintCallback
})
;
uimenu
(
hMapPrintMenu
,'
Label
','
Save
as
',...
'
Tag
','
TAG
_
UIMENU
_
MAP
_
PRINT
_
SAVEAS
',...
'
Callback
',
{
@
mapSaveAsCallback
})
;
%
set
map
axes
%
------------
hPlotAxes
(
4
)
=
axes
(
...
%
the
axes
for
plotting
ship
track
map
...
...
@@ -3712,7 +3701,7 @@ end
end
%
%
function
mapDynaBorderCallback
%
function
mapDynaBorderCallback
%
--------------------------------
function
mapDynaBorderCallback
(
src
,
evnt
,
border
)
...
...
@@ -3731,21 +3720,32 @@ end
plot
_
map
(
hMainFig
,
hPlotAxes
)
;
end
%
display
2
D
climatology
on
map
if
pushbutton
climato
is
on
%
---------------------------------------------------------
function
mapClimatologyCallback
(
src
,
evnt
,
climato
)
hdl
=
findobj
(
'-
regexp
',
'
tag
',
'
TAG
_
UIMENU
_
MAP
_
CLIMATOLOGY
_'
)
;
set
(
hdl
,
'
Checked
',
'
off
'
)
;
set
(
src
,
'
Checked
',
'
on
'
)
;
if
strcmp
(
get
(
src
,
'
checked
'
)
,
'
on
'
)
set
(
src
,
'
checked
',
'
off
'
)
tsg
.
preference
.
map
_
climatology
=
'
off
';
elseif
strcmp
(
get
(
hClimToggletool
,
'
state
'
)
,
'
on
'
)
set
(
src
,
'
Checked
',
'
on
'
)
;
%
change
the
map
2
D
climatology
from
menu
on
map
%
--------------------------------------
tsg
.
preference
.
map
_
climatology
=
'
on
';
else
set
(
src
,
'
Checked
',
'
off
'
)
;
end
%
change
the
map
2
D
climatology
from
menu
on
map
%
--------------------------------------
tsg
.
preference
.
map
_
climatology
=
climato
;
%
save
tsg
.
preference
.
map
_
climatology
%
-----------------------------------
setappdata
(
hMainFig
,
'
tsg
_
data
',
tsg
)
;
%
redraw
map
%
------------------------------------------
erase
_
Line
(
hPlotAxes
,
4
)
;
plot
_
map
(
hMainFig
,
hPlotAxes
)
;
end
%
print
map
figure
from
menu
...
...
@@ -3754,10 +3754,17 @@ end
printdlg
(
get
(
hPlotAxes
(
4
)
,'
parent
'
))
;
end
function
mapPrintPreviewCallback
(
src
,
evnt
)
function
mapPrintPreviewCallback
(
src
,
evnt
)
printpreview
(
get
(
hPlotAxes
(
4
)
,'
parent
'
))
;
end
function
mapSaveAsCallback
(
src
,
evnt
)
[
file
,
path
]
=
uiputfile
({
'*.
jpeg
';'*.
png
';'*.
epsc
'
})
;
saveas
(
get
(
hPlotAxes
(
4
)
,'
parent
'
)
,
fullfile
(
path
,
file
))
;
fprintf
(
1
,
'
Save
figure
map
as
%
s
\
n
',
fullfile
(
path
,
file
))
;
end
%%
HeaderMenuCallback
%
-------------------------------------------------------------------
%
Callback
function
run
when
the
headerForm
tool
bar
item
is
selected
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment