1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
---|
2 | "http://www.w3.org/TR/REC-html40/loose.dtd"> |
---|
3 | <html> |
---|
4 | <head> |
---|
5 | <title>Description of family2atindex</title> |
---|
6 | <meta name="keywords" content="family2atindex"> |
---|
7 | <meta name="description" content="FAMILY2ATINDEX - Returns the AT index for a given family"> |
---|
8 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
---|
9 | <meta name="generator" content="m2html © 2003 Guillaume Flandin"> |
---|
10 | <meta name="robots" content="index, follow"> |
---|
11 | <link type="text/css" rel="stylesheet" href="../../m2html.css"> |
---|
12 | </head> |
---|
13 | <body> |
---|
14 | <a name="_top"></a> |
---|
15 | <div><a href="../../index.html">Home</a> > <a href="../index.html">mml</a> > <a href="index.html">at</a> > family2atindex.m</div> |
---|
16 | |
---|
17 | <!--<table width="100%"><tr><td align="left"><a href="../../index.html"><img alt="<" border="0" src="../../left.png"> Master index</a></td> |
---|
18 | <td align="right"><a href="index.html">Index for mml/at <img alt=">" border="0" src="../../right.png"></a></td></tr></table>--> |
---|
19 | |
---|
20 | <h1>family2atindex |
---|
21 | </h1> |
---|
22 | |
---|
23 | <h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2> |
---|
24 | <div class="box"><strong>FAMILY2ATINDEX - Returns the AT index for a given family</strong></div> |
---|
25 | |
---|
26 | <h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2> |
---|
27 | <div class="box"><strong>function [ATIndexList, ErrorFlag] = family2atindex(Family, varargin); </strong></div> |
---|
28 | |
---|
29 | <h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2> |
---|
30 | <div class="fragment"><pre class="comment">FAMILY2ATINDEX - Returns the AT index for a given family |
---|
31 | ATIndexList = family2atindex(Family, DeviceList) |
---|
32 | |
---|
33 | INPUTS |
---|
34 | 1. Family - Family Name |
---|
35 | Accelerator Object |
---|
36 | Cell Array of Accelerator Objects or Family Names |
---|
37 | AT FamName (or 'All' every AT index) |
---|
38 | 2. DeviceList - Device list {Default: the entire family (familydev('Family',0))} |
---|
39 | |
---|
40 | OUTPUTS |
---|
41 | 1. ATIndexList - List of AT indexes referenced to THERING |
---|
42 | If the family a split magnet, then muliply columns will be output |
---|
43 | |
---|
44 | NOTES |
---|
45 | 1. If Family is a cell array, then DeviceList must also be a cell array |
---|
46 | 2. If using AT FamName, then DeviceList is index vector, ie, |
---|
47 | Length = THERING{ATIndexList}.Length(DeviceList) |
---|
48 | |
---|
49 | Written by Greg Portmann</pre></div> |
---|
50 | |
---|
51 | <!-- crossreference --> |
---|
52 | <h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2> |
---|
53 | This function calls: |
---|
54 | <ul style="list-style-image:url(../../matlabicon.gif)"> |
---|
55 | </ul> |
---|
56 | This function is called by: |
---|
57 | <ul style="list-style-image:url(../../matlabicon.gif)"> |
---|
58 | <li><a href="atindex2family.html" class="code" title="function [Family, DeviceList, FamilyCell, DeviceListCell, ErrorFlag] = atindex2family(ATIndex, varargin);">atindex2family</a> ATINDEX2FAMILY - Returns the AT index for a given family</li><li><a href="calccoupling.html" class="code" title="function [Tilt, Eta, Ratio, ENV, DP, DL] = calccoupling">calccoupling</a> CALCCOUPLING - Calculates the coupling and tilt of the AT model</li><li><a href="drawlattice.html" class="code" title="function drawlattice(Offset, Scaling, hAxes)">drawlattice</a> DRAWLATTICE - Draws the AT lattice to a figure</li><li><a href="getatfield.html" class="code" title="function [FieldValue, ATIndexList] = getatfield(Family, Field, varargin)">getatfield</a> GETATFIELD - Returns the contents of an AT model field</li><li><a href="getpassmethod.html" class="code" title="function [PassMethod, ATIndex, FamName] = getpassmethod(ATIndex, DeviceList)">getpassmethod</a> GETPASSMETHOD - Gets the PassMethod field</li><li><a href="getpvmodel.html" class="code" title="function [AM, tout, DataTime, ErrorFlag] = getpvmodel(varargin)">getpvmodel</a> GETPVMODEL - Get the model value</li><li><a href="getturns.html" class="code" title="function [xAllBPMs, ATindex, LostBeam] = getturns(x0, N, Family, DeviceList)">getturns</a> GETTURNS - Single particle tracking for multiple turns</li><li><a href="linepass1turn.html" class="code" title="function [x, ATindex, LostBeam] = linepass1turn(x0, Family0, DeviceList0, Family, DeviceList)">linepass1turn</a> LINEPASS1TURN - Track particle forward or backwards in one turn of the ring</li><li><a href="modeldisp.html" class="code" title="function [Dx, Dy, Sx, Sy] = modeldisp(varargin)">modeldisp</a> MODELDISP - Returns the dispersion function of the model</li><li><a href="modelsextu_off.html" class="code" title="function modelsextu_off">modelsextu_off</a> MODELSEXTU_OFF - Turns on sextupoles in the AT model</li><li><a href="modelsextu_on.html" class="code" title="function modelsextu_on">modelsextu_on</a> MODELSEXTU_ON - Turns on sextupoles in the AT model</li><li><a href="modeltwiss.html" class="code" title="function [TwissX, TwissY, Sx, Sy, Tune] = modeltwiss(varargin)">modeltwiss</a> MODELTWISS - Returns a twiss function of the model</li><li><a href="setatfield.html" class="code" title="function ATIndexList = family2atfield(Family, Field, Value, varargin)">setatfield</a> SETATFIELD - Returns the contents of an AT model field</li><li><a href="setpassmethod.html" class="code" title="function setpassmethod(ATIndex, PassMethod, DeviceList)">setpassmethod</a> SETPASSMETHOD - Sets the PassMethod</li><li><a href="setpvmodel.html" class="code" title="function ErrorFlag = setpvmodel(varargin)">setpvmodel</a> SETPVMODEL - Sets the model</li></ul> |
---|
59 | <!-- crossreference --> |
---|
60 | |
---|
61 | |
---|
62 | <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2> |
---|
63 | <div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [ATIndexList, ErrorFlag] = family2atindex(Family, varargin);</a> |
---|
64 | 0002 <span class="comment">%FAMILY2ATINDEX - Returns the AT index for a given family</span> |
---|
65 | 0003 <span class="comment">% ATIndexList = family2atindex(Family, DeviceList)</span> |
---|
66 | 0004 <span class="comment">%</span> |
---|
67 | 0005 <span class="comment">% INPUTS</span> |
---|
68 | 0006 <span class="comment">% 1. Family - Family Name</span> |
---|
69 | 0007 <span class="comment">% Accelerator Object</span> |
---|
70 | 0008 <span class="comment">% Cell Array of Accelerator Objects or Family Names</span> |
---|
71 | 0009 <span class="comment">% AT FamName (or 'All' every AT index)</span> |
---|
72 | 0010 <span class="comment">% 2. DeviceList - Device list {Default: the entire family (familydev('Family',0))}</span> |
---|
73 | 0011 <span class="comment">%</span> |
---|
74 | 0012 <span class="comment">% OUTPUTS</span> |
---|
75 | 0013 <span class="comment">% 1. ATIndexList - List of AT indexes referenced to THERING</span> |
---|
76 | 0014 <span class="comment">% If the family a split magnet, then muliply columns will be output</span> |
---|
77 | 0015 <span class="comment">%</span> |
---|
78 | 0016 <span class="comment">% NOTES</span> |
---|
79 | 0017 <span class="comment">% 1. If Family is a cell array, then DeviceList must also be a cell array</span> |
---|
80 | 0018 <span class="comment">% 2. If using AT FamName, then DeviceList is index vector, ie,</span> |
---|
81 | 0019 <span class="comment">% Length = THERING{ATIndexList}.Length(DeviceList)</span> |
---|
82 | 0020 <span class="comment">%</span> |
---|
83 | 0021 <span class="comment">% Written by Greg Portmann</span> |
---|
84 | 0022 |
---|
85 | 0023 ErrorFlag = 0; |
---|
86 | 0024 |
---|
87 | 0025 <span class="keyword">if</span> nargin == 0, |
---|
88 | 0026 error(<span class="string">'Must have at least one input (Family or Channel Name).'</span>); |
---|
89 | 0027 <span class="keyword">end</span> |
---|
90 | 0028 |
---|
91 | 0029 |
---|
92 | 0030 [ATIndexList, ErrorFlag] = getfamilydata(Family, <span class="string">'AT'</span>, <span class="string">'ATIndex'</span>, varargin{:}); |
---|
93 | 0031 |
---|
94 | 0032 <span class="keyword">if</span> isempty(ATIndexList) |
---|
95 | 0033 <span class="comment">% Try an AT family</span> |
---|
96 | 0034 <span class="keyword">global</span> THERING |
---|
97 | 0035 |
---|
98 | 0036 <span class="keyword">if</span> strcmpi(Family, <span class="string">'All'</span>) |
---|
99 | 0037 ATIndexList = (1:length(THERING))'; |
---|
100 | 0038 <span class="keyword">else</span> |
---|
101 | 0039 ATIndexList = findcells(THERING, <span class="string">'FamName'</span>, Family); |
---|
102 | 0040 ATIndexList = ATIndexList(:); |
---|
103 | 0041 <span class="keyword">end</span> |
---|
104 | 0042 |
---|
105 | 0043 <span class="keyword">if</span> nargin >= 2 |
---|
106 | 0044 <span class="keyword">if</span> ~isempty(varargin{1}) |
---|
107 | 0045 <span class="keyword">if</span> size(varargin{1},2) == 2 |
---|
108 | 0046 varargin{1} = varargin{1}(:,2); |
---|
109 | 0047 <span class="keyword">end</span> |
---|
110 | 0048 <span class="keyword">end</span> |
---|
111 | 0049 ATIndexList = ATIndexList(varargin{1}); |
---|
112 | 0050 <span class="keyword">end</span> |
---|
113 | 0051 <span class="keyword">end</span> |
---|
114 | 0052</pre></div> |
---|
115 | <hr><address>Generated on Mon 21-May-2007 15:29:18 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> © 2003</address> |
---|
116 | </body> |
---|
117 | </html> |
---|