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
c4afc0c4
Commit
c4afc0c4
authored
17 years ago
by
jacques.grelet_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
propose le nom du fichier d'origine avec l'extension .nc lors de la sauvegarde
parent
61ef25d6
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
tsg_io/readTsgDataNetCDF.m
+5
-1
5 additions, 1 deletion
tsg_io/readTsgDataNetCDF.m
tsg_io/readTsgDataTxt.m
+4
-6
4 additions, 6 deletions
tsg_io/readTsgDataTxt.m
tsg_io/readTsgDataXML.m
+6
-1
6 additions, 1 deletion
tsg_io/readTsgDataXML.m
tsgqc_GUI.m
+25
-14
25 additions, 14 deletions
tsgqc_GUI.m
with
40 additions
and
22 deletions
tsg_io/readTsgDataNetCDF.m
+
5
−
1
View file @
c4afc0c4
...
@@ -38,9 +38,13 @@ end
...
@@ -38,9 +38,13 @@ end
% --------------------------------------------
% --------------------------------------------
fprintf
(
'...reading %s : '
,
filename
);
fprintf
(
'...reading %s : '
,
filename
);
% populate tsg.file structure
% ---------------------------
tsg
.
file
.
name
=
filename
;
tsg
.
file
.
type
=
'NETCDF'
;
% Read global attributes: meta data
% Read global attributes: meta data
% ----------------------------------
% ----------------------------------
tsg
.
PLATFORM_NAME
=
nc
.
PLATFORM_NAME
(:);
tsg
.
PLATFORM_NAME
=
nc
.
PLATFORM_NAME
(:);
tsg
.
SHIP_CALL_SIGN
=
nc
.
SHIP_CALL_SIGN
(:);
tsg
.
SHIP_CALL_SIGN
=
nc
.
SHIP_CALL_SIGN
(:);
tsg
.
SHIP_MMSI
=
nc
.
SHIP_MMSI
(:);
tsg
.
SHIP_MMSI
=
nc
.
SHIP_MMSI
(:);
...
...
This diff is collapsed.
Click to expand it.
tsg_io/readTsgDataTxt.m
+
4
−
6
View file @
c4afc0c4
...
@@ -55,12 +55,6 @@ tsg.DAYD = datenum(tsgData(:,3), tsgData(:,2),tsgData(:,1), ...
...
@@ -55,12 +55,6 @@ tsg.DAYD = datenum(tsgData(:,3), tsgData(:,2),tsgData(:,1), ...
% save original date
% save original date
% ------------------
% ------------------
tsg
.
DATE
=
datestr
(
tsg
.
DAYD
,
'yyyymmddHHMMSS'
);
tsg
.
DATE
=
datestr
(
tsg
.
DAYD
,
'yyyymmddHHMMSS'
);
% convert with julian day with origin 1950
% -----------------------------------------
%% a supprimer !!!!!!!
% tsg.TIME_TSG = datenumToJulian(tsg.TIME_TSG);
tsg
.
LATX
=
tsgData
(:,
7
);
tsg
.
LATX
=
tsgData
(:,
7
);
tsg
.
LONX
=
tsgData
(:,
8
);
tsg
.
LONX
=
tsgData
(:,
8
);
tsg
.
SSJT
=
tsgData
(:,
9
);
tsg
.
SSJT
=
tsgData
(:,
9
);
...
@@ -83,6 +77,10 @@ if isempty(tsg.SPDC)
...
@@ -83,6 +77,10 @@ if isempty(tsg.SPDC)
tsg
.
SPDC
=
[
tsg
.
SPDC
'
;
0
];
tsg
.
SPDC
=
[
tsg
.
SPDC
'
;
0
];
end
end
% populate tsg.file structure
% ---------------------------
tsg
.
file
.
name
=
filename
;
tsg
.
file
.
type
=
'ASCII'
;
% Save the data in the application GUI
% Save the data in the application GUI
% ------------------------------------
% ------------------------------------
...
...
This diff is collapsed.
Click to expand it.
tsg_io/readTsgDataXML.m
+
6
−
1
View file @
c4afc0c4
...
@@ -39,7 +39,12 @@ if fid ~= -1
...
@@ -39,7 +39,12 @@ if fid ~= -1
% tsg.PSAL_QC = tsgData(:,11);
% tsg.PSAL_QC = tsgData(:,11);
% tsg.PSAL_ADJ = tsgData(:,12);
% tsg.PSAL_ADJ = tsgData(:,12);
% tsg.PSAL_ERR = tsgData(:,13);
% tsg.PSAL_ERR = tsgData(:,13);
%
% % populate tsg.file structure
% % ---------------------------
% tsg.file.name = filename;
% tsg.file.type = 'XML';
%
% % Save the data in the application GUI
% % Save the data in the application GUI
% % ------------------------------------
% % ------------------------------------
% setappdata( hTsgGUI, 'tsg_data', tsg );
% setappdata( hTsgGUI, 'tsg_data', tsg );
...
...
This diff is collapsed.
Click to expand it.
tsgqc_GUI.m
+
25
−
14
View file @
c4afc0c4
...
@@ -443,34 +443,34 @@ tsg_initialisation(hMainFig, hQcCmenu)
...
@@ -443,34 +443,34 @@ tsg_initialisation(hMainFig, hQcCmenu)
% ------------------------------------------------
% ------------------------------------------------
set
(
hMainFig
,
'Pointer'
,
'watch'
);
set
(
hMainFig
,
'Pointer'
,
'watch'
);
% Make the file
n
ame
% Make the file
N
ame
% ATTENTION : function OpenMenuCallback(hObject, eventdata)
% ATTENTION : function OpenMenuCallback(hObject, eventdata)
% This has to be made general for UNIX and WINDOWS system
% This has to be made general for UNIX and WINDOWS system
% ---------------------------------------------------------
% ---------------------------------------------------------
[
file
n
ame
,
pathname
,
filterIndex
]
=
uigetfile
(
...
[
file
N
ame
,
pathname
,
filterIndex
]
=
uigetfile
(
...
{
'*.txt'
;
'*.xml'
;
'*.nc'
;
'*.btl'
},
'Pick a file'
);
{
'*.txt'
;
'*.xml'
;
'*.nc'
;
'*.btl'
},
'Pick a file'
);
error1
=
-
1
;
error1
=
-
1
;
error2
=
-
1
;
error2
=
-
1
;
if
~
isequal
(
file
n
ame
,
0
)
if
~
isequal
(
file
N
ame
,
0
)
% Read the data
% Read the data
% -------------
% -------------
switch
filterIndex
switch
filterIndex
case
1
case
1
error1
=
readTsgDataTxt
(
hMainFig
,
file
n
ame
);
error1
=
readTsgDataTxt
(
hMainFig
,
file
N
ame
);
case
2
case
2
error1
=
readTsgDataXML
(
hMainFig
,
file
n
ame
);
error1
=
readTsgDataXML
(
hMainFig
,
file
N
ame
);
case
3
case
3
error1
=
readTsgDataNetCDF
(
hMainFig
,
file
n
ame
);
error1
=
readTsgDataNetCDF
(
hMainFig
,
file
N
ame
);
%# a modifier
%# a modifier
if
error1
==
1
if
error1
==
1
error2
=
error1
;
error2
=
error1
;
end
end
case
4
case
4
error2
=
readBucketData
(
hMainFig
,
file
n
ame
);
error2
=
readBucketData
(
hMainFig
,
file
N
ame
);
otherwise
otherwise
return
;
return
;
...
@@ -488,7 +488,7 @@ tsg_initialisation(hMainFig, hQcCmenu)
...
@@ -488,7 +488,7 @@ tsg_initialisation(hMainFig, hQcCmenu)
% update the display
% update the display
% ------------------
% ------------------
set
(
hInfoFileText
,
'String'
,
file
n
ame
);
set
(
hInfoFileText
,
'String'
,
file
N
ame
);
% The callback to detect the mouse motion can be set to on
% The callback to detect the mouse motion can be set to on
% --------------------------------------------------------
% --------------------------------------------------------
...
@@ -791,8 +791,8 @@ tsg_initialisation(hMainFig, hQcCmenu)
...
@@ -791,8 +791,8 @@ tsg_initialisation(hMainFig, hQcCmenu)
% -----------------------------------------------------------
% -----------------------------------------------------------
[
x
,
y
]
=
gpos
(
hPlotAxes
(
1
));
[
x
,
y
]
=
gpos
(
hPlotAxes
(
1
));
% Dynamically diplay data in uicontrol
% Dynamically di
s
play data in uicontrol
% ------------------------------------
% ------------------------------------
-
if
x
>
tsg
.
DAYD
(
1
)
&&
x
<
tsg
.
DAYD
(
end
)
if
x
>
tsg
.
DAYD
(
1
)
&&
x
<
tsg
.
DAYD
(
end
)
indCursor
=
find
(
tsg
.
DAYD
>
x
);
indCursor
=
find
(
tsg
.
DAYD
>
x
);
set
(
hInfoDateText
,
'String'
,
...
set
(
hInfoDateText
,
'String'
,
...
...
@@ -1060,6 +1060,14 @@ tsg_initialisation(hMainFig, hQcCmenu)
...
@@ -1060,6 +1060,14 @@ tsg_initialisation(hMainFig, hQcCmenu)
% -------------------------------------------------------------------
% -------------------------------------------------------------------
function
SaveMenuCallback
(
hObject
,
eventdata
)
function
SaveMenuCallback
(
hObject
,
eventdata
)
% Callback function run when the Save menu item is selected
% Callback function run when the Save menu item is selected
% Retrieve named application data
% -------------------------------
tsg
=
getappdata
(
hMainFig
,
'tsg_data'
);
% get fileName without extension in cell
% --------------------------------------
file
=
textscan
(
tsg
.
file
.
name
,
'%s'
,
'delimiter'
,
'.'
);
% fill or append header form
% fill or append header form
% -------------------------
% -------------------------
...
@@ -1069,7 +1077,7 @@ tsg_initialisation(hMainFig, hQcCmenu)
...
@@ -1069,7 +1077,7 @@ tsg_initialisation(hMainFig, hQcCmenu)
% ------------------------------------------------
% ------------------------------------------------
if
error
~=
-
1
if
error
~=
-
1
[
fileName
,
pathName
,
filterIndex
]
=
uiputfile
(
'*.nc'
,
...
[
fileName
,
pathName
,
filterIndex
]
=
uiputfile
(
'*.nc'
,
...
'Save file name'
);
'Save file name'
,
[
file
{
1
}{
1
}
'.nc'
]
);
% if user press cancel button, all var set to zero
% if user press cancel button, all var set to zero
% ------------------------------------------------
% ------------------------------------------------
...
@@ -1087,8 +1095,7 @@ tsg_initialisation(hMainFig, hQcCmenu)
...
@@ -1087,8 +1095,7 @@ tsg_initialisation(hMainFig, hQcCmenu)
% write netcdf file
% write netcdf file
% -----------------
% -----------------
fileName
=
[
pathName
fileName
];
error
=
writeTSGDataNetCDF
(
hMainFig
,
[
pathName
fileName
]
);
error
=
writeTSGDataNetCDF
(
hMainFig
,
fileName
);
% Pointer reset to arrow
% Pointer reset to arrow
% ----------------------
% ----------------------
...
@@ -1098,8 +1105,12 @@ tsg_initialisation(hMainFig, hQcCmenu)
...
@@ -1098,8 +1105,12 @@ tsg_initialisation(hMainFig, hQcCmenu)
% must to be rewriting
% must to be rewriting
% --------------------------------
% --------------------------------
if
error
==
-
1
if
error
==
-
1
warning
([
'NetCDF writing error:'
fileName
]);
warning
([
'NetCDF writing error:'
[
pathName
fileName
]
]
);
end
end
% update the display
% ------------------
set
(
hInfoFileText
,
'String'
,
fileName
);
end
end
end
end
...
...
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