source: MML/trunk/machine/SOLEIL/StorageRing/bpm/getbpmsum.m @ 17

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

To have a stable version on the server.

  • Property svn:executable set to *
File size: 1.9 KB
Line 
1function [X Z Sum]=getbpmsum(varargin)
2%GETBPMSUM - Get Sum vector for BPM and display it
3%
4%
5%
6%  See Also getbpmrawdata
7
8%
9%% Written by Laurent S. Nadolski
10
11%% UGLY PATCH 122 by HAND
12
13DisplayFlag = 1;
14
15for i = length(varargin):-1:1
16    if strcmpi(varargin{i},'Display')
17        DisplayFlag = 1;
18        varargin(i) = [];
19    elseif strcmpi(varargin{i},'NoDisplay')
20        DisplayFlag = 0;
21        varargin(i) = [];
22    end
23end
24
25% BPM avec status = 1
26indexBPMStatusTo1 = family2status('BPMx') & family2status('BPMz');
27
28% Filtre sur l'index des BPMs (ElementList) avec status = 1 
29BPMlist = getfamilydata('BPMx','ElementList');
30BPMlist = BPMlist(indexBPMStatusTo1);
31
32% Filtre sur le nom des BPMs (DeviceList) avec status = 1
33BPMDlist = getfamilydata('BPMx','DeviceList');
34BPMDlist = BPMDlist(indexBPMStatusTo1,:);
35
36spos = getspos('BPMx');
37Vect = getbpmrawdata(BPMDlist,'Nodisplay','Struct');
38
39Sum = Vect.Data.Sum;
40X = Vect.Data.X;
41Z = Vect.Data.Z;
42[maxSum idx] = max(Sum');
43
44%idx2 = sub2ind(size(AM.Data.Sum), xpos, idx+ishift)
45
46% figure
47% mesh(Vect.Data.Sum)
48
49xdeb=0;
50xfin=350;
51
52xmax=10;
53%xfin=getcircumference;
54
55%&é"idx(1) = 7;
56figure(205)
57h1 = subplot(7,1,[1 2]);
58plot(spos,maxSum,'.-');
59ylabel('Sum Signal Amplitude (u.a.)');
60xaxis([xdeb xfin]);yaxis([0 2*5e08]);
61
62h2 = subplot(7,1,[3 4]);
63plot(spos,X(BPMlist,idx(1)),'.-b');
64% hold on
65% plot(spos,X(1:120,idx(1)+1),'.-r');
66% hold off
67ylabel('X Amplitude (mm)');
68yaxis([-xmax xmax]);xaxis([xdeb xfin]);
69
70h3 = subplot(7,1,[5 6]);
71plot(spos,Z(BPMlist,idx(1)),'.-b');
72% hold on
73% plot(spos,Z(1:120,idx(1))+1,'.-r');
74% hold off
75ylabel('Z Amplitude (mm)');
76yaxis([-xmax xmax]);xaxis([xdeb xfin]);
77
78h4 = subplot(7,1,7);
79drawlattice
80set(h4,'YTick',[])
81xaxis([xdeb xfin]);
82
83grid on
84xlabel('s [mm]');
85
86linkaxes([h1 h2 h3 h4],'x')
87set([h1 h2 h3 h4],'XGrid','On','YGrid','On');
88%xaxis([0 100])
89
90addlabel(1,0,datestr(clock));
91
92% Output data
93X    = X(BPMlist,idx(1));
94Z    = Z(BPMlist,idx(1));
95Sum  = Sum(BPMlist,idx(1));
96
Note: See TracBrowser for help on using the repository browser.