source: MML/trunk/machine/SOLEIL/Booster/applications/track_test.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 10 years ago

Initial import--MML version from SOLEIL@2013

File size: 2.0 KB
Line 
1function track
2
3%[D1 D2 QF QD time]=gettrackinghall('nodisplay');
4
5QVG=10/0.2 ;    %  volt -> T/M
6QVB=0.74/0.55 ; %  volt -> T
7RHO=12.376;
8
9
10QF_cur  =tango_read_attribute('BOO/AE/Tracking','channel2');
11QF_field=tango_read_attribute('BOO/AE/TrackingHall','channel1');
12QD_cur  =tango_read_attribute('BOO/AE/Tracking','channel3');
13QD_field=tango_read_attribute('BOO/AE/TrackingHall','channel2');
14DI_cur  =tango_read_attribute('BOO/AE/Tracking','channel1');
15DI_field=tango_read_attribute('BOO/AE/TrackingHall','channel0');
16
17ncur=length(QF_cur.value);
18nfield=length(QF_field.value);
19
20m=100;
21%lissage field
22fx=fft(QF_field.value);
23fx(m:(nfield-m))=0; % suppression haute frï¿œquence
24DQF_field=-real(ifft(fx));
25fx=fft(QD_field.value);
26fx(m:(nfield-m))=0; % suppression haute frï¿œquence
27DQD_field=real(ifft(fx));
28fx=fft(DI_field.value);
29fx(m:(nfield-m))=0; % suppression haute frï¿œquence
30DDI_field=real(ifft(fx));
31
32%lissage cur
33fx=fft(QF_cur.value);
34fx(m:(ncur-m))=0; % suppression haute frï¿œquence
35DQF_cur=real(ifft(fx));
36fx=fft(QD_cur.value);
37fx(m:(ncur-m))=0; % suppression haute frï¿œquence
38DQD_cur=real(ifft(fx));
39fx=fft(DI_cur.value);
40fx(m:(ncur-m))=0; % suppression haute frï¿œquence
41DDI_cur=real(ifft(fx));
42
43
44
45qf_ratio=(DQF_field - 0.2/200)./DQF_cur;
46millieu=qf_ratio(1750)
47qf_ratio=qf_ratio-millieu;
48
49di_ratio=(DDI_field - 0.0015)./DQF_cur;
50millieu=di_ratio(1750)
51di_ratio=di_ratio-millieu;
52
53% plot(qf_ratio(300:3300),'-r'); hold on;
54% plot(di_ratio(300:3300),'-k'); hold off;
55% ylim([-0.01 0.01]);
56 
57 
58 Kx=DQF_field./DDI_field*(QVG/QVB/RHO);
59 Kz=DQD_field./DDI_field*(QVG/QVB/RHO);
60 K0x=Kx(1750);
61 K0z=Kz(1750);
62 dnux=10*(Kx-K0x)./Kx;
63 dnuz=10*(Kz-K0z)./Kz;
64 
65 [C,IQF]=max((DQF_field));
66 [C,IQD]=max((DQD_field));
67 [C,IDI]=max((DDI_field));
68 sprintf('max = %d %d %d',IQF,IQD,IDI)
69 
70 plot(DQF_field/200,'-r'); hold on;
71 plot(DQD_field/150,'-b'); hold on;
72 plot(DDI_field/550,'-k'); hold off;
73 
74%  plot(dnux(300:3300),'-r'); hold on;
75%  plot(dnuz(300:3300),'-b'); hold off;
76%  ylim([-0.2 0.4]);ylabel('dnux');
77%  xlim([0 3300]);
78%  grid on;
79 
80 
Note: See TracBrowser for help on using the repository browser.