-
Notifications
You must be signed in to change notification settings - Fork 0
/
well_data_processor.asv
executable file
·176 lines (135 loc) · 5.14 KB
/
well_data_processor.asv
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
data = xlsread('test_data.xlsx');
data = data(:,3:end);
data = mean(data);
data = reshape(data,12,8)';
%Significant catalysis considered least 10% product conversion and
%t
negativeThresh = 10;
listSigCatalysis = [];
hsolvents = figure('units','normalized','outerposition',[0 0 1 1]);
listSigCatalysis = [];
for i=1:2:7,
withcatalyst = data(:,i);
withoutcatalyst = data(:,i+1);
if i==1 || i==5,
positiveControl = data(i:i+3,11);
else
positiveControl = data(i-2:i+1,12); %i will be 3 and 7 for Solvent 2 and 4
end
cutoff = positiveControl(2,1); %10 percent catalysis
sigCatalysis = withcatalyst > withoutcatalyst * (1+negativeThresh/100) & withcatalyst > cutoff;
tograph(1:8,1) = withoutcatalyst';
tograph(1:8,2) = withcatalyst';
% tograph(17:20) = positiveControl;
subplot(2,2,(i+1)/2)
x = 1:8;
h1 = bar(x,tograph);
l = {'.1 imid','.5 imid','1.0 imid','N/A','.1 Et3N','.1 H+sp.','.1 CSA','.1 AcOH'};
set(gca,'xticklabel',l);
hold on;
% hAxes = gca;
% hAxes_pos = get(hAxes,'Position');
%
% hAxes2 = axes('Position',hAxes_pos);
h2 = plot(x,ones(1,8)*positiveControl(1),'--',x,ones(1,8)*positiveControl(2),'--',x,ones(1,8)*positiveControl(3),'--',x,ones(1,8)*positiveControl(4),'--','LineWidth',4);
% set(hAxes2,'YAxisLocation','right','Color','none','XTickLabel',[])
hold off;
% subplot(2,2,(i+1)/2)
% width1 = 0.5;
% hBars = bar(withoutcatalyst,width1,'b');
% set(hBars(1),'BaseValue',cutoff);
% hBaseline = get(hBars(1),'BaseLine');
% set(hBaseline,'LineStyle',':','Color','red','LineWidth',2);
% hold on;
% hBars = bar(withcatalyst,width1/2,'r');
% set(hBars(1),'BaseValue',cutoff);
% hBaseline = get(hBars(1),'BaseLine');
% set(hBaseline,'LineStyle',':','Color','red','LineWidth',2);
% l = {'.1 imid','.5 imid','1.0 imid','N/A','.1 Et3N','.1 H+sp.','.1 CSA','.1 AcOH'};
% set(gca,'xticklabel',l);
% hold off;
% hBars = bar(tograph);
% set(hBars(1),'BaseValue',cutoff);
% hBaseline = get(hBars(1),'BaseLine');
% set(hBaseline,'LineStyle',':','Color','red','LineWidth',2);
listSigCatalysis = [ listSigCatalysis , sigCatalysis ];
end
leg = legend([h1';h2],'W/o catalyst','With catalyst', '5','10','25','50','Location','NorthEastOutside');
set(leg, 'FontSize',7);
set(leg,'units','pixels');
set(leg,'position',[730 363 150 98])
%%
%process buffers
bufferListSigCatalysis = [];
figure;
wC = [];
woC = [];
for i=1:2:7,
withcatalyst = data(i,9);
withoutcatalyst = data(i+1,9);
positiveControl = data(i:i+1,10);
cutoff = positiveControl(1);
sigCatalysis = withcatalyst > withoutcatalyst*(1+negativeThresh/100) & withcatalyst > cutoff;
bufferListSigCatalysis = [bufferListSigCatalysis, sigCatalysis];
woC = [woC, withoutcatalyst ];
wC = [wC, withcatalyst ];
% subplot(2,2,(i+1)/2)
% width1 = 0.5;
% bar(1,withoutcatalyst,width1,'b');
% hold on;
% plot(1:2,ones(2)*positiveControl(1),'--',1:2,ones(2)*positiveControl(2),'--','LineWidth',4);
% hold on;
% bar(1,withcatalyst,width1/2,'r');
% hold off;
% bar(1:2,[withoutcatalyst;withcatalyst]);
%
% hold on;
% hold off;
% width1 = 0.5;
% hBars = bar(1,withoutcatalyst,width1,'b');
% set(hBars(1),'BaseValue',cutoff);
% hBaseline = get(hBars(1),'BaseLine');
% set(hBaseline,'LineStyle',':','Color','red','LineWidth',2);
% hold on
% hBars = bar(1,withcatalyst,width1/2,'r');
% set(hBars(1),'BaseValue',cutoff);
% hBaseline = get(hBars(1),'BaseLine');
% set(hBaseline,'LineStyle',':','Color','red','LineWidth',2);
% hold off
end
%
% width1 = 0.5;
% hBars = bar(woC,width1,'b');
% set(hBars(1),'BaseValue',cutoff);
% hBaseline = get(hBars(1),'BaseLine');
% set(hBaseline,'LineStyle',':','Color','red','LineWidth',2);
% hold on
% hBars = bar(wC,width1/2,'r');
x = 1:4;
bar(x,[woC', wC']);
hold on;
plot(x,ones(4)*positiveControl(1),'--',x,ones(4)*positiveControl(2),'--','LineWidth',4);
%%
%%Process methanol
rv = [1:4,7:8];
withcatalyst = data(rv,9);
withoutcatalyst = data(rv,10);
positiveControl = [data(5,9:10),data(6,9:10)];
cutoff = positiveControl(2);
sigCatalysis = withcatalyst > withoutcatalyst*(1+negativeThresh/100) & withcatalyst > cutoff;
figure;
x = 1:6;
bar(x,[withoutcatalyst , withcatalyst]);
hold on;
plot(x,ones(size(x,2))*positiveControl(1),'--',x,ones(size(x,2))*positiveControl(2),'--',x,ones(size(x,2))*positiveControl(3),'--',x,ones(size(x,2))*positiveControl(4),'--','LineWidth',4);
% width1 = 0.5;
% hBars = bar(withoutcatalyst,width1,'b');
% set(hBars(1),'BaseValue',cutoff);
% hBaseline = get(hBars(1),'BaseLine');
% set(hBaseline,'LineStyle',':','Color','red','LineWidth',2);
% hold on
% hBars = bar(withcatalyst,width1/2,'r');
% set(hBars(1),'BaseValue',cutoff);
% hBaseline = get(hBars(1),'BaseLine');
% set(hBaseline,'LineStyle',':','Color','red','LineWidth',2);
% hold off