-
Notifications
You must be signed in to change notification settings - Fork 3
/
Data2Storadar.m
98 lines (86 loc) · 2.28 KB
/
Data2Storadar.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
96
97
98
function Data2Storadar(Data,Time,Latitude,Longitude,outputfile,elev,datatype,x_coord,y_coord)
% (C) Nick Holschuh - University of Washington - 2016 ([email protected])
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The inputs are:
%
% ________ -
% ________ -
% ________ -
% ________ -
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The outputs are:
%
% ________ -
% ________ -
% ________ -
% ________ -
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The Dependencies are:
%
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if exist('datatype') == 0
datatype = 0;
end
if exist('elev') == 0
elev = [];
end
if datatype == 0
datavar = 'migdata';
suffix = '_mig';
elseif datatype == 1
datavar = 'interp_data';
suffix = '_interp';
end
% The variables this needs are:
% Data
% Time
% Elevation
% Latitude
% Longitude
startdepth=1;
lp_flag = 0;
ch_proc = 99;
chan = 2;
chdat = 10;
decday = ones(length(Data(1,:)),1)*datenum(date);
if exist('Latitude') == 1 & exist('x_coord') == 0
[x_coord y_coord] = polarstereo_fwd(Latitude,Longitude);
end
dist = distance_vector(x_coord,y_coord,0);
dist = 1:(length(Data(1,:))-startdepth+1);
dt = Time(2) - Time(1);
if length(elev) == 0
elev = zeros(length(dist));
end
elev_tide = zeros(1,length(elev));
lat = Latitude;
long = Longitude;
if lp_flag == 0
eval_str = [datavar,' = Data(startdepth:length(Data(:,1)),:);'];
else
eval_str = [datavar,' = lp(Data(startdepth:length(Data(:,1)),:));'];
end
eval(eval_str)
pressure = 0;
procmenu = 0;
snum = length(Data(:,1))-startdepth+1;
tnum = length(Data(1,:));
tr_dx = 1;
trace_int = 1;
trace_num = 1:tnum;
travel_time = Time;
trigval = find_nearest(Time,0);
trig = ones(1,tnum)*trigval;
trig_level = ones(1,tnum);
uice = 169;
predist = dist;
sddev_dist = std(dist);
avg_dist = mean(dist);
savestring = ['save ',outputfile,suffix,'.mat avg_dist ch_proc chan chdat datavar decday dist dt elev elev_tide lat long ',datavar,' predist pressure procmenu sddev_dist snum tnum tr_dx trace_int trace_num travel_time trig trig_level uice x_coord y_coord'];
eval(savestring)
end