-
Notifications
You must be signed in to change notification settings - Fork 1
/
SecondaryFilter.m
73 lines (69 loc) · 1.86 KB
/
SecondaryFilter.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
%densify time series
%written by Steve Coss,5.25.2016
function [VSpack] = SecondaryFilter(RunRiv,Toggle,Slist)
winsize.toggle='varying';%'manual'
winsize.manual=30;
winsize.multiplier=2.75;%2.5 was okay but didnt do much
winsize.NavH=true; %true to use pre average height
%% switches
loadswitch.Qfilter=false;
loadswitch.Qfilterthreshold =.6;
loadswitch.Smooth=true;
loadswitch.ChooseS=false;
loadswitch.SmoothS=1000;
loadswitch.GRRATSONY=false;
loadswitch.CLdir=Toggle.Centerlinedir;
loadswitch.VSdir=Toggle.VSdir;
loadswitch.SF=Toggle.SF;
loadswitch.SatList=Slist;
if Toggle.SF
%% loads up correct VSdata
[VS,CL]=VSloader_SF(RunRiv,loadswitch);%enviVS, JasonVS or merged VS
if ~isempty(VS) && ~isempty(CL);
[RivAlt]=allriverextractor(VS, loadswitch);
[RivAlt]= NormalizeData(RivAlt);
WinSZ=0:0:length(RunRiv);
[RivAlt,WinSZ,SpG]= FlagBad(RivAlt,winsize);
[VSpack] = ALTERVS_SF(VS,RivAlt,winsize,loadswitch);
else
VSpack = [];
%% send out out the Curralt VS only
end
if Toggle.OneAlt
K=0
for i = 1:length(Toggle.CurAlt)
for j = 1:length(VSpack)
if strfind(VSpack(j).VS(1).Satellite,Toggle.CurAlt{i})
VSpackO(K+1).VS=VSpack(j).VS;
K=K+1
end
end
end
if exist('VSpackO','var')
VSpack=VSpackO;
else
VSpack=[];
sprintf(strcat('The_',Toggle.CurAlt{1},'VS on the_',RunRiv,'_do not qualify for secondary filtering'))
end
end
else
[VSpack,~]= VSloader_SF(RunRiv,loadswitch);
if Toggle.OneAlt
K=0
for i = 1:length(Toggle.CurAlt)
for j = 1:length(VSpack)
if strfind(VSpack(j).VS(1).Satellite,Toggle.CurAlt{i})
VSpackO(K+1).VS=VSpack(j).VS;
K=K+1
end
end
end
if exist('VSpackO','var')
VSpack=VSpackO;
else
VSpack=[];
sprintf(strcat('The_',Toggle.CurAlt{1},'VS on the_',RunRiv,'_do not qualify for secondary filtering'))
end
end
end
end