1 | function 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 | |
---|
7 | BL=varargin(1); BL=BL{1}; |
---|
8 | RSP=varargin(2); RSP=RSP{1}; |
---|
9 | |
---|
10 | for 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 |
---|
14 | if ~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 |
---|
19 | end |
---|
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 |
---|
38 | if ~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 |
---|
43 | end |
---|
44 | |
---|
45 | end %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 | |
---|
64 | varargout{1}=BL; |
---|