-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprune_by_eddy_track_threshold.m
73 lines (66 loc) · 2.77 KB
/
prune_by_eddy_track_threshold.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
t = cputime;
%num_removed = 0;
e_track_length_thresh = 2;
%results = zeros(60819,1);
for i = 53790 : size(IBTrACS_eddies_1992_2010_v1_2,1)
iso_date = datevec(cellstr(IBTrACS_eddies_1992_2010_v1_2(i,5)));
year = iso_date(1);
month = iso_date(2);
day = iso_date(3);
year_str = num2str(year);
month_str = num2str(month);
day_str = num2str(day);
track_time_slice = findTimeSlice(year_str, month_str, day_str);
track_time_slice = str2double(track_time_slice);
j = find(double(eddy_track_date_indices(:,1)) == ...
track_time_slice);
track = NaN;
found = 0;
if(double(IBTrACS_eddies_1992_2010_v1_2(i,17)) == -1)
track_set = bu_cyclonic_tracks;
track_date_idx_start = 4;
track_date_idx_end = 5;
elseif(double(IBTrACS_eddies_1992_2010_v1_2(i,17)) == 1)
track_set = bu_anticyc_tracks;
track_date_idx_start = 2;
track_date_idx_end = 3;
end
if(~isnan(double(IBTrACS_eddies_1992_2010_v1_2(i,17))))
for k = double(eddy_track_date_indices(j,track_date_idx_start)) : ...
double(eddy_track_date_indices(j,track_date_idx_end))
temp_track = cell2mat(track_set(k));
for l = 1 : size(temp_track,1)
if(temp_track(l,3) == j && temp_track(l,4) == double(IBTrACS_eddies_1992_2010_v1_2(i,22)))
track = temp_track;
found = 1;
break
end
end
if(found)
% if(size(temp_track,1) < e_track_length_thresh)
% disp('removing an eddy association whose lifetime did not meet threshold');
% IBTrACS_eddies_1992_2010_v1_2.EddyType(i) = NaN;
% IBTrACS_eddies_1992_2010_v1_2.EddyLat(i) = NaN;
% IBTrACS_eddies_1992_2010_v1_2.EddyLon(i) = NaN;
% IBTrACS_eddies_1992_2010_v1_2.EddyAmp(i) = NaN;
% IBTrACS_eddies_1992_2010_v1_2.EddyGeoSpeed(i) = NaN;
% IBTrACS_eddies_1992_2010_v1_2.EddyIdx(i) = NaN;
% num_removed = num_removed + 1;
% end
results(i,1) = k;
break
end
end
if(~found) %No track was found for associated eddy -> remove it
% IBTrACS_eddies_1992_2010_v1_2.EddyType(i) = NaN;
% IBTrACS_eddies_1992_2010_v1_2.EddyLat(i) = NaN;
% IBTrACS_eddies_1992_2010_v1_2.EddyLon(i) = NaN;
% IBTrACS_eddies_1992_2010_v1_2.EddyAmp(i) = NaN;
% IBTrACS_eddies_1992_2010_v1_2.EddyGeoSpeed(i) = NaN;
% IBTrACS_eddies_1992_2010_v1_2.EddyIdx(i) = NaN;
% num_removed = num_removed + 1;
results(i,1) = NaN;
end
end
end
e = cputime -t