1 | function analyse_reconst |
---|
2 | |
---|
3 | load('BPMData_30tours.mat'); |
---|
4 | |
---|
5 | % to be set in startup file |
---|
6 | set(0,'DefaultAxesColorOrder',(colordg(1:15))); |
---|
7 | |
---|
8 | %% |
---|
9 | Sum = AM.Data.Va + AM.Data.Vd + AM.Data.Va + AM.Data.Vd; |
---|
10 | Quad = (AM.Data.Va + AM.Data.Vc - AM.Data.Vb - AM.Data.Vd)./Sum; |
---|
11 | Kx = 11.4; Kz = 11.4; |
---|
12 | XPos = Kx*(AM.Data.Va - AM.Data.Vb + AM.Data.Vd - AM.Data.Vc)./Sum; |
---|
13 | ZPos = Kz*(AM.Data.Va + AM.Data.Vb - AM.Data.Vc - AM.Data.Vd)./Sum; |
---|
14 | |
---|
15 | AM.DataR.Sum = Sum; |
---|
16 | AM.DataR.Q = Quad; |
---|
17 | AM.DataR.X = XPos; |
---|
18 | AM.DataR.Z = ZPos; |
---|
19 | |
---|
20 | % figure; |
---|
21 | % plot(repmat((1:8),3),'.-') |
---|
22 | % legend('1','2','3','4','5','6','7','8') |
---|
23 | |
---|
24 | %% Superperiod 1 |
---|
25 | figure |
---|
26 | |
---|
27 | isup = 4; |
---|
28 | ishift = 30; |
---|
29 | |
---|
30 | |
---|
31 | local_plot(isup,ishift) |
---|
32 | |
---|
33 | function local_plot(isup,ishift) |
---|
34 | |
---|
35 | bpmnum = (1:8) + ishift; |
---|
36 | turnnum = 4:40; |
---|
37 | |
---|
38 | h1=subplot(2,2,1); |
---|
39 | plot(AM.DataR.Sum(bpmnum ,turnnum)','.-') |
---|
40 | ylabel('Sum (a.u.)') |
---|
41 | suptitle('Cell 1') |
---|
42 | |
---|
43 | h2=subplot(2,2,2); |
---|
44 | plot(AM.DataR.Q(bpmnum ,turnnum)','.-') |
---|
45 | ylabel('Quad (a.u.)') |
---|
46 | |
---|
47 | h3=subplot(2,2,3); |
---|
48 | plot(AM.DataR.X(bpmnum,turnnum)','.-') |
---|
49 | ylabel('X(mm)') |
---|
50 | xlabel('BPM number') |
---|
51 | |
---|
52 | h4=subplot(2,2,4); |
---|
53 | plot(AM.DataR.Z(bpmnum,turnnum)','.-') |
---|
54 | ylabel('Z(mm)') |
---|
55 | xlabel('BPM number') |
---|
56 | |
---|
57 | linkaxes([h1 h2 h3 h4],'x'); |
---|
58 | set([h1 h2 h3 h4],'XGrid','On','YGrid','On'); |
---|
59 | legendstr = eval(['{', sprintf('''BPM[%2d %d]'',',AM.DeviceList(bpmnum,:)'), '}']); |
---|
60 | legend1 = legend(... |
---|
61 | legendstr,... |
---|
62 | 'LineWidth',1,... |
---|
63 | 'Position',[0.3202 0.4961 0.4257 0.02956],... |
---|
64 | 'Orientation','horizontal'); |
---|
65 | |
---|
66 | figure |
---|
67 | |
---|
68 | h1=subplot(2,2,1); |
---|
69 | plot(AM.DataR.Sum(9:16,turnnum)','.-') |
---|
70 | grid on |
---|
71 | ylabel('Sum (a.u.)') |
---|
72 | suptitle('Cell 2') |
---|
73 | |
---|
74 | h2=subplot(2,2,2); |
---|
75 | plot(AM.DataR.Q(9:16 ,turnnum)','.-') |
---|
76 | grid on |
---|
77 | ylabel('Quad (a.u.)') |
---|
78 | |
---|
79 | h3=subplot(2,2,3); |
---|
80 | plot(AM.DataR.X(9:16,turnnum)','.-') |
---|
81 | grid on |
---|
82 | ylabel('X(mm)') |
---|
83 | xlabel('BPM number') |
---|
84 | |
---|
85 | h4=subplot(2,2,4); |
---|
86 | plot(AM.DataR.Z(9:16,turnnum)','.-') |
---|
87 | grid on |
---|
88 | ylabel('Z(mm)') |
---|
89 | xlabel('BPM number') |
---|
90 | |
---|
91 | linkaxes([h1 h2 h3 h4],'x'); |
---|
92 | |
---|
93 | figure |
---|
94 | |
---|
95 | h1=subplot(2,2,1); |
---|
96 | plot(AM.DataR.Sum(17:24,turnnum)','.-') |
---|
97 | grid on |
---|
98 | ylabel('Sum (a.u.)') |
---|
99 | suptitle('Cell 3') |
---|
100 | |
---|
101 | h2=subplot(2,2,2); |
---|
102 | plot(AM.DataR.Q(17:24 ,turnnum)','.-') |
---|
103 | grid on |
---|
104 | ylabel('Quad (a.u.)') |
---|
105 | |
---|
106 | h3=subplot(2,2,3); |
---|
107 | plot(AM.DataR.X(17:24,turnnum)','.-') |
---|
108 | grid on |
---|
109 | ylabel('X(mm)') |
---|
110 | xlabel('BPM number') |
---|
111 | |
---|
112 | h4=subplot(2,2,4); |
---|
113 | plot(AM.DataR.Z(17:24,turnnum)','.-') |
---|
114 | grid on |
---|
115 | ylabel('Z(mm)') |
---|
116 | xlabel('BPM number') |
---|
117 | |
---|
118 | linkaxes([h1 h2 h3 h4],'x'); |
---|
119 | |
---|
120 | figure |
---|
121 | |
---|
122 | h1=subplot(2,2,1); |
---|
123 | plot(AM.DataR.Sum(25:31,turnnum)','.-') |
---|
124 | grid on |
---|
125 | ylabel('Sum (a.u.)') |
---|
126 | suptitle('Cell 4') |
---|
127 | |
---|
128 | h2=subplot(2,2,2); |
---|
129 | plot(AM.DataR.Q(25:31 ,turnnum)','.-') |
---|
130 | grid on |
---|
131 | ylabel('Quad (a.u.)') |
---|
132 | |
---|
133 | h3=subplot(2,2,3); |
---|
134 | plot(AM.DataR.X(25:31,turnnum)','.-') |
---|
135 | grid on |
---|
136 | ylabel('X(mm)') |
---|
137 | xlabel('BPM number') |
---|
138 | |
---|
139 | h4=subplot(2,2,4); |
---|
140 | plot(AM.DataR.Z(25:31,turnnum)','.-') |
---|
141 | grid on |
---|
142 | ylabel('Z(mm)') |
---|
143 | xlabel('BPM number') |
---|
144 | |
---|
145 | linkaxes([h1 h2 h3 h4],'x'); |
---|
146 | |
---|
147 | %% Superperiod 2 |
---|
148 | isup = 4; |
---|
149 | ishift = 30; |
---|
150 | figure |
---|
151 | |
---|
152 | h1=subplot(2,2,1); |
---|
153 | plot(AM.DataR.Sum((1:8)+ishift ,turnnum)','.-') |
---|
154 | grid on |
---|
155 | ylabel('Sum (a.u.)') |
---|
156 | suptitle(sprintf('Cell %d',1+isup)) |
---|
157 | |
---|
158 | h2=subplot(2,2,2); |
---|
159 | plot(AM.DataR.Q((1:8)+ishift ,turnnum)','.-') |
---|
160 | grid on |
---|
161 | ylabel('Quad (a.u.)') |
---|
162 | |
---|
163 | h3=subplot(2,2,3); |
---|
164 | plot(AM.DataR.X((1:8)+ishift,turnnum)','.-') |
---|
165 | grid on |
---|
166 | ylabel('X(mm)') |
---|
167 | xlabel('BPM number') |
---|
168 | |
---|
169 | h4=subplot(2,2,4); |
---|
170 | plot(AM.DataR.Z((1:8)+ishift,turnnum)','.-') |
---|
171 | grid on |
---|
172 | ylabel('Z(mm)') |
---|
173 | xlabel('BPM number') |
---|
174 | |
---|
175 | linkaxes([h1 h2 h3 h4],'x'); |
---|
176 | |
---|
177 | figure |
---|
178 | |
---|
179 | h1=subplot(2,2,1); |
---|
180 | plot(AM.DataR.Sum((9:16)+ishift,turnnum)','.-') |
---|
181 | grid on |
---|
182 | ylabel('Sum (a.u.)') |
---|
183 | suptitle(sprintf('Cell %d',2+isup)) |
---|
184 | |
---|
185 | h2=subplot(2,2,2); |
---|
186 | plot(AM.DataR.Q((9:16)+ishift,turnnum)','.-') |
---|
187 | grid on |
---|
188 | ylabel('Quad (a.u.)') |
---|
189 | |
---|
190 | h3=subplot(2,2,3); |
---|
191 | plot(AM.DataR.X((9:16)+ishift,turnnum)','.-') |
---|
192 | grid on |
---|
193 | ylabel('X(mm)') |
---|
194 | xlabel('BPM number') |
---|
195 | |
---|
196 | h4=subplot(2,2,4); |
---|
197 | plot(AM.DataR.Z((9:16)+ishift,turnnum)','.-') |
---|
198 | grid on |
---|
199 | ylabel('Z(mm)') |
---|
200 | xlabel('BPM number') |
---|
201 | |
---|
202 | linkaxes([h1 h2 h3 h4],'x'); |
---|
203 | |
---|
204 | figure |
---|
205 | |
---|
206 | h1=subplot(2,2,1); |
---|
207 | plot(AM.DataR.Sum((17:24)+ishift,turnnum)','.-') |
---|
208 | grid on |
---|
209 | ylabel('Sum (a.u.)') |
---|
210 | suptitle(sprintf('Cell %d',3+isup)) |
---|
211 | |
---|
212 | h2=subplot(2,2,2); |
---|
213 | plot(AM.DataR.Q((17:24)+ishift,turnnum)','.-') |
---|
214 | grid on |
---|
215 | ylabel('Quad (a.u.)') |
---|
216 | |
---|
217 | h3=subplot(2,2,3); |
---|
218 | plot(AM.DataR.X((17:24)+ishift,turnnum)','.-') |
---|
219 | grid on |
---|
220 | ylabel('X(mm)') |
---|
221 | xlabel('BPM number') |
---|
222 | |
---|
223 | h4=subplot(2,2,4); |
---|
224 | plot(AM.DataR.Z((17:24)+ishift,turnnum)','.-') |
---|
225 | grid on |
---|
226 | ylabel('Z(mm)') |
---|
227 | xlabel('BPM number') |
---|
228 | |
---|
229 | linkaxes([h1 h2 h3 h4],'x'); |
---|
230 | |
---|
231 | figure |
---|
232 | |
---|
233 | h1=subplot(2,2,1); |
---|
234 | plot(AM.DataR.Sum((25:31)+ishift,turnnum)','.-') |
---|
235 | grid on |
---|
236 | ylabel('Sum (a.u.)') |
---|
237 | suptitle(sprintf('Cell %d',4+isup)) |
---|
238 | |
---|
239 | h2=subplot(2,2,2); |
---|
240 | plot(AM.DataR.Q((25:31)+ishift,turnnum)','.-') |
---|
241 | grid on |
---|
242 | ylabel('Quad (a.u.)') |
---|
243 | |
---|
244 | h3=subplot(2,2,3); |
---|
245 | plot(AM.DataR.X((25:31)+ishift,turnnum)','.-') |
---|
246 | grid on |
---|
247 | ylabel('X(mm)') |
---|
248 | xlabel('BPM number') |
---|
249 | |
---|
250 | h4=subplot(2,2,4); |
---|
251 | plot(AM.DataR.Z((25:31)+ishift,turnnum)','.-') |
---|
252 | grid on |
---|
253 | ylabel('Z(mm)') |
---|
254 | xlabel('BPM number') |
---|
255 | |
---|
256 | linkaxes([h1 h2 h3 h4],'x'); |
---|
257 | |
---|
258 | %% superperiod 3 |
---|
259 | isup = 4*2; |
---|
260 | ishift = 30*2; |
---|
261 | figure |
---|
262 | |
---|
263 | h1=subplot(2,2,1); |
---|
264 | plot(AM.DataR.Sum((1:8)+ishift ,turnnum)','.-') |
---|
265 | grid on |
---|
266 | ylabel('Sum (a.u.)') |
---|
267 | suptitle(sprintf('Cell %d',1+isup)) |
---|
268 | |
---|
269 | h2=subplot(2,2,2); |
---|
270 | plot(AM.DataR.Q((1:8)+ishift ,turnnum)','.-') |
---|
271 | grid on |
---|
272 | ylabel('Quad (a.u.)') |
---|
273 | |
---|
274 | h3=subplot(2,2,3); |
---|
275 | plot(AM.DataR.X((1:8)+ishift,turnnum)','.-') |
---|
276 | grid on |
---|
277 | ylabel('X(mm)') |
---|
278 | xlabel('BPM number') |
---|
279 | |
---|
280 | h4=subplot(2,2,4); |
---|
281 | plot(AM.DataR.Z((1:8)+ishift,turnnum)','.-') |
---|
282 | grid on |
---|
283 | ylabel('Z(mm)') |
---|
284 | xlabel('BPM number') |
---|
285 | |
---|
286 | linkaxes([h1 h2 h3 h4],'x'); |
---|
287 | |
---|
288 | figure |
---|
289 | |
---|
290 | h1=subplot(2,2,1); |
---|
291 | plot(AM.DataR.Sum((9:16)+ishift,turnnum)','.-') |
---|
292 | grid on |
---|
293 | ylabel('Sum (a.u.)') |
---|
294 | suptitle(sprintf('Cell %d',2+isup)) |
---|
295 | |
---|
296 | h2=subplot(2,2,2); |
---|
297 | plot(AM.DataR.Q((9:16)+ishift,turnnum)','.-') |
---|
298 | grid on |
---|
299 | ylabel('Quad (a.u.)') |
---|
300 | |
---|
301 | h3=subplot(2,2,3); |
---|
302 | plot(AM.DataR.X((9:16)+ishift,turnnum)','.-') |
---|
303 | grid on |
---|
304 | ylabel('X(mm)') |
---|
305 | xlabel('BPM number') |
---|
306 | |
---|
307 | h4=subplot(2,2,4); |
---|
308 | plot(AM.DataR.Z((9:16)+ishift,turnnum)','.-') |
---|
309 | grid on |
---|
310 | ylabel('Z(mm)') |
---|
311 | xlabel('BPM number') |
---|
312 | |
---|
313 | linkaxes([h1 h2 h3 h4],'x'); |
---|
314 | |
---|
315 | figure |
---|
316 | |
---|
317 | h1=subplot(2,2,1); |
---|
318 | plot(AM.DataR.Sum((17:24)+ishift,turnnum)','.-') |
---|
319 | grid on |
---|
320 | ylabel('Sum (a.u.)') |
---|
321 | suptitle(sprintf('Cell %d',3+isup)) |
---|
322 | |
---|
323 | h2=subplot(2,2,2); |
---|
324 | plot(AM.DataR.Q((17:24)+ishift,turnnum)','.-') |
---|
325 | grid on |
---|
326 | ylabel('Quad (a.u.)') |
---|
327 | |
---|
328 | h3=subplot(2,2,3); |
---|
329 | plot(AM.DataR.X((17:24)+ishift,turnnum)','.-') |
---|
330 | grid on |
---|
331 | ylabel('X(mm)') |
---|
332 | xlabel('BPM number') |
---|
333 | |
---|
334 | h4=subplot(2,2,4); |
---|
335 | plot(AM.DataR.Z((17:24)+ishift,turnnum)','.-') |
---|
336 | grid on |
---|
337 | ylabel('Z(mm)') |
---|
338 | xlabel('BPM number') |
---|
339 | |
---|
340 | linkaxes([h1 h2 h3 h4],'x'); |
---|
341 | |
---|
342 | figure |
---|
343 | |
---|
344 | h1=subplot(2,2,1); |
---|
345 | plot(AM.DataR.Sum((25:31)+ishift,turnnum)','.-') |
---|
346 | grid on |
---|
347 | ylabel('Sum (a.u.)') |
---|
348 | suptitle(sprintf('Cell %d',4+isup)) |
---|
349 | |
---|
350 | h2=subplot(2,2,2); |
---|
351 | plot(AM.DataR.Q((25:31)+ishift,turnnum)','.-') |
---|
352 | grid on |
---|
353 | ylabel('Quad (a.u.)') |
---|
354 | |
---|
355 | h3=subplot(2,2,3); |
---|
356 | plot(AM.DataR.X((25:31)+ishift,turnnum)','.-') |
---|
357 | grid on |
---|
358 | ylabel('X(mm)') |
---|
359 | xlabel('BPM number') |
---|
360 | |
---|
361 | h4=subplot(2,2,4); |
---|
362 | plot(AM.DataR.Z((25:31)+ishift,turnnum)','.-') |
---|
363 | grid on |
---|
364 | ylabel('Z(mm)') |
---|
365 | xlabel('BPM number') |
---|
366 | |
---|
367 | linkaxes([h1 h2 h3 h4],'x'); |
---|
368 | |
---|
369 | |
---|
370 | %% Superperiod 4 |
---|
371 | isup = 4*3; |
---|
372 | ishift = 30*3; |
---|
373 | figure |
---|
374 | |
---|
375 | h1=subplot(2,2,1); |
---|
376 | plot(AM.DataR.Sum((1:8)+ishift ,turnnum)','.-') |
---|
377 | grid on |
---|
378 | ylabel('Sum (a.u.)') |
---|
379 | suptitle(sprintf('Cell %d',1+isup)) |
---|
380 | |
---|
381 | h2=subplot(2,2,2); |
---|
382 | plot(AM.DataR.Q((1:8)+ishift ,turnnum)','.-') |
---|
383 | grid on |
---|
384 | ylabel('Quad (a.u.)') |
---|
385 | |
---|
386 | h3=subplot(2,2,3); |
---|
387 | plot(AM.DataR.X((1:8)+ishift,turnnum)','.-') |
---|
388 | grid on |
---|
389 | ylabel('X(mm)') |
---|
390 | xlabel('BPM number') |
---|
391 | |
---|
392 | h4=subplot(2,2,4); |
---|
393 | plot(AM.DataR.Z((1:8)+ishift,turnnum)','.-') |
---|
394 | grid on |
---|
395 | ylabel('Z(mm)') |
---|
396 | xlabel('BPM number') |
---|
397 | |
---|
398 | linkaxes([h1 h2 h3 h4],'x'); |
---|
399 | |
---|
400 | figure |
---|
401 | |
---|
402 | h1=subplot(2,2,1); |
---|
403 | plot(AM.DataR.Sum((9:16)+ishift,turnnum)','.-') |
---|
404 | grid on |
---|
405 | ylabel('Sum (a.u.)') |
---|
406 | suptitle(sprintf('Cell %d',2+isup)) |
---|
407 | |
---|
408 | h2=subplot(2,2,2); |
---|
409 | plot(AM.DataR.Q((9:16)+ishift,turnnum)','.-') |
---|
410 | grid on |
---|
411 | ylabel('Quad (a.u.)') |
---|
412 | |
---|
413 | h3=subplot(2,2,3); |
---|
414 | plot(AM.DataR.X((9:16)+ishift,turnnum)','.-') |
---|
415 | grid on |
---|
416 | ylabel('X(mm)') |
---|
417 | xlabel('BPM number') |
---|
418 | |
---|
419 | h4=subplot(2,2,4); |
---|
420 | plot(AM.DataR.Z((9:16)+ishift,turnnum)','.-') |
---|
421 | grid on |
---|
422 | ylabel('Z(mm)') |
---|
423 | xlabel('BPM number') |
---|
424 | |
---|
425 | linkaxes([h1 h2 h3 h4],'x'); |
---|
426 | |
---|
427 | figure |
---|
428 | |
---|
429 | h1=subplot(2,2,1); |
---|
430 | plot(AM.DataR.Sum((17:24)+ishift,turnnum)','.-') |
---|
431 | grid on |
---|
432 | ylabel('Sum (a.u.)') |
---|
433 | suptitle(sprintf('Cell %d',3+isup)) |
---|
434 | |
---|
435 | h2=subplot(2,2,2); |
---|
436 | plot(AM.DataR.Q((17:24)+ishift,turnnum)','.-') |
---|
437 | grid on |
---|
438 | ylabel('Quad (a.u.)') |
---|
439 | |
---|
440 | h3=subplot(2,2,3); |
---|
441 | plot(AM.DataR.X((17:24)+ishift,turnnum)','.-') |
---|
442 | grid on |
---|
443 | ylabel('X(mm)') |
---|
444 | xlabel('BPM number') |
---|
445 | |
---|
446 | h4=subplot(2,2,4); |
---|
447 | plot(AM.DataR.Z((17:24)+ishift,turnnum)','.-') |
---|
448 | grid on |
---|
449 | ylabel('Z(mm)') |
---|
450 | xlabel('BPM number') |
---|
451 | |
---|
452 | linkaxes([h1 h2 h3 h4],'x'); |
---|
453 | |
---|
454 | figure |
---|
455 | |
---|
456 | h1=subplot(2,2,1); |
---|
457 | plot(AM.DataR.Sum(114:end,turnnum)','.-') |
---|
458 | grid on |
---|
459 | ylabel('Sum (a.u.)') |
---|
460 | suptitle(sprintf('Cell %d',4+isup)) |
---|
461 | |
---|
462 | h2=subplot(2,2,2); |
---|
463 | plot(AM.DataR.Q(114:end,turnnum)','.-') |
---|
464 | grid on |
---|
465 | ylabel('Quad (a.u.)') |
---|
466 | |
---|
467 | h3=subplot(2,2,3); |
---|
468 | plot(AM.DataR.X(114:end,turnnum)','.-') |
---|
469 | grid on |
---|
470 | ylabel('X(mm)') |
---|
471 | xlabel('BPM number') |
---|
472 | |
---|
473 | h4=subplot(2,2,4); |
---|
474 | plot(AM.DataR.Z(114:end,turnnum)','.-') |
---|
475 | grid on |
---|
476 | ylabel('Z(mm)') |
---|
477 | xlabel('BPM number') |
---|
478 | |
---|
479 | linkaxes([h1 h2 h3 h4],'x'); |
---|
480 | |
---|
481 | %% |
---|
482 | |
---|
483 | |
---|
484 | figure |
---|
485 | |
---|
486 | h1=subplot(2,2,1); |
---|
487 | plot(AM.DataR.Va(114:end,turnnum)','.-') |
---|
488 | grid on |
---|
489 | ylabel('Va (a.u.)') |
---|
490 | suptitle(sprintf('Cell %d',4+isup)) |
---|
491 | |
---|
492 | h2=subplot(2,2,2); |
---|
493 | plot(AM.DataR.Vb(114:end,turnnum)','.-') |
---|
494 | grid on |
---|
495 | ylabel('Vb (a.u.)') |
---|
496 | |
---|
497 | h3=subplot(2,2,3); |
---|
498 | plot(AM.DataR.Vc(114:end,turnnum)','.-') |
---|
499 | grid on |
---|
500 | ylabel('Vc (a.u.)') |
---|
501 | xlabel('BPM number') |
---|
502 | |
---|
503 | h4=subplot(2,2,4); |
---|
504 | plot(AM.DataR.Vd(114:end,turnnum)','.-') |
---|
505 | grid on |
---|
506 | ylabel('Vd (a.u.)') |
---|
507 | xlabel('BPM number') |
---|
508 | |
---|
509 | linkaxes([h1 h2 h3 h4],'x'); |
---|
510 | |
---|
511 | |
---|
512 | %% |
---|
513 | etax = modeldisp('BPMx'); |
---|
514 | |
---|
515 | %% |
---|
516 | ZFFT = fft(AM.DataR.Z(1,:)); |
---|
517 | figure |
---|
518 | zlin = (1:length(ZFFT))/length(ZFFT); |
---|
519 | plot(zlin,abs(ZFFT)) |
---|
520 | %% |
---|
521 | mesh(abs(fft(AM.DataR.Z(:,:)))) |
---|
522 | |
---|