ind=ant_to_ind(a,nant) Return a "correlator mask vector" which is all 1 for baselines of antennas given in input ant. ant is assumed numbering from zero - i.e. 0 through 7 for SZA e.g.: sza_ant_to_ind([0,8],13) or if you want actual array indexes do: find(sza_ant_to_ind([0,8],13))
0001 function ind=ant_to_ind(ant,nant) 0002 % ind=ant_to_ind(a,nant) 0003 % 0004 % Return a "correlator mask vector" which is all 1 0005 % for baselines of antennas given in input ant. 0006 % ant is assumed numbering from zero - i.e. 0 through 7 for SZA 0007 % 0008 % e.g.: sza_ant_to_ind([0,8],13) 0009 % or if you want actual array indexes do: 0010 % find(sza_ant_to_ind([0,8],13)) 0011 0012 if(~exist('nant')) 0013 nant=8; 0014 end 0015 0016 % input assumes ant numbered from zero 0017 ant=ant+1; 0018 if(any(ant<1) | any(ant>nant)) 0019 error('ant number out of range'); 0020 end 0021 0022 ind=zeros(1,nant*(nant-1)/2); 0023 0024 if(isempty(ant)) 0025 return 0026 end 0027 0028 k=1; 0029 for i=1:nant 0030 for j=i+1:nant 0031 if(any(ant==i) | any(ant==j)) 0032 ind(k)=1; 0033 end 0034 k=k+1; 0035 end 0036 end 0037 0038 return