-
Notifications
You must be signed in to change notification settings - Fork 1
/
exp2_thrshold10_NT_6.m
261 lines (171 loc) · 9.59 KB
/
exp2_thrshold10_NT_6.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
%data extraction from experimental files NT 6
R_core=50;
R_bulk_1=150;
R_bulk_2=200;
R_border_1=300;
R_border_2=350;
num_prof_points=50;
dR=R_border_2/num_prof_points;
exp2_pivobj_NT_6_mg_blured_stripes_thr10=cell(1,5);
fldr_NT_6_mg_master_thrsh10_orig_exp2=...
'/Volumes/Seagate Expansion Drive/workspace/Circular_Cells/Another_DATA_set/exp2_NT_6mg_';
av_vel_profile_bluredNT_6_stripes_thr10_exp2=cell(1,5);
av_curlz_profile_bluredNT_6_stripes_thr10_exp2=cell(1,5);
av_div_profile_bluredNT_6_stripes_thr10_exp2=cell(1,5);
vxs_core_all_t_NT_6_mg_blured_stripes_thr10_exp2=cell(1,5);
vys_core_all_t_NT_6_mg_blured_stripes_thr10_exp2=cell(1,5);
vxs_bulk_all_t_NT_6_mg_blured_stripes_thr10_exp2=cell(1,5);
vys_bulk_all_t_NT_6_mg_blured_stripes_thr10_exp2=cell(1,5);
vxs_border_all_t_NT_6_mg_blured_stripes_thr10_exp2=cell(1,5);
vys_border_all_t_NT_6_mg_blured_stripes_thr10_exp2=cell(1,5);
vort_core_NT_6_mg_blured_stripes_thr10_exp2=cell(1,5);
vort_bulk_NT_6_mg_blured_stripes_thr10_exp2=cell(1,5);
vort_border_NT_6_mg_blured_stripes_thr10_exp2=cell(1,5);
for i=1:5
av_vel_profile_bluredNT_6_stripes_thr10_exp2{i}=zeros(1,num_prof_points);
av_curlz_profile_bluredNT_6_stripes_thr10_exp2{i}=zeros(1,num_prof_points);
av_div_profile_bluredNT_6_stripes_thr10_exp2{i}=zeros(1,num_prof_points);
fldr_NT_6_mg_h=[fldr_NT_6_mg_master_thrsh10_orig_exp2 num2str(i) '/'];
fls_NT_6mg_h=dir([fldr_NT_6_mg_h 'P*.txt']);
data_test=importdata(...
[fldr_NT_6_mg_h fls_NT_6mg_h(1).name]);
len = length(data_test.data);
exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.xs=zeros(len, length(fls_NT_6mg_h));
exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.ys=zeros(len, length(fls_NT_6mg_h));
exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.vxs=zeros(len, length(fls_NT_6mg_h));
exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.vys=zeros(len, length(fls_NT_6mg_h));
for t=1:length(fls_NT_6mg_h)
data_test=importdata(...
[fldr_NT_6_mg_h fls_NT_6mg_h(t).name]);
exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.xs(:,t) = data_test.data(:,1);
exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.ys(:,t) = data_test.data(:,2);
exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.vxs(:,t) = data_test.data(:,3);
exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.vys(:,t) = data_test.data(:,4);
end
[pivX_NT_6mg_thr10_exp2, pivY_NT_6mg_thr10_exp2,...
pivVX_NT_6mg_thr10_exp2, pivVY_NT_6mg_thr10_exp2,...
pivDIV_NT_6mg_thr10_exp2, pivDIVall_NT_6mg_thr10_exp2,...
pivCURLz_NT_6mg_thr10_exp2, pivCURLav_NT_6mg_thr10_exp2,...
pivCURLz_all_NT_6mg_thr10_exp2, pivCURLav_all_NT_6mg_thr10_exp2] = ...
piv_obj_to_matrix(exp2_pivobj_NT_6_mg_blured_stripes_thr10{i});
x_c=exp2_NT_6_mg_center.xs(i);
y_c=exp2_NT_6_mg_center.ys(i);
cond_core=(exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.xs-x_c).^2+...
(exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.ys-y_c).^2<=R_core^2;
vxs_core_all_t_NT_6_mg_blured_stripes_thr10_exp2{i}=...
exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.vxs(...
cond_core);
vys_core_all_t_NT_6_mg_blured_stripes_thr10_exp2{i}=...
exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.vys(...
cond_core);
cond_bulk=(exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.xs-x_c).^2+...
(exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.ys-y_c).^2<=R_bulk_2^2 & ...
(exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.xs-x_c).^2+...
(exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.ys-y_c).^2>R_bulk_1^2;
vxs_bulk_all_t_NT_6_mg_blured_stripes_thr10_exp2{i}=...
exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.vxs(...
cond_bulk);
vys_bulk_all_t_NT_6_mg_blured_stripes_thr10_exp2{i}=...
exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.vys(...
cond_bulk);
cond_border=(exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.xs-x_c).^2+...
(exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.ys-y_c).^2>R_border_1^2 & ...
(exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.xs-x_c).^2+...
(exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.ys-y_c).^2<=R_border_2^2;
vxs_border_all_t_NT_6_mg_blured_stripes_thr10_exp2{i}=...
exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.vxs(...
cond_border);
vys_border_all_t_NT_6_mg_blured_stripes_thr10_exp2{i}=...
exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.vys(...
cond_border);
figure
fh=sqrt(vxs_core_all_t_NT_6_mg_blured_stripes_thr10_exp2{i}.^2+...
vys_core_all_t_NT_6_mg_blured_stripes_thr10_exp2{i}.^2);
h=histogram(fh(~isnan(fh)),...
linspace(0,25,100),'Normalization','pdf');
write_2_column_table(['pdf_vabs_core_stripes_thr10_exp2_bluredNT_6_mg_' num2str(i) '.dat'],...
h.BinEdges(1:end-1),h.Values)
write_1_column_table(['all_vabs_core_stripes_thr10_exp2_bluredNT_6_mg_' num2str(i) '.dat'],...
fh(~isnan(fh)))
hold on
fh=sqrt(vxs_bulk_all_t_NT_6_mg_blured_stripes_thr10_exp2{i}.^2+...
vys_bulk_all_t_NT_6_mg_blured_stripes_thr10_exp2{i}.^2);
h=histogram(fh(~isnan(fh)),...
linspace(0,25,100),'Normalization','pdf');
write_2_column_table(['pdf_vabs_bulk_stripes_thr10_exp2_bluredNT_6_mg_' num2str(i) '.dat'],...
h.BinEdges(1:end-1),h.Values)
write_1_column_table(['all_vabs_bulk_stripes_thr10_exp2_bluredNT_6_mg_' num2str(i) '.dat'],...
fh(~isnan(fh)))
hold on
fh=sqrt(vxs_border_all_t_NT_6_mg_blured_stripes_thr10_exp2{i}.^2+...
vys_border_all_t_NT_6_mg_blured_stripes_thr10_exp2{i}.^2);
h=histogram(fh(~isnan(fh)),...
linspace(0,25,100),'Normalization','pdf');
write_2_column_table(['pdf_vabs_border_stripes_thr10_exp2_bluredNT_6_mg_' num2str(i) '.dat'],...
h.BinEdges(1:end-1),h.Values)
write_1_column_table(['all_vabs_border_stripes_thr10_exp2_bluredNT_6_mg_' num2str(i) '.dat'],...
fh(~isnan(fh)))
vort_core_NT_6_mg_blured_stripes_thr10_exp2{i}=pivCURLz_all_NT_6mg_thr10_exp2(cond_core); %pivobj_NT_6_mg_blured{i}.loaded_vort
vort_bulk_NT_6_mg_blured_stripes_thr10_exp2{i}=pivCURLz_all_NT_6mg_thr10_exp2(cond_bulk); % pivobj_NT_6_mg_blured{i}.loaded_vort
vort_border_NT_6_mg_blured_stripes_thr10_exp2{i}=pivCURLz_all_NT_6mg_thr10_exp2(cond_border); %pivobj_NT_6_mg_blured{i}.loaded_vort
figure
fh=vort_core_NT_6_mg_blured_stripes_thr10_exp2{i};
h=histogram(fh(~isnan(fh)),...
linspace(-1.5,1.5,100),'Normalization','pdf');
write_2_column_table(['pdf_vort_core_stripes_thr10_exp2_bluredNT_6_mg_' num2str(i) '.dat'],...
h.BinEdges(1:end-1),h.Values)
write_1_column_table(['all_vort_core_stripes_thr10_exp2_bluredNT_6_mg_' num2str(i) '.dat'],...
fh(~isnan(fh)))
hold on
fh=vort_bulk_NT_6_mg_blured_stripes_thr10_exp2{i};
h=histogram(fh(~isnan(fh)),...
linspace(-1.5,1.5,100),'Normalization','pdf');
write_2_column_table(['pdf_vort_bulk_stripes_thr10_exp2_bluredNT_6_mg_' num2str(i) '.dat'],...
h.BinEdges(1:end-1),h.Values)
write_1_column_table(['all_vort_bulk_stripes_thr10_exp2_bluredNT_6_mg_' num2str(i) '.dat'],...
fh(~isnan(fh)))
hold on
fh=vort_border_NT_6_mg_blured_stripes_thr10_exp2{i};
h=histogram(fh(~isnan(fh)),...
linspace(-1.5,1.5,100),'Normalization','pdf');
write_2_column_table(['pdf_vort_border_stripes_thr10_exp2_bluredNT_6_mg_' num2str(i) '.dat'],...
h.BinEdges(1:end-1),h.Values)
write_1_column_table(['all_vort_border_stripes_thr10_exp2_bluredNT_6_mg_' num2str(i) '.dat'],...
fh(~isnan(fh)))
R_positions=sqrt((exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.xs-x_c).^2 + ...
(exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.ys-y_c).^2);
absv_all=sqrt(exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.vxs.^2+exp2_pivobj_NT_6_mg_blured_stripes_thr10{i}.vys.^2);
abscurlz_all=pivCURLz_all_NT_6mg_thr10_exp2;
absdiv_all=pivDIVall_NT_6mg_thr10_exp2;
for j=1:num_prof_points
cond_RdR=(R_positions<(j*dR)) & (R_positions>=((j-1)*dR));
av_vel_profile_bluredNT_6_stripes_thr10_exp2{i}(j)=nanmean(absv_all(cond_RdR));
av_curlz_profile_bluredNT_6_stripes_thr10_exp2{i}(j)=nanmean(abs(abscurlz_all(cond_RdR)));
av_div_profile_bluredNT_6_stripes_thr10_exp2{i}(j)=nanmean((absdiv_all(cond_RdR)));
end
figure;
plot((1:num_prof_points)*dR,av_vel_profile_bluredNT_6_stripes_thr10_exp2{i})
hold on
write_2_column_table(['velocity_profile_stripes_thr10_exp2_bluredNT_6_mg_set_'...
num2str(i) '.dat' ], (1:num_prof_points)*dR ,...
av_vel_profile_bluredNT_6_stripes_thr10_exp2{i})
xlabel('r')
ylabel('mean v')
legend('Location','best')
title('NT 2 mg')
set(gca,'FontSize', 14)
figure
plot((1:num_prof_points)*dR,av_curlz_profile_bluredNT_6_stripes_thr10_exp2{i},...
'DisplayName',['set ' num2str(i)])
hold on
write_2_column_table(['blured_absvort_profile_stripes_thr10_exp2_bluredNT_6_mg_set_'...
num2str(i) '.dat' ], (1:num_prof_points)*dR ,...
av_curlz_profile_bluredNT_6_stripes_thr10_exp2{i})
figure
plot((1:num_prof_points)*dR,av_div_profile_bluredNT_6_stripes_thr10_exp2{i},...
'DisplayName',['set ' num2str(i)])
hold on
write_2_column_table(['blured_div_profile_stripes_thr10_exp2_bluredNT_6_mg_set_'...
num2str(i) '.dat' ], (1:num_prof_points)*dR ,...
av_div_profile_bluredNT_6_stripes_thr10_exp2{i})
end