getat.m 1.44 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
function atstruct = getat(varargin)
%GETAT	% Return an AT structure
%
%ATSTRUCT=GETAT(VARARGIN) scans the input arguments looking for:
%
%- 'opticsname'
%           optics name (defaults to 'theory')
%- '/machfs/appdata/sy/optics/settings/opticsname':
%           full path of optics directory
%- atstruct:
%           AT structure
%- sy.model:
%           sy.model object
%
%
%ATSTRUCT:	Resulting AT structure
%
%GETAT(...,'energy',energy)
%   Set the ring energy
%
%GETAT(...,'reduce',true,'keep',pattern)
%   Remove elements with PassMethod='IdentityPass' and merge adjacent
%   similar elements, but keeps elements with FamName matching "pattern"
%   Pattern may be a logical mask. (Default: 'BPM.*|ID.*').
%
%GETAT(...,'remove',famnames)
%   remove elements identified by the family names (cell array)
%
%GETAT(...,'MaxOrder',n)
%   Limit the order of polynomial field expansion to n at maximum.
%   Default 999
%
%GETAT(...,'NumIntSteps',m)
%   Set the NumIntSteps integration parameter to at least m.
%   Default 20
%
%GETAT(...,'QuadFields',quadfields)
%   When reading a BETA file, set quadrupoles fields to the specified ones.
%   Default: {}
%
%GETAT(...,'BendFields',bendfields)
%   When reading a BETA file, set bending magnet fields to the specified ones.
%   Default: {}
%
%GETAT(...,'DeviceNames',true)
%   add device names in AT structure.

[machid,location,args]=atmodel.getpath('tl1',varargin{:});
atstruct=atmodel.getatstruct(machid,location,args{:});

end