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 plotoffsetorbit</title> |
---|
6 | <meta name="keywords" content="plotoffsetorbit"> |
---|
7 | <meta name="description" content="PLOTOFFSETORBIT - Plots the offset orbit"> |
---|
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> > plotoffsetorbit.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 <img alt=">" border="0" src="../right.png"></a></td></tr></table>--> |
---|
19 | |
---|
20 | <h1>plotoffsetorbit |
---|
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>PLOTOFFSETORBIT - Plots the offset orbit</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 plotoffsetorbit(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">PLOTOFFSETORBIT - Plots the offset orbit |
---|
31 | plotoffsetorbit(XAxisFlag) |
---|
32 | |
---|
33 | INPUTS |
---|
34 | 1. XAxisFlag - 'Position' in meters {Default} or 'Phase' |
---|
35 | |
---|
36 | See also <a href="plotgoldenorbit.html" class="code" title="function plotgoldenorbit(varargin)">plotgoldenorbit</a> |
---|
37 | |
---|
38 | See also <a href="plotgoldenorbit.html" class="code" title="function plotgoldenorbit(varargin)">plotgoldenorbit</a>, <a href="setoffset.html" class="code" title="function varargout = setoffset(varargin)">setoffset</a>, <a href="getoffset.html" class="code" title="function Data = getoffset(varargin)">getoffset</a>, <a href="saveoffsetorbit.html" class="code" title="function saveoffsetorbit(FileName)">saveoffsetorbit</a></pre></div> |
---|
39 | |
---|
40 | <!-- crossreference --> |
---|
41 | <h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
42 | This function calls: |
---|
43 | <ul style="list-style-image:url(../matlabicon.gif)"> |
---|
44 | <li><a href="family2dev.html" class="code" title="function DeviceList = family2dev(Family, varargin);">family2dev</a> FAMILY2DEV - Return the device list for a family</li><li><a href="getfamilydata.html" class="code" title="function [Data, ErrorFlag] = getfamilydata(Family, Field1, Field2, DeviceList)">getfamilydata</a> GETFAMILYDATA - Gets data associated with the accelerator control</li><li><a href="gethbpmfamily.html" class="code" title="function Family = gethbpmfamily">gethbpmfamily</a> GETHBPMFAMILY - Return the default horizontal BPM family</li><li><a href="getoffset.html" class="code" title="function Data = getoffset(varargin)">getoffset</a> GETOFFSET - Returns the offset values for a family</li><li><a href="getspos.html" class="code" title="function S = getspos(Family, DeviceList)">getspos</a> GETSPOS - Returns the longitudinal position in meters</li><li><a href="getvbpmfamily.html" class="code" title="function Family = getvbpmfamily">getvbpmfamily</a> GETVBPMFAMILY - Return the default vertical BPM family</li><li><a href="hw2physics.html" class="code" title="function S = hw2physics(Family, Field, value, DeviceList, Energy)">hw2physics</a> HW2PHYSICS - Converts from 'Hardware' units to 'Physics' units</li></ul> |
---|
45 | This function is called by: |
---|
46 | <ul style="list-style-image:url(../matlabicon.gif)"> |
---|
47 | </ul> |
---|
48 | <!-- crossreference --> |
---|
49 | |
---|
50 | |
---|
51 | <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
52 | <div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function plotoffsetorbit(varargin)</a> |
---|
53 | 0002 <span class="comment">%PLOTOFFSETORBIT - Plots the offset orbit</span> |
---|
54 | 0003 <span class="comment">% plotoffsetorbit(XAxisFlag)</span> |
---|
55 | 0004 <span class="comment">%</span> |
---|
56 | 0005 <span class="comment">% INPUTS</span> |
---|
57 | 0006 <span class="comment">% 1. XAxisFlag - 'Position' in meters {Default} or 'Phase'</span> |
---|
58 | 0007 <span class="comment">%</span> |
---|
59 | 0008 <span class="comment">% See also plotgoldenorbit</span> |
---|
60 | 0009 <span class="comment">%</span> |
---|
61 | 0010 <span class="comment">% See also plotgoldenorbit, setoffset, getoffset, saveoffsetorbit</span> |
---|
62 | 0011 |
---|
63 | 0012 <span class="comment">%</span> |
---|
64 | 0013 <span class="comment">% Written by Gregory J. Portmann</span> |
---|
65 | 0014 <span class="comment">% Modifed by Laurent S. Nadolski</span> |
---|
66 | 0015 |
---|
67 | 0016 XAxisFlag = <span class="string">'Position'</span>; |
---|
68 | 0017 |
---|
69 | 0018 <span class="comment">% Input parsing</span> |
---|
70 | 0019 <span class="keyword">for</span> i = length(varargin):-1:1 |
---|
71 | 0020 <span class="keyword">if</span> isstruct(varargin{i}) |
---|
72 | 0021 <span class="comment">% Ignor structures</span> |
---|
73 | 0022 <span class="keyword">elseif</span> iscell(varargin{i}) |
---|
74 | 0023 <span class="comment">% Ignor cells</span> |
---|
75 | 0024 <span class="keyword">elseif</span> strcmpi(varargin{i},<span class="string">'struct'</span>) |
---|
76 | 0025 <span class="comment">% Just remove</span> |
---|
77 | 0026 varargin(i) = []; |
---|
78 | 0027 <span class="keyword">elseif</span> strcmpi(varargin{i},<span class="string">'numeric'</span>) |
---|
79 | 0028 <span class="comment">% Just remove</span> |
---|
80 | 0029 varargin(i) = []; |
---|
81 | 0030 <span class="keyword">elseif</span> strcmpi(varargin{i},<span class="string">'Position'</span>) |
---|
82 | 0031 XAxisFlag = <span class="string">'Position'</span>; |
---|
83 | 0032 varargin(i) = []; |
---|
84 | 0033 <span class="keyword">elseif</span> strcmpi(varargin{i},<span class="string">'Phase'</span>) |
---|
85 | 0034 XAxisFlag = <span class="string">'Phase'</span>; |
---|
86 | 0035 varargin(i) = []; |
---|
87 | 0036 <span class="keyword">end</span> |
---|
88 | 0037 <span class="keyword">end</span> |
---|
89 | 0038 |
---|
90 | 0039 BPMxFamily = <a href="gethbpmfamily.html" class="code" title="function Family = gethbpmfamily">gethbpmfamily</a>; |
---|
91 | 0040 BPMyFamily = <a href="getvbpmfamily.html" class="code" title="function Family = getvbpmfamily">getvbpmfamily</a>; |
---|
92 | 0041 |
---|
93 | 0042 <span class="keyword">if</span> strcmpi(XAxisFlag, <span class="string">'Phase'</span>) |
---|
94 | 0043 [BPMxspos, BPMyspos, Sx, Sy, Tune] = modeltwiss(<span class="string">'Phase'</span>, BPMxFamily, [], BPMyFamily, []); |
---|
95 | 0044 BPMxspos = BPMxspos/2/pi; |
---|
96 | 0045 BPMyspos = BPMyspos/2/pi; |
---|
97 | 0046 XLabel = <span class="string">'BPM Phase'</span>; |
---|
98 | 0047 <span class="keyword">else</span> |
---|
99 | 0048 BPMxspos = <a href="getspos.html" class="code" title="function S = getspos(Family, DeviceList)">getspos</a>(BPMxFamily,<a href="family2dev.html" class="code" title="function DeviceList = family2dev(Family, varargin);">family2dev</a>(BPMxFamily)); |
---|
100 | 0049 BPMyspos = <a href="getspos.html" class="code" title="function S = getspos(Family, DeviceList)">getspos</a>(BPMyFamily,<a href="family2dev.html" class="code" title="function DeviceList = family2dev(Family, varargin);">family2dev</a>(BPMyFamily)); |
---|
101 | 0050 XLabel = <span class="string">'BPM Position [meters]'</span>; |
---|
102 | 0051 <span class="keyword">end</span> |
---|
103 | 0052 |
---|
104 | 0053 |
---|
105 | 0054 <span class="comment">% Get data</span> |
---|
106 | 0055 Xoffset = <a href="getoffset.html" class="code" title="function Data = getoffset(varargin)">getoffset</a>(BPMxFamily); |
---|
107 | 0056 Yoffset = <a href="getoffset.html" class="code" title="function Data = getoffset(varargin)">getoffset</a>(BPMyFamily); |
---|
108 | 0057 |
---|
109 | 0058 |
---|
110 | 0059 <span class="comment">% Change to physics units</span> |
---|
111 | 0060 <span class="keyword">if</span> any(strcmpi(<span class="string">'Physics'</span>,varargin)) |
---|
112 | 0061 Xoffset = <a href="hw2physics.html" class="code" title="function S = hw2physics(Family, Field, value, DeviceList, Energy)">hw2physics</a>(BPMxFamily, <span class="string">'Monitor'</span>, Xoffset, <a href="family2dev.html" class="code" title="function DeviceList = family2dev(Family, varargin);">family2dev</a>(BPMxFamily)); |
---|
113 | 0062 Yoffset = <a href="hw2physics.html" class="code" title="function S = hw2physics(Family, Field, value, DeviceList, Energy)">hw2physics</a>(BPMyFamily, <span class="string">'Monitor'</span>, Yoffset, <a href="family2dev.html" class="code" title="function DeviceList = family2dev(Family, varargin);">family2dev</a>(BPMyFamily)); |
---|
114 | 0063 <span class="keyword">end</span> |
---|
115 | 0064 |
---|
116 | 0065 UnitsString = <a href="getfamilydata.html" class="code" title="function [Data, ErrorFlag] = getfamilydata(Family, Field1, Field2, DeviceList)">getfamilydata</a>(<span class="string">'BPMx'</span>,<span class="string">'Monitor'</span>,<span class="string">'HWUnits'</span>); |
---|
117 | 0066 |
---|
118 | 0067 clf reset |
---|
119 | 0068 subplot(2,1,1); |
---|
120 | 0069 plot(BPMxspos, Xoffset, <span class="string">'.-'</span>); |
---|
121 | 0070 ylabel(sprintf(<span class="string">'Horizontal [%s]'</span>,UnitsString)); |
---|
122 | 0071 title(<span class="string">'Offset Orbit'</span>); |
---|
123 | 0072 grid on |
---|
124 | 0073 |
---|
125 | 0074 subplot(2,1,2); |
---|
126 | 0075 plot(BPMyspos, Yoffset, <span class="string">'.-'</span>); |
---|
127 | 0076 xlabel(XLabel); |
---|
128 | 0077 ylabel(sprintf(<span class="string">'Vertical [%s]'</span>,UnitsString)); |
---|
129 | 0078 grid on |
---|
130 | 0079 |
---|
131 | 0080 orient tall |
---|
132 | 0081</pre></div> |
---|
133 | <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> |
---|
134 | </body> |
---|
135 | </html> |
---|