This repository is a base of Eos.
Revisión | 0fb2c4064f56306f4b6f4bf3e040cc607f366e67 (tree) |
---|---|
Tiempo | 2017-01-16 06:17:45 |
Autor | 久永浩司 <hisanagakouji@hisa...> |
Commiter | 久永浩司 |
modified ctfDeterminationByBayes.c
@@ -45,6 +45,7 @@ main(int argc, char* argv[]) | ||
45 | 45 | |
46 | 46 | int i; |
47 | 47 | int j; |
48 | + | |
48 | 49 | ctfDeterminationByBayesInfo info; |
49 | 50 | ctfInfo ctfinfo; |
50 | 51 | eosBayesDistributionInfo llinfo; |
@@ -93,11 +94,10 @@ main(int argc, char* argv[]) | ||
93 | 94 | DEBUGPRINT("carse search finish\n"); |
94 | 95 | ctfforbayescheckIntensityOfMaxPosterior(ctf,out.posterior,out.numDistribution,&ctfinfo,intensity.MTFmode,intensity.Ainmode,1,1); |
95 | 96 | |
96 | - | |
97 | 97 | /*MTF,B serch start\n*/ |
98 | - for(j=0;j<2;j++){ | |
99 | 98 | DEBUGPRINT("MTF,B search start\n"); |
100 | - ctf.rmax = Rintermediate; | |
99 | + ctf.rmax = Rintermediate; | |
100 | + ctf.rmin = Rmin; | |
101 | 101 | DEBUGPRINT2("set R range:%f~%f\n",ctf.rmin,ctf.rmax); |
102 | 102 | DEBUGPRINT("set maxposteriorflag of MTF,B\n"); |
103 | 103 | eosBayesMaxposteriorflagSet(&out,0); |
@@ -129,9 +129,39 @@ main(int argc, char* argv[]) | ||
129 | 129 | } |
130 | 130 | #endif |
131 | 131 | |
132 | - DEBUGPRINT1("----A:%f----\n",out.posterior[1].valueofmaxposterior); | |
133 | 132 | ctfforbayescheckIntensityOfMaxPosterior(ctf,out.posterior,out.numDistribution,&ctfinfo,intensity.MTFmode,intensity.Ainmode,1,1); |
134 | - DEBUGPRINT1("----A:%f----\n",out.posterior[1].valueofmaxposterior); | |
133 | + | |
134 | + /*B search*/ | |
135 | +/* | |
136 | + DEBUGPRINT("B,refinement\n"); | |
137 | + ctf.rmax = Rintermediate; | |
138 | + ctf.rmin = Rmin; | |
139 | + DEBUGPRINT2("set R range:%f~%f\n",ctf.rmin,ctf.rmax); | |
140 | + | |
141 | + DEBUGPRINT("set maxposteriorflag of defocus,A,k\n"); | |
142 | + eosBayesMaxposteriorflagSet(&out,0); | |
143 | + eosBayesMaxposteriorflagSet(&out,1); | |
144 | + eosBayesMaxposteriorflagSet(&out,4); | |
145 | + eosBayesMaxposteriorflagSet(&out,3); | |
146 | + | |
147 | + DEBUGPRINT("set canstantflag of Ain"); | |
148 | + out.posterior[5].constantflag = 1; | |
149 | + | |
150 | + DEBUGPRINT("set resetflag of B,MTF\n"); | |
151 | + out.prior[2].resetflag = 1; | |
152 | + eosBayesProbabilityReset(info.fptIn,&out,5,0); | |
153 | + | |
154 | + DEBUGPRINT("----maxflagcheck----\n"); | |
155 | + #ifdef DEBUG | |
156 | + for(i=0;i<out.numDistribution;i++){ | |
157 | + printf("dist%d:%d\n",i,(out.posterior[i].maxposteriorflag)); | |
158 | + } | |
159 | + #endif | |
160 | + | |
161 | + DefocusEstimationLoop(info,&out,&ctfinfo,&ctf,&intensity,&likelihood,1); | |
162 | + DEBUGPRINT("B refinement finish\n"); | |
163 | + ctfforbayescheckIntensityOfMaxPosterior(ctf,out.posterior,out.numDistribution,&ctfinfo,intensity.MTFmode,intensity.Ainmode,1,1); | |
164 | +*/ | |
135 | 165 | |
136 | 166 | /*df,A serch*/ |
137 | 167 | DEBUGPRINT("df, A, k search start\n"); |
@@ -149,7 +179,7 @@ main(int argc, char* argv[]) | ||
149 | 179 | DEBUGPRINT("set resetflag of df,A,k\n"); |
150 | 180 | out.prior[0].resetflag = 1; |
151 | 181 | out.prior[1].resetflag = 1; |
152 | - out.prior[3].resetflag = 1; | |
182 | + out.prior[2].resetflag = 1; | |
153 | 183 | eosBayesProbabilityReset(info.fptIn,&out,1,0); |
154 | 184 | |
155 | 185 | DEBUGPRINT("----maxflagcheck----\n"); |
@@ -163,10 +193,10 @@ main(int argc, char* argv[]) | ||
163 | 193 | DEBUGPRINT("A,df,A search finish\n"); |
164 | 194 | ctfforbayescheckIntensityOfMaxPosterior(ctf,out.posterior,out.numDistribution,&ctfinfo,intensity.MTFmode,intensity.Ainmode,1,1); |
165 | 195 | |
166 | - | |
167 | - /*df search*/ | |
196 | + /*df refinement*/ | |
168 | 197 | DEBUGPRINT("df serch start\n"); |
169 | 198 | ctf.rmax = Rintermediate; |
199 | + ctf.rmin = Rmin; | |
170 | 200 | DEBUGPRINT2("set R range:%f~%f\n",ctf.rmin,ctf.rmax); |
171 | 201 | |
172 | 202 | DEBUGPRINT("set maxposteriorflag of defocus,A,B\n"); |
@@ -189,15 +219,11 @@ main(int argc, char* argv[]) | ||
189 | 219 | } |
190 | 220 | #endif |
191 | 221 | |
192 | - DefocusEstimationLoop(info,&out,&ctfinfo,&ctf,&intensity,&likelihood,1); | |
193 | - DEBUGPRINT("df search finish\n"); | |
194 | - ctfforbayescheckIntensityOfMaxPosterior(ctf,out.posterior,out.numDistribution,&ctfinfo,intensity.MTFmode,intensity.Ainmode,1,1); | |
195 | - | |
196 | - } | |
197 | - | |
222 | + | |
198 | 223 | /*MTF refinement*/ |
199 | - DEBUGPRINT("MTF,refinement\n"); | |
224 | + DEBUGPRINT("MTF, B refinement\n"); | |
200 | 225 | ctf.rmax = Rmax; |
226 | + ctf.rmin = Rmin; | |
201 | 227 | DEBUGPRINT2("set R range:%f~%f\n",ctf.rmin,ctf.rmax); |
202 | 228 | |
203 | 229 | DEBUGPRINT("set maxposteriorflag of defocus,A,k\n"); |
@@ -210,6 +236,7 @@ main(int argc, char* argv[]) | ||
210 | 236 | out.posterior[5].constantflag = 1; |
211 | 237 | |
212 | 238 | DEBUGPRINT("set resetflag of B,MTF\n"); |
239 | +// out.prior[2].resetflag = 1; | |
213 | 240 | out.prior[4].resetflag = 1; |
214 | 241 | eosBayesProbabilityReset(info.fptIn,&out,5,0); |
215 | 242 |
@@ -221,27 +248,26 @@ main(int argc, char* argv[]) | ||
221 | 248 | #endif |
222 | 249 | |
223 | 250 | DefocusEstimationLoop(info,&out,&ctfinfo,&ctf,&intensity,&likelihood,1); |
224 | - DEBUGPRINT("MTF, B refinement finish\n"); | |
251 | + DEBUGPRINT("MTF refinement finish\n"); | |
225 | 252 | ctfforbayescheckIntensityOfMaxPosterior(ctf,out.posterior,out.numDistribution,&ctfinfo,intensity.MTFmode,intensity.Ainmode,1,1); |
226 | 253 | |
227 | - | |
228 | - /*df search*/ | |
229 | - /* | |
230 | - DEBUGPRINT("df serch start\n"); | |
254 | + /*B refinement*/ | |
255 | + DEBUGPRINT("B,refinement\n"); | |
231 | 256 | ctf.rmax = Rintermediate; |
257 | + ctf.rmin = Rmin; | |
232 | 258 | DEBUGPRINT2("set R range:%f~%f\n",ctf.rmin,ctf.rmax); |
233 | - | |
234 | - DEBUGPRINT("set maxposteriorflag of defocus,A,B\n"); | |
259 | + | |
260 | + DEBUGPRINT("set maxposteriorflag of defocus,A,k\n"); | |
261 | + eosBayesMaxposteriorflagSet(&out,0); | |
235 | 262 | eosBayesMaxposteriorflagSet(&out,1); |
236 | - eosBayesMaxposteriorflagSet(&out,2); | |
237 | - eosBayesMaxposteriorflagSet(&out,3); | |
238 | 263 | eosBayesMaxposteriorflagSet(&out,4); |
264 | + eosBayesMaxposteriorflagSet(&out,3); | |
239 | 265 | |
240 | 266 | DEBUGPRINT("set canstantflag of Ain"); |
241 | 267 | out.posterior[5].constantflag = 1; |
242 | 268 | |
243 | - DEBUGPRINT("set resetflag of df\n"); | |
244 | - out.prior[0].resetflag = 1; | |
269 | + DEBUGPRINT("set resetflag of B,MTF\n"); | |
270 | + out.prior[2].resetflag = 1; | |
245 | 271 | eosBayesProbabilityReset(info.fptIn,&out,5,0); |
246 | 272 | |
247 | 273 | DEBUGPRINT("----maxflagcheck----\n"); |
@@ -252,31 +278,26 @@ main(int argc, char* argv[]) | ||
252 | 278 | #endif |
253 | 279 | |
254 | 280 | DefocusEstimationLoop(info,&out,&ctfinfo,&ctf,&intensity,&likelihood,1); |
255 | - DEBUGPRINT("df search finish\n"); | |
281 | + DEBUGPRINT("B refinement finish\n"); | |
256 | 282 | ctfforbayescheckIntensityOfMaxPosterior(ctf,out.posterior,out.numDistribution,&ctfinfo,intensity.MTFmode,intensity.Ainmode,1,1); |
257 | -*/ | |
258 | - | |
259 | - /*A, Ain refinement*/ | |
260 | -/* | |
261 | - DEBUGPRINT("A, k, Ain refinement start\n"); | |
262 | 283 | |
284 | + /*df refinement*/ | |
285 | + DEBUGPRINT("df serch start\n"); | |
263 | 286 | ctf.rmax = Rintermediate; |
264 | 287 | ctf.rmin = Rmin; |
265 | 288 | DEBUGPRINT2("set R range:%f~%f\n",ctf.rmin,ctf.rmax); |
266 | 289 | |
267 | - DEBUGPRINT("set maxposteriorflag of MTF,B\n"); | |
268 | - eosBayesMaxposteriorflagSet(&out,0); | |
290 | + DEBUGPRINT("set maxposteriorflag of defocus,A,B\n"); | |
291 | + eosBayesMaxposteriorflagSet(&out,1); | |
269 | 292 | eosBayesMaxposteriorflagSet(&out,2); |
293 | + eosBayesMaxposteriorflagSet(&out,3); | |
270 | 294 | eosBayesMaxposteriorflagSet(&out,4); |
271 | 295 | |
272 | 296 | DEBUGPRINT("set canstantflag of Ain"); |
273 | - out.posterior[5].constantflag = 0; | |
297 | + out.posterior[5].constantflag = 1; | |
274 | 298 | |
275 | - DEBUGPRINT("set resetflag of df,A,k\n"); | |
299 | + DEBUGPRINT("set resetflag of df\n"); | |
276 | 300 | out.prior[0].resetflag = 1; |
277 | - out.prior[1].resetflag = 1; | |
278 | - out.prior[3].resetflag = 1; | |
279 | - out.prior[5].resetflag = 1; | |
280 | 301 | eosBayesProbabilityReset(info.fptIn,&out,5,0); |
281 | 302 | |
282 | 303 | DEBUGPRINT("----maxflagcheck----\n"); |
@@ -286,10 +307,7 @@ main(int argc, char* argv[]) | ||
286 | 307 | } |
287 | 308 | #endif |
288 | 309 | |
289 | - DefocusEstimationLoop(info,&out,&ctfinfo,&ctf,&intensity,&likelihood,1); | |
290 | - DEBUGPRINT("df, A, k, Ain refinementfinish\n"); | |
291 | - ctfforbayescheckIntensityOfMaxPosterior(ctf,out.posterior,out.numDistribution,&ctfinfo,intensity.MTFmode,intensity.Ainmode,1,1); | |
292 | -*/ | |
310 | + | |
293 | 311 | /*defocus refinement*/ |
294 | 312 | |
295 | 313 | DEBUGPRINT("defocus refinement start\n"); |