[xp,yp,zp]=tel2base(x,y,z) Make the set of baseline vectors for a given array of telescopes
0001 function [xp,yp,zp]=tel2base(x,y,z) 0002 % [xp,yp,zp]=tel2base(x,y,z) 0003 % 0004 % Make the set of baseline vectors for a given array of telescopes 0005 0006 s = size(x); 0007 if(min(s)==1) 0008 % we have the old way...single vectors 0009 k=1; 0010 for i=1:length(x) 0011 for j=i+1:length(x) 0012 xp(k)=x(i)-x(j); 0013 yp(k)=y(i)-y(j); 0014 zp(k)=z(i)-z(j); 0015 k=k+1; 0016 end 0017 end 0018 else 0019 m = size(x,2); 0020 k=1; 0021 for i=1:m 0022 for j=i+1:m 0023 xp(:,k)=x(:,i)-x(:,j); 0024 yp(:,k)=y(:,i)-y(:,j); 0025 zp(:,k)=z(:,i)-z(:,j); 0026 k=k+1; 0027 end 0028 end 0029 end 0030 0031 return