Newer
Older
gael.alory_legos.obs-mip.fr
committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
function testMissPos(hMainFig)
%
% Test if there are missing lon/lat positions in the TSG time series
% If yes, display Warning message and propose to run Interpolation module
%
% Message only if missing positions can be filled by interpolation
% i.e. surrounded by valid positions
%
% Input
% -----
% hMainFig ............ Handel to the main user interface
%
% Function called by 'OpenMenuCallback' in tqgqc.m
%
% $Id$
% Get the data from the application GUI
% -------------------------------------
tsg = getappdata( hMainFig, 'tsg_data');
% Look for records with Good Latitude/Longitude
% ---------------------------------------------
iGPLat = find( isnan(tsg.LATX) == 0 );
iGPLon = find( isnan(tsg.LONX) == 0 );
% Look for records with No Latitude/Longitude
% -------------------------------------------
iNPLat = find( isnan(tsg.LATX) == 1 );
iNPLon = find( isnan(tsg.LONX) == 1 );
% Test if fillable missing positions
% ----------------------------------
if (~isempty(iNPLat) && ~isempty(iGPLat) && (sum(iNPLat>min(iGPLat) & iNPLat<max(iGPLat))>0))...
| (~isempty(iNPLon) && ~isempty(iGPLon) && (sum(iNPLon>min(iGPLon) & iNPLon<max(iGPLon))>0))
message = { 'WARNING: Missing positions are detected'; ' ';...
'Use the interpolate function to fill them'};
% Display the message box and blocks execution until the msgbox is deleted.
% -------------------------------------------------------------------------
hMsg1 = msgbox(message,'Missing positions','warn', 'modal');
uiwait(hMsg1);
end
% Save tsg structure
% ------------------
setappdata( hMainFig, 'tsg_data', tsg);
end