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
3e2c0c85
Commit
3e2c0c85
authored
17 years ago
by
Yves Gouriou
Browse files
Options
Downloads
Patches
Plain Diff
Développement module d'interpolation des positions
parent
7dcac2c7
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_util/automaticQC.m
+1
-1
1 addition, 1 deletion
tsg_util/automaticQC.m
tsg_util/interpPosLinear.m
+30
-19
30 additions, 19 deletions
tsg_util/interpPosLinear.m
tsg_util/plot_Interpolation.m
+9
-5
9 additions, 5 deletions
tsg_util/plot_Interpolation.m
tsgqc_GUI.m
+54
-5
54 additions, 5 deletions
tsgqc_GUI.m
with
94 additions
and
30 deletions
tsg_util/automaticQC.m
+
1
−
1
View file @
3e2c0c85
...
...
@@ -32,7 +32,7 @@ difDate = diff( tsg.DAYD );
ind
=
find
(
difDate
<
0
)
+
1
;
while
~
isempty
(
ind
)
if
~
isempty
(
tsg
.
DAYD
);
tsg
.
DAYD
(
ind
)
=
[];
end
;
if
~
isempty
(
tsg
.
DATE
);
tsg
.
DATE
(
ind
)
=
[];
end
;
if
~
isempty
(
tsg
.
DATE
);
tsg
.
DATE
(
ind
,
:
)
=
[];
end
;
if
~
isempty
(
tsg
.
LATX
);
tsg
.
LATX
(
ind
)
=
[];
end
;
if
~
isempty
(
tsg
.
LONX
);
tsg
.
LONX
(
ind
)
=
[];
end
;
if
~
isempty
(
tsg
.
SSPS
);
tsg
.
SSPS
(
ind
)
=
[];
end
;
...
...
This diff is collapsed.
Click to expand it.
tsg_util/interpPosLinear.m
+
30
−
19
View file @
3e2c0c85
...
...
@@ -15,38 +15,49 @@ function [error] = interpPosLinear( hMainFig, dateMin, dateMax )
% Get application data
% --------------------
tsg
=
getappdata
(
hMainFig
,
'tsg_data'
);
tsg
=
getappdata
(
hMainFig
,
'tsg_data'
);
% Get INTERPOLATED_VALUE code
% ---------------------------
% Get
NO_CONTROL and
INTERPOLATED_VALUE code
s
% ---------------------------
----------------
NO_CONTROL
=
get
(
tsg
.
qc
.
hash
,
'NO_CONTROL'
,
'code'
);
INTERPOLATED_VALUE
=
get
(
tsg
.
qc
.
hash
,
'INTERPOLATED_VALUE'
,
'code'
);
error
=
1
;
if
dateMax
>
dateMin
%
find the closest point
% ----------------------
i
nd
=
find
(
tsg
.
DAYD
>=
dateMin
&
&
tsg
.
DAYD
<=
dateMax
);
%
Indices of the records to interpolate
% ----------------------
---------------
i
Rec
=
find
(
tsg
.
DAYD
>=
dateMin
&
tsg
.
DAYD
<=
dateMax
);
if
~
isempty
(
i
nd
)
if
~
isempty
(
i
Rec
)
% Look for records with no position
% ---------------------------------
ind2
=
find
(
isnan
(
tsg
.
LATX
(
ind
))
==
1
);
Y
=
interp1
(
tsg
.
DAYD
(
ind
),
tsg
.
LATX
(
ind
),
tsg
.
DAYD
(
ind
(
ind2
))
);
tsg
.
LATX
(
ind
(
ind2
))
=
Y
;
% Look for records with Good Position
% -----------------------------------
iGP
=
find
(
isnan
(
tsg
.
LATX
(
iRec
))
==
0
);
Y
=
interp1
(
tsg
.
DAYD
(
ind
),
tsg
.
LONX
(
ind
),
tsg
.
DAYD
(
ind
(
ind2
))
);
tsg
.
LONX
(
ind
(
ind2
))
=
Y
;
% Look for records with No Position
% -----------------------------------
iNP
=
find
(
isnan
(
tsg
.
LATX
(
iRec
))
==
1
);
if
isempty
(
tsg
.
POSITION_QC
)
tsg
.
POSITION
=
NO_CONTROL
*
ones
(
size
(
tsg
.
DAYD
)
);
if
~
isempty
(
iNP
)
&&
~
isempty
(
iGP
)
Y
=
interp1
(
tsg
.
DAYD
(
iRec
(
iGP
)),
tsg
.
LATX
(
iRec
(
iGP
)),
tsg
.
DAYD
(
iRec
)
);
tsg
.
LATX
(
iRec
(
iNP
))
=
Y
(
iRec
(
iNP
)
-
iRec
(
1
)
+
1
);
Y
=
interp1
(
tsg
.
DAYD
(
iRec
(
iGP
)),
tsg
.
LONX
(
iRec
(
iGP
)),
tsg
.
DAYD
(
iRec
)
);
tsg
.
LONX
(
iRec
(
iNP
))
=
Y
(
iRec
(
iNP
)
-
iRec
(
1
)
+
1
);
if
isempty
(
tsg
.
POSITION_QC
)
tsg
.
POSITION_QC
=
castByteQC
(
NO_CONTROL
,
tsg
.
DAYD
);
end
tsg
.
POSITION_QC
(
iRec
(
iNP
))
=
INTERPOLATED_VALUE
;
end
tsg
.
POSITION_QC
(
ind
(
ind2
))
=
INTERPOLATED_VALUE
;
end
end
% Update tsg application data
% ---------------------------
...
...
This diff is collapsed.
Click to expand it.
tsg_util/plot_Interpolation.m
+
9
−
5
View file @
3e2c0c85
...
...
@@ -22,7 +22,7 @@ switch nPlot
ind
=
find
(
isnan
(
tsg
.
LATX
)
==
1
|
isnan
(
tsg
.
LONX
)
==
1
);
if
~
isempty
(
tsg
.
ssps_smooth
)
plot_Tsg
(
hMainFig
,
hPlotAxes
,
1
,
tsg
.
DAYD
(
ind
),
tsg
.
SSPS
(
ind
),
[],
...
'SSPS_NOPOS'
,
'
r
'
,
'none'
,
'*'
,
2
);
'SSPS_NOPOS'
,
'
b
'
,
'none'
,
'*'
,
2
);
end
ind
=
find
(
isnan
(
tsg
.
LATX
)
==
0
|
isnan
(
tsg
.
LONX
)
==
0
);
...
...
@@ -42,8 +42,10 @@ switch nPlot
end
if
~
isempty
(
tsg
.
POSITION_QC
)
ind
=
find
(
tsg
.
POSITION_QC
==
INTERPOLATED_VALUE
);
plot_Tsg
(
hMainFig
,
hPlotAxes
,
2
,
tsg
.
DAYD
(
ind
),
tsg
.
LATX
(
ind
),[],
...
'LATX_INTERP'
,
'r'
,
'none'
,
'*'
,
2
);
if
~
isempty
(
ind
)
plot_Tsg
(
hMainFig
,
hPlotAxes
,
2
,
tsg
.
DAYD
(
ind
),
tsg
.
LATX
(
ind
),[],
...
'LATX_INTERP'
,
'r'
,
'none'
,
'*'
,
2
);
end
end
% ---------------------------------------------------------------------
...
...
@@ -55,8 +57,10 @@ switch nPlot
end
if
~
isempty
(
tsg
.
POSITION_QC
)
ind
=
find
(
tsg
.
POSITION_QC
==
INTERPOLATED_VALUE
);
plot_Tsg
(
hMainFig
,
hPlotAxes
,
2
,
tsg
.
DAYD
(
ind
),
tsg
.
LONX
(
ind
),[],
...
'LONX_INTERP'
,
'r'
,
'none'
,
'*'
,
2
);
if
~
isempty
(
ind
)
plot_Tsg
(
hMainFig
,
hPlotAxes
,
3
,
tsg
.
DAYD
(
ind
),
tsg
.
LONX
(
ind
),[],
...
'LONX_INTERP'
,
'r'
,
'none'
,
'*'
,
2
);
end
end
end
...
...
This diff is collapsed.
Click to expand it.
tsgqc_GUI.m
+
54
−
5
View file @
3e2c0c85
...
...
@@ -885,13 +885,13 @@ hpInterpPos = uipanel( ...
'Title'
,
'Lat-Lon interpolation'
,
...
'FontSize'
,
tsg
.
fontSize
-
1
,
'Fontweight'
,
'bold'
,
...
'Visible'
,
'off'
,
...
'Units'
,
'normalized'
,
'Position'
,
[
.
0
,
.
8
5
,
.
15
,
.
1
1
]);
'Units'
,
'normalized'
,
'Position'
,
[
.
0
,
.
7
5
,
.
15
,
.
2
1
]);
hrbInterpLinear
=
uicontrol
(
...
'Style'
,
'pushbutton'
,
'Parent'
,
hpInterpPos
,
...
'String'
,
'Linear interpolation'
,
...
'FontSize'
,
tsg
.
fontSize
-
1
,
...
'Tag'
,
'TAG_PUSH_INTERP_LINEAR'
,
...
'Units'
,
'normalized'
,
'pos'
,[
.
05
.
6
.
9
.
3
],
...
'Units'
,
'normalized'
,
'pos'
,[
.
05
.
6
5
.
9
.
25
],
...
'HandleVisibility'
,
'callback'
,
...
'Callback'
,
@
InterpPosLinearCallback
);
hrbInterpOther
=
uicontrol
(
...
...
...
@@ -899,9 +899,17 @@ hrbInterpOther = uicontrol( ...
'String'
,
'Other method'
,
...
'FontSize'
,
tsg
.
fontSize
-
1
,
...
'Tag'
,
'TAG_PUSH_INTERP_OTHER'
,
...
'Units'
,
'normalized'
,
'pos'
,[
.
05
.
1
.
9
.
3
],
...
'Units'
,
'normalized'
,
'pos'
,[
.
05
.
35
.
9
.
25
],
...
'HandleVisibility'
,
'callback'
,
...
'Callback'
,
@
InterpPosOtherCallback
);
hrbInterpCancel
=
uicontrol
(
...
'Style'
,
'pushbutton'
,
'Parent'
,
hpInterpPos
,
...
'String'
,
'Cancel interpolation'
,
...
'FontSize'
,
tsg
.
fontSize
-
1
,
...
'Tag'
,
'TAG_PUSH_INTERP_CANCEL'
,
...
'Units'
,
'normalized'
,
'pos'
,[
.
05
.
05
.
9
.
25
],
...
'HandleVisibility'
,
'callback'
,
...
'Callback'
,
@
InterpPosCancelCallback
);
%% test if user preference autoload field is checked (on)
...
...
@@ -1120,8 +1128,7 @@ end
% Callback function run when
%
function
Inter_OnMenuCallback
(
hObject
,
eventdata
)
% Activate or desactivate uipanels
% --------------------------------
set
(
hpCalCoef
,
'Visible'
,
'off'
);
...
...
@@ -1174,6 +1181,10 @@ end
plot_Validation
(
hMainFig
,
hPlotAxes
,
2
);
plot_Validation
(
hMainFig
,
hPlotAxes
,
3
);
% Set the pointer
% ---------------
set
(
hMainFig
,
'Pointer'
,
'arrow'
);
end
%% InterpLinearCallback ...............................Interpolation Linear
...
...
@@ -1218,6 +1229,40 @@ end
'modal'
);
end
%% InterpPosCancelCallback ..........................Cancel Interpolation
%----------------------------------------------------------------------
function
InterpPosCancelCallback
(
hObject
,
eventdata
)
% Callback function run when
% Get tsg application data
% ------------------------
tsg
=
getappdata
(
hMainFig
,
'tsg_data'
);
% Get NO_CONTROL and INTERPOLATED_VALUE codes
% -------------------------------------------
NO_CONTROL
=
get
(
tsg
.
qc
.
hash
,
'NO_CONTROL'
,
'code'
);
INTERPOLATED_VALUE
=
get
(
tsg
.
qc
.
hash
,
'INTERPOLATED_VALUE'
,
'code'
);
if
~
isempty
(
tsg
.
POSITION_QC
)
iINTERP
=
find
(
tsg
.
POSITION_QC
==
INTERPOLATED_VALUE
);
tsg
.
LATX
(
iINTERP
)
=
NaN
*
ones
(
size
(
iINTERP
),
1
);
tsg
.
LONX
(
iINTERP
)
=
NaN
*
ones
(
size
(
iINTERP
),
1
);
tsg
.
POSITION_QC
=
[];
end
% Save tsg application data
% --------------------------
setappdata
(
hMainFig
,
'tsg_data'
,
tsg
);
% Refresh plots
% -------------
plot_Interpolation
(
hMainFig
,
hPlotAxes
,
1
);
plot_Interpolation
(
hMainFig
,
hPlotAxes
,
2
);
plot_Interpolation
(
hMainFig
,
hPlotAxes
,
3
);
end
%% Cal_OnMenuCallback ..................................... Calibration
%----------------------------------------------------------------------
% Callback function run when
...
...
@@ -2040,6 +2085,10 @@ end
plot_Validation
(
hMainFig
,
hPlotAxes
,
2
);
plot_Validation
(
hMainFig
,
hPlotAxes
,
3
);
end
% Set the pointer
% ---------------
set
(
hMainFig
,
'Pointer'
,
'arrow'
);
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