source: MML/trunk/applications/orbit/lib/sortbls.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 varargout=SortBLs(varargin)
2% SortBLs compares vectors for:
3%(1) available electronically     (BL.open)
4%(2) available in response matrix (RSP.ibl)
5%(3) check for user selection     (RSP.ifit)
6
7BL=varargin(1);    BL=BL{1};
8RSP=varargin(2);   RSP=RSP{1};
9
10for ip=2:2
11% compare response matrix with status
12[BL(ip).avail,IA,IB]=intersect(RSP(ip).ibl,BL(ip).open);        %RSP.ibl and BL.open are compressed
13[C,IA]=setdiff(RSP(ip).ibl,RSP(ip).ibl(IA));                     %check for rejected response matrix BLs
14if ~isempty(IA)
15    disp('SortBLs Warning 1A: BLs in response matrix not open');
16    for ii=IA
17        disp(BL(ip).name(ii,:));
18    end
19end
20% [C,IB]=setdiff(BL(ip).open,BL(ip).open(IB));                   %check for rejected OPEN BLs
21% if ~isempty(IB)
22%     disp('SortBLs Warning 1B: BLs with open beamline not in response matrix');
23%     for ii=IB
24%         disp(BL(ip).name(ii,:));
25%     end
26% end
27
28% compare result with fit selection
29[BL(ip).ifit,IA,IB]=intersect(BL(ip).avail,BL(ip).ifit);          %BL.avail and BL.ifit are compressed
30% [C,IA]=setdiff(BL(ip).avail,BL(ip).avail(IA));                %check for rejected available BLs
31% if ~isempty(IA)
32%     disp('SortBLs Warning 2A: BLs with valid status and in response matrix not in fit');
33%     for ii=IA
34%         disp(BL(ip).name(ii,:));
35%     end
36% end
37[C,IB]=setdiff(BL(ip).ifit,BL(ip).ifit(IB));                    %check for rejected fit BLs
38if ~isempty(IB)
39    disp('SortBLs Warning 2B: BLs in fit not do not have valid status or not in response matrix');
40    for ii=IB
41        disp(BL(ip).name(ii,:));
42    end
43end
44
45end  %end of plane loop
46
47
48
49
50% for ip=1:2
51% [n,COR(ip).avail]=intland(COR(ip).status,RSP(ip).ic);  % compare response matrix with status
52%
53% % check against fit vector
54% [n,COR(ip).ifit]  =intland(COR(ip).avail,COR(ip).ifit);
55% end
56
57% % check response matrix against photon beam open
58% for ip=1:2
59%   [n,BL(ip).avail]=intland(BL(ip).open,RSP(ip).ibl);
60% % check against fit vector
61%   [n,BL(ip).ifit] =intland(BL(ip).avail,BL(ip).ifit);
62% end
63
64varargout{1}=BL;
Note: See TracBrowser for help on using the repository browser.