1 | function [XData,ZData] = soleilbpms |
---|
2 | %SOLEIBPMS - Gets horizontal and vertical orbit read into valid BPMS |
---|
3 | % [x,z] = soleilbpms |
---|
4 | % |
---|
5 | % OUTPUTS |
---|
6 | % 1. x - horizontal beam position |
---|
7 | % 2. z - vertical beam position |
---|
8 | % |
---|
9 | % NOTES |
---|
10 | % To be modified to get X and Z at once |
---|
11 | % To get all bpm at once |
---|
12 | |
---|
13 | % |
---|
14 | % Written by Laurent S. Nadolski |
---|
15 | |
---|
16 | BPMFamily = {gethbpmfamily, getvbpmfamily}; |
---|
17 | |
---|
18 | % %read horizontal orbit for status ==1 bpms |
---|
19 | % TangoNames = getfamilydata('BPMx','Monitor','TangoNames'); |
---|
20 | % status = find(getfamilydata('BPMx','Status')); |
---|
21 | % x = getam(char(TangoNames(status,:))); |
---|
22 | % |
---|
23 | % %read horizontal orbit for status ==1 bpms |
---|
24 | % TangoNames = getfamilydata('BPMz','Monitor','TangoNames'); |
---|
25 | % status = find(getfamilydata('BPMz','Status')); |
---|
26 | % z = getam(char(TangoNames(status,:))); |
---|
27 | |
---|
28 | GroupID = getfamilydata('BPMx','GroupId'); |
---|
29 | R = tango_group_read_attribute(GroupID, 'XPosSA', 0); |
---|
30 | |
---|
31 | if tango_error |
---|
32 | tango_print_error_stack |
---|
33 | return; |
---|
34 | end |
---|
35 | |
---|
36 | for k = 1:length(R.replies) |
---|
37 | XData(k,1) = R.replies(k).value(1); |
---|
38 | end |
---|
39 | Status = getfamilydata(BPMFamily{1},'Status'); |
---|
40 | XData = XData(find(Status)); |
---|
41 | |
---|
42 | R = tango_group_read_attribute(GroupID, 'ZPosSA', 0); |
---|
43 | |
---|
44 | if tango_error |
---|
45 | tango_print_error_stack |
---|
46 | return; |
---|
47 | end |
---|
48 | |
---|
49 | for k = 1:length(R.replies) |
---|
50 | ZData(k,1) = R.replies(k).value(1); |
---|
51 | end |
---|
52 | |
---|
53 | Status = getfamilydata(BPMFamily{2},'Status'); |
---|
54 | ZData = ZData(find(Status)); |
---|