function [TAS,r,r_prod] = GetCavity(cav_name,varargin) % Return T and r coefficient of a given cavity % TAS vector contains the 4 T coeffs, then 4 A coeffs, then 4 S coeffs if strcmp(cav_name,'SBOX_ULE')==1 TAS(1) = 180e-6; % T TAS(2) = 2e-6; TAS(3) = 2e-6; TAS(4) = 2e-6; TAS(5) = 1.15e-6; % A TAS(6) = 1.27e-6; TAS(7) = 1.2e-6; TAS(8) = 1e-6; TAS(9) = 7e-6; % S TAS(10) = 4.5e-6; TAS(11) = 3.6e-6; TAS(12) = 9e-6; % TAS(1) = 180e-6; % T % TAS(2) = 3.2e-6; % TAS(3) = 2.8e-6; % TAS(4) = 2.85e-6; % TAS(5) = 30e-6; % A % TAS(6) = 30e-6; % TAS(7) = 30e-6; % TAS(8) = 30e-6; % TAS(9) = 20e-6; % S % TAS(10) = 20e-6; % TAS(11) = 20e-6; % TAS(12) = 20e-6; elseif strcmp(cav_name,'ThomX')==1 TAS(1) = 120e-6; % T TAS(2) = 1.5e-6; TAS(3) = 1.5e-6; TAS(4) = 1.5e-6; TAS(5) = 0.4e-6; % A TAS(6) = 0.24e-6; TAS(7) = 0.24e-6; TAS(8) = 0.27e-6; TAS(9) = 4e-6; % S TAS(10) = 4.5e-6; TAS(11) = 10e-6; TAS(12) = 4.5e-6; elseif strcmp(cav_name,'MIGHTY_low')==1 TAS(1) = 1060e-6; TAS(2) = 330e-6; TAS(3) = 330e-6; TAS(4) = 330e-6; TAS(5:12) = 0; elseif strcmp(cav_name,'Fab_cav')==1 TAS(1) = 100e-6; TAS(2) = 10e-6; TAS(3) = 10e-6; TAS(4) = 10e-6; TAS(5:12) = 0; end switch nargin case 2 TAS = repmat(TAS,numel(varargin{1}),1); TAS(:,1) = varargin{1}; case 3 TAS = repmat(TAS,numel(varargin{1}),1); TAS(:,1) = varargin{1}; TAS(:,2) = varargin{2}; end % Field reflection coeffs rr = @(TAS) (1-sum(TAS,2)).^(1/2); for ii = 1:4 r(:,ii) = rr(TAS(:,ii:4:12)); end r_prod = prod(r,2); end