forked from gabrielapilo/ArgoRealTimeSource
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcullInitialMission.m
executable file
·97 lines (71 loc) · 2.61 KB
/
cullInitialMission.m
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
% cullInitialMissions
%
% for floats where the mission is contained in the log files, the first
% mission must be obtained from the .000.log file which is not usually
% read. You must ensure that htis file is in the iridium_processed
% directory.
%
% this script uses the data from cullMissions_iridium and only obtains the
% data from the 000 file.
%
% coded Feb 2014 : AT
%
global ARGO_SYS_PARAM
global ARGO_ID_CROSSREF
aic=ARGO_ID_CROSSREF;
kk=find(aic(:,1)==wmo_id);
fn= [ARGO_SYS_PARAM.root_dir 'matfiles/float' num2str(wmo_id) 'aux.mat']
if (aic(kk,2)<1000)
fnm000=[ARGO_SYS_PARAM.root_dir 'iridium_data/iridium_processed/000files/0' num2str(aic(kk,2)) '.000.log']
else
fnm000=[ARGO_SYS_PARAM.root_dir 'iridium_data/iridium_processed/000files/' num2str(aic(kk,2)) '.000.log']
end
% fnm{k}(end-2:end)='log';
% fnm000=fnm{k};
% fnm000(end-6:end-4)='000';
% fnm000=fnm;
% fclose(fid)
fid2=fopen(fnm000);
if fid2 < 0
logerr(3,['Cant find 000 file: ' fnm000]);
return
end
floatTech=[];
% fn= [ARGO_SYS_PARAM.root_dir 'matfiles/float' num2str(wmo_id) 'aux.mat']
l=fgetl(fid2);
while(l~=-1)
config=strfind(l,'LogConfiguration');
if ~isempty(config)
l=strtrim(l(config+20:end));
par=strfind(l,'(');
par2=strfind(l,')');
if ~isempty(par)
if strfind(l,'TimeOf')
mn=['ms.' l(1:par-1) '= ''' l(par+1:par2-1) ''';'];
eval(mn);
elseif strfind(l,'Debug')
mn=['ms.' l(1:par-1) '= ''' l(par+1:par2-1) ''';'];
eval(mn);
elseif strfind(l,'IceMonths')
mn=['ms.' l(1:par-1) '= ''' l(par+1:par2-1) ''';'];
eval(mn);
elseif isempty(strfind(l,'AtD')) & isempty(strfind(l,'AltD')) & isempty(strfind(l,'FloatId')) & ...
isempty(strfind(l,'Verbo')) & isempty(strfind(l,'Full')) & isempty(strfind(l,'PActiv')) & ...
isempty(strfind(l,'Max')) & isempty(strfind(l,'Mission')) & isempty(strfind(l,'OkV')) & ...
isempty(strfind(l,'User')) & isempty(strfind(l,'Pwd')) & ...
isempty(strfind(l,'Flbb')) & isempty(strfind(l,'Compens'))
mn=['ms.' l(1:par-1) '=' l(par+1:par2-1) ';'];
eval(mn);
end
end
end
l=fgetl(fid2);
end
fclose(fid2);
% This is by definition mission 1
ms.mission_number = 1;
ms.new_mission = 1;
if ~isempty(ms)
floatTech.Mission(1)=ms;
end
save (fn,'floatTech','-v6');