source: MML/trunk/mml/doc_html/mml/at/family2atindex.html @ 4

Last change on this file since 4 was 4, checked in by zhangj, 10 years ago

Initial import--MML version from SOLEIL@2013

File size: 8.7 KB
Line 
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 &copy; 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> &gt;  <a href="../index.html">mml</a> &gt; <a href="index.html">at</a> &gt; family2atindex.m</div>
16
17<!--<table width="100%"><tr><td align="left"><a href="../../index.html"><img alt="<" border="0" src="../../left.png">&nbsp;Master index</a></td>
18<td align="right"><a href="index.html">Index for mml/at&nbsp;<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>
53This function calls:
54<ul style="list-style-image:url(../../matlabicon.gif)">
55</ul>
56This 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>
640002 <span class="comment">%FAMILY2ATINDEX - Returns the AT index for a given family</span>
650003 <span class="comment">%  ATIndexList = family2atindex(Family, DeviceList)</span>
660004 <span class="comment">%</span>
670005 <span class="comment">%  INPUTS</span>
680006 <span class="comment">%  1. Family - Family Name</span>
690007 <span class="comment">%              Accelerator Object</span>
700008 <span class="comment">%              Cell Array of Accelerator Objects or Family Names</span>
710009 <span class="comment">%              AT FamName (or 'All' every AT index)</span>
720010 <span class="comment">%  2. DeviceList - Device list {Default: the entire family (familydev('Family',0))}</span>
730011 <span class="comment">%</span>
740012 <span class="comment">%  OUTPUTS</span>
750013 <span class="comment">%  1. ATIndexList - List of AT indexes referenced to THERING</span>
760014 <span class="comment">%                   If the family a split magnet, then muliply columns will be output</span>
770015 <span class="comment">%</span>
780016 <span class="comment">%  NOTES</span>
790017 <span class="comment">%  1. If Family is a cell array, then DeviceList must also be a cell array</span>
800018 <span class="comment">%  2. If using AT FamName, then DeviceList is index vector, ie,</span>
810019 <span class="comment">%              Length = THERING{ATIndexList}.Length(DeviceList)</span>
820020 <span class="comment">%</span>
830021 <span class="comment">%  Written by Greg Portmann</span>
840022
850023 ErrorFlag = 0;
860024
870025 <span class="keyword">if</span> nargin == 0,
880026     error(<span class="string">'Must have at least one input (Family or Channel Name).'</span>);
890027 <span class="keyword">end</span>
900028
910029
920030 [ATIndexList, ErrorFlag] = getfamilydata(Family, <span class="string">'AT'</span>, <span class="string">'ATIndex'</span>, varargin{:});
930031
940032 <span class="keyword">if</span> isempty(ATIndexList)
950033     <span class="comment">% Try an AT family</span>
960034     <span class="keyword">global</span> THERING
970035     
980036     <span class="keyword">if</span> strcmpi(Family, <span class="string">'All'</span>)
990037         ATIndexList = (1:length(THERING))';
1000038     <span class="keyword">else</span>
1010039         ATIndexList = findcells(THERING, <span class="string">'FamName'</span>, Family);
1020040         ATIndexList = ATIndexList(:);
1030041     <span class="keyword">end</span>
1040042     
1050043     <span class="keyword">if</span> nargin &gt;= 2
1060044         <span class="keyword">if</span> ~isempty(varargin{1})
1070045             <span class="keyword">if</span> size(varargin{1},2) == 2
1080046                 varargin{1} = varargin{1}(:,2);
1090047             <span class="keyword">end</span>
1100048         <span class="keyword">end</span>
1110049         ATIndexList = ATIndexList(varargin{1});
1120050     <span class="keyword">end</span>
1130051 <span class="keyword">end</span>
1140052</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> &copy; 2003</address>
116</body>
117</html>
Note: See TracBrowser for help on using the repository browser.