[4] | 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 plotcm</title> |
---|
| 6 | <meta name="keywords" content="plotcm"> |
---|
| 7 | <meta name="description" content="PLOTCM - Plots the horizontal and vertical corrector magnet families and"> |
---|
| 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> > plotcm.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>plotcm |
---|
| 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>PLOTCM - Plots the horizontal and vertical corrector magnet families and</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 [DeltaRF, HCMEnergyChangeTotal, DeltaL] = plotcm(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">PLOTCM - Plots the horizontal and vertical corrector magnet families and |
---|
| 31 | computes the energy change due to the horizontal correctors. |
---|
| 32 | |
---|
| 33 | [DeltaRF, DeltaEnergy, DeltaL] = plotcm(DeviceList, ...) |
---|
| 34 | |
---|
| 35 | INPUTS (optional) |
---|
| 36 | 1. DeviceList |
---|
| 37 | 2. 'Position' {Default} or 'Phase' for the x-axis units |
---|
| 38 | 3. 'Display' - Plot orbit information {Default} |
---|
| 39 | 'NoDisplay' - No plot |
---|
| 40 | 4. 'Online', 'Model', 'Manual', 'Hardware', 'Physics', etc. (the usual Units and Mode flags) |
---|
| 41 | |
---|
| 42 | |
---|
| 43 | OUTPUTS |
---|
| 44 | 1. DeltaRF - RF change that equates to the energy change |
---|
| 45 | 2. DeltaEnergy - Total energy change due to the horizontal correctors |
---|
| 46 | 3. DeltaL - Path length change that equates to changing the RF by DeltaRF |
---|
| 47 | |
---|
| 48 | See also <a href="findrf.html" class="code" title="function [DeltaRF, HCMEnergyChangeTotal, DeltaL] = findrf(varargin)">findrf</a> <a href="findrf1.html" class="code" title="function [DeltaRF, RFnew, frf] = findrf1(DeltaRF, BPMFamily, BPMList, FileName)">findrf1</a> <a href="rmdisp.html" class="code" title="function [DeltaRF, BPM, c, DispOrbit] = rmdisp(varargin)">rmdisp</a> |
---|
| 49 | |
---|
| 50 | Written by Greg Portmann</pre></div> |
---|
| 51 | |
---|
| 52 | <!-- crossreference --> |
---|
| 53 | <h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
| 54 | This function calls: |
---|
| 55 | <ul style="list-style-image:url(../matlabicon.gif)"> |
---|
| 56 | <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="gethcmfamily.html" class="code" title="function Family = gethcmfamily">gethcmfamily</a> GETHCMFAMILY - Returns the default horizontal corrector family</li><li><a href="getmcf.html" class="code" title="function Alpha = getmcf(ModelString)">getmcf</a> GETMCF - Returns the momentum compaction factor (MCF) stored in the AD or the model</li><li><a href="getrf.html" class="code" title="function [RFsp, RFam, DataTime, ErrorFlag] = getrf(varargin)">getrf</a> GETRF - Gets the RF frequency</li><li><a href="getsp.html" class="code" title="function [SP, tout, DataTime, ErrorFlag] = getsp(Family, varargin)">getsp</a> GETSP - Gets setpoint channels</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="getunits.html" class="code" title="function [Units, UnitsString] = getunits(Family, Field)">getunits</a> GETUNITS - Return the present family units and units string</li><li><a href="getvcmfamily.html" class="code" title="function Family = getvcmfamily">getvcmfamily</a> GETVCMFAMILY - Returns the default vertical corrector 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> |
---|
| 57 | This function is called by: |
---|
| 58 | <ul style="list-style-image:url(../matlabicon.gif)"> |
---|
| 59 | <li><a href="findrf.html" class="code" title="function [DeltaRF, HCMEnergyChangeTotal, DeltaL] = findrf(varargin)">findrf</a> FINDRF - Finds the RF frequency that minimizes the energy change due</li></ul> |
---|
| 60 | <!-- crossreference --> |
---|
| 61 | |
---|
| 62 | |
---|
| 63 | <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
| 64 | <div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [DeltaRF, HCMEnergyChangeTotal, DeltaL] = plotcm(varargin)</a> |
---|
| 65 | 0002 <span class="comment">%PLOTCM - Plots the horizontal and vertical corrector magnet families and</span> |
---|
| 66 | 0003 <span class="comment">% computes the energy change due to the horizontal correctors.</span> |
---|
| 67 | 0004 <span class="comment">%</span> |
---|
| 68 | 0005 <span class="comment">% [DeltaRF, DeltaEnergy, DeltaL] = plotcm(DeviceList, ...)</span> |
---|
| 69 | 0006 <span class="comment">%</span> |
---|
| 70 | 0007 <span class="comment">% INPUTS (optional)</span> |
---|
| 71 | 0008 <span class="comment">% 1. DeviceList</span> |
---|
| 72 | 0009 <span class="comment">% 2. 'Position' {Default} or 'Phase' for the x-axis units</span> |
---|
| 73 | 0010 <span class="comment">% 3. 'Display' - Plot orbit information {Default}</span> |
---|
| 74 | 0011 <span class="comment">% 'NoDisplay' - No plot</span> |
---|
| 75 | 0012 <span class="comment">% 4. 'Online', 'Model', 'Manual', 'Hardware', 'Physics', etc. (the usual Units and Mode flags)</span> |
---|
| 76 | 0013 <span class="comment">%</span> |
---|
| 77 | 0014 <span class="comment">%</span> |
---|
| 78 | 0015 <span class="comment">% OUTPUTS</span> |
---|
| 79 | 0016 <span class="comment">% 1. DeltaRF - RF change that equates to the energy change</span> |
---|
| 80 | 0017 <span class="comment">% 2. DeltaEnergy - Total energy change due to the horizontal correctors</span> |
---|
| 81 | 0018 <span class="comment">% 3. DeltaL - Path length change that equates to changing the RF by DeltaRF</span> |
---|
| 82 | 0019 <span class="comment">%</span> |
---|
| 83 | 0020 <span class="comment">% See also findrf findrf1 rmdisp</span> |
---|
| 84 | 0021 <span class="comment">%</span> |
---|
| 85 | 0022 <span class="comment">% Written by Greg Portmann</span> |
---|
| 86 | 0023 |
---|
| 87 | 0024 |
---|
| 88 | 0025 DisplayFlag = 1; |
---|
| 89 | 0026 XAxisFlag = <span class="string">'Position'</span>; |
---|
| 90 | 0027 |
---|
| 91 | 0028 |
---|
| 92 | 0029 <span class="comment">% Input parsing</span> |
---|
| 93 | 0030 InputFlags = {}; |
---|
| 94 | 0031 <span class="keyword">for</span> i = length(varargin):-1:1 |
---|
| 95 | 0032 <span class="keyword">if</span> isstruct(varargin{i}) |
---|
| 96 | 0033 <span class="comment">% Ignor structures</span> |
---|
| 97 | 0034 <span class="keyword">elseif</span> iscell(varargin{i}) |
---|
| 98 | 0035 <span class="comment">% Ignor cells</span> |
---|
| 99 | 0036 <span class="keyword">elseif</span> strcmpi(varargin{i},<span class="string">'struct'</span>) |
---|
| 100 | 0037 <span class="comment">% Just remove</span> |
---|
| 101 | 0038 varargin(i) = []; |
---|
| 102 | 0039 <span class="keyword">elseif</span> strcmpi(varargin{i},<span class="string">'numeric'</span>) |
---|
| 103 | 0040 <span class="comment">% Just remove</span> |
---|
| 104 | 0041 varargin(i) = []; |
---|
| 105 | 0042 <span class="keyword">elseif</span> strcmpi(varargin{i},<span class="string">'Position'</span>) |
---|
| 106 | 0043 XAxisFlag = <span class="string">'Position'</span>; |
---|
| 107 | 0044 varargin(i) = []; |
---|
| 108 | 0045 <span class="keyword">elseif</span> strcmpi(varargin{i},<span class="string">'Phase'</span>) |
---|
| 109 | 0046 XAxisFlag = <span class="string">'Phase'</span>; |
---|
| 110 | 0047 varargin(i) = []; |
---|
| 111 | 0048 <span class="keyword">elseif</span> strcmpi(varargin{i},<span class="string">'Display'</span>) |
---|
| 112 | 0049 DisplayFlag = 1; |
---|
| 113 | 0050 varargin(i) = []; |
---|
| 114 | 0051 <span class="keyword">elseif</span> strcmpi(varargin{i},<span class="string">'NoDisplay'</span>) |
---|
| 115 | 0052 DisplayFlag = 0; |
---|
| 116 | 0053 varargin(i) = []; |
---|
| 117 | 0054 <span class="keyword">end</span> |
---|
| 118 | 0055 <span class="keyword">end</span> |
---|
| 119 | 0056 |
---|
| 120 | 0057 |
---|
| 121 | 0058 <span class="comment">% Get the default corrector families</span> |
---|
| 122 | 0059 Family1 = <a href="gethcmfamily.html" class="code" title="function Family = gethcmfamily">gethcmfamily</a>; |
---|
| 123 | 0060 Family2 = <a href="getvcmfamily.html" class="code" title="function Family = getvcmfamily">getvcmfamily</a>; |
---|
| 124 | 0061 |
---|
| 125 | 0062 |
---|
| 126 | 0063 <span class="comment">% SP or AM ???</span> |
---|
| 127 | 0064 x = <a href="getsp.html" class="code" title="function [SP, tout, DataTime, ErrorFlag] = getsp(Family, varargin)">getsp</a>(Family1, <span class="string">'Struct'</span>, varargin{:}); |
---|
| 128 | 0065 y = <a href="getsp.html" class="code" title="function [SP, tout, DataTime, ErrorFlag] = getsp(Family, varargin)">getsp</a>(Family2, <span class="string">'Struct'</span>, varargin{:}); |
---|
| 129 | 0066 |
---|
| 130 | 0067 |
---|
| 131 | 0068 <span class="comment">% Compute the energy change due to the correctors</span> |
---|
| 132 | 0069 L = <a href="getfamilydata.html" class="code" title="function [Data, ErrorFlag] = getfamilydata(Family, Field1, Field2, DeviceList)">getfamilydata</a>(<span class="string">'Circumference'</span>); |
---|
| 133 | 0070 HCM = <a href="hw2physics.html" class="code" title="function S = hw2physics(Family, Field, value, DeviceList, Energy)">hw2physics</a>(x); |
---|
| 134 | 0071 HCM = HCM.Data; |
---|
| 135 | 0072 |
---|
| 136 | 0073 |
---|
| 137 | 0074 <span class="keyword">if</span> strcmpi(<a href="getfamilydata.html" class="code" title="function [Data, ErrorFlag] = getfamilydata(Family, Field1, Field2, DeviceList)">getfamilydata</a>(<span class="string">'Machine'</span>),<span class="string">'ALS'</span>) |
---|
| 138 | 0075 <span class="comment">% For the ALS, either the HCMChicane magnets need to be included or</span> |
---|
| 139 | 0076 <span class="comment">% the chicane "part" of the HCMs needs to be removed</span> |
---|
| 140 | 0077 Energy = <a href="getfamilydata.html" class="code" title="function [Data, ErrorFlag] = getfamilydata(Family, Field1, Field2, DeviceList)">getfamilydata</a>(<span class="string">'Energy'</span>); |
---|
| 141 | 0078 |
---|
| 142 | 0079 <span class="comment">% Sector 6</span> |
---|
| 143 | 0080 <span class="comment">% Off 1.9 GeV 1.5 GeV</span> |
---|
| 144 | 0081 <span class="comment">% HCMCHICANEM(6,1) 80.0 18.0 ?</span> |
---|
| 145 | 0082 <span class="comment">% HCMCHICANEM(6,1) 80.0 20.0 ?</span> |
---|
| 146 | 0083 <span class="comment">% HCM(6,1) 0.0 18.8 ?</span> |
---|
| 147 | 0084 ihcm = findrowindex([6 1], x.DeviceList); |
---|
| 148 | 0085 <span class="keyword">if</span> length(ihcm) == 1 |
---|
| 149 | 0086 <span class="keyword">try</span> |
---|
| 150 | 0087 <span class="keyword">if</span> <a href="getsp.html" class="code" title="function [SP, tout, DataTime, ErrorFlag] = getsp(Family, varargin)">getsp</a>(<span class="string">'HCMCHICANEM'</span>,[6 1]) < 70 |
---|
| 151 | 0088 <span class="comment">% Assume sector 6 chicane is on</span> |
---|
| 152 | 0089 <span class="keyword">if</span> Energy == 1.9 |
---|
| 153 | 0090 HCM(ihcm) = HCM(ihcm) + <a href="hw2physics.html" class="code" title="function S = hw2physics(Family, Field, value, DeviceList, Energy)">hw2physics</a>(x.FamilyName, x.Field, -18.8, [6 1]); |
---|
| 154 | 0091 x.Data(ihcm) = x.Data(ihcm) - 18.8; |
---|
| 155 | 0092 <span class="keyword">else</span> |
---|
| 156 | 0093 HCM(ihcm) = HCM(ihcm) + <a href="hw2physics.html" class="code" title="function S = hw2physics(Family, Field, value, DeviceList, Energy)">hw2physics</a>(x.FamilyName, x.Field, -18.8*1.5/1.9, [6 1]); |
---|
| 157 | 0094 x.Data(ihcm) = x.Data(ihcm) - 18.8*1.5/1.9; |
---|
| 158 | 0095 <span class="keyword">end</span> |
---|
| 159 | 0096 <span class="keyword">end</span> |
---|
| 160 | 0097 <span class="keyword">catch</span> |
---|
| 161 | 0098 fprintf(<span class="string">'%s\n'</span>, lasterr); |
---|
| 162 | 0099 fprintf(<span class="string">'Problem reading HCMCHICANEM(6,1). The chicane "offset" on HCM(6,1) will not be removed.\n\n'</span>); |
---|
| 163 | 0100 <span class="keyword">end</span> |
---|
| 164 | 0101 <span class="keyword">end</span> |
---|
| 165 | 0102 |
---|
| 166 | 0103 <span class="comment">% Sector 11</span> |
---|
| 167 | 0104 <span class="comment">% Off 1.9 GeV 1.5 GeV</span> |
---|
| 168 | 0105 <span class="comment">% HCMCHICANEM(11,1) 80.0 40.5 52.0</span> |
---|
| 169 | 0106 <span class="comment">% HCMCHICANEM(11,1) 80.0 40.5 52.0</span> |
---|
| 170 | 0107 <span class="comment">% HCM(10,8) 0.0 -17.0 -14.0</span> |
---|
| 171 | 0108 <span class="comment">% HCM(11,1) 0.0 -17.0 -14.0</span> |
---|
| 172 | 0109 ihcm = findrowindex([10 8], x.DeviceList); |
---|
| 173 | 0110 <span class="keyword">if</span> length(ihcm) == 1 |
---|
| 174 | 0111 <span class="keyword">try</span> |
---|
| 175 | 0112 <span class="keyword">if</span> <a href="getsp.html" class="code" title="function [SP, tout, DataTime, ErrorFlag] = getsp(Family, varargin)">getsp</a>(<span class="string">'HCMCHICANEM'</span>,[11 1]) < 60 |
---|
| 176 | 0113 <span class="comment">% Assume sector 11 chicane is on</span> |
---|
| 177 | 0114 <span class="keyword">if</span> Energy == 1.9 |
---|
| 178 | 0115 HCM(ihcm) = HCM(ihcm) + <a href="hw2physics.html" class="code" title="function S = hw2physics(Family, Field, value, DeviceList, Energy)">hw2physics</a>(x.FamilyName, x.Field, 17, [10 8]); |
---|
| 179 | 0116 x.Data(ihcm) = x.Data(ihcm) + 17; |
---|
| 180 | 0117 <span class="keyword">else</span> |
---|
| 181 | 0118 HCM(ihcm) = HCM(ihcm) + <a href="hw2physics.html" class="code" title="function S = hw2physics(Family, Field, value, DeviceList, Energy)">hw2physics</a>(x.FamilyName, x.Field, 14, [10 8]); |
---|
| 182 | 0119 x.Data(ihcm) = x.Data(ihcm) + 14; |
---|
| 183 | 0120 <span class="keyword">end</span> |
---|
| 184 | 0121 <span class="keyword">end</span> |
---|
| 185 | 0122 <span class="keyword">catch</span> |
---|
| 186 | 0123 fprintf(<span class="string">'%s\n'</span>, lasterr); |
---|
| 187 | 0124 fprintf(<span class="string">'Due to an error, the chicane "offset" on HCM(10,8) will not be removed.n\n'</span>); |
---|
| 188 | 0125 <span class="keyword">end</span> |
---|
| 189 | 0126 <span class="keyword">end</span> |
---|
| 190 | 0127 ihcm = findrowindex([11 1], x.DeviceList); |
---|
| 191 | 0128 <span class="keyword">if</span> length(ihcm) == 1 |
---|
| 192 | 0129 <span class="keyword">try</span> |
---|
| 193 | 0130 <span class="keyword">if</span> <a href="getsp.html" class="code" title="function [SP, tout, DataTime, ErrorFlag] = getsp(Family, varargin)">getsp</a>(<span class="string">'HCMCHICANEM'</span>,[11 1]) < 60 |
---|
| 194 | 0131 <span class="comment">% Assume sector 11 chicane is on</span> |
---|
| 195 | 0132 <span class="keyword">if</span> Energy == 1.9 |
---|
| 196 | 0133 HCM(ihcm) = HCM(ihcm) + <a href="hw2physics.html" class="code" title="function S = hw2physics(Family, Field, value, DeviceList, Energy)">hw2physics</a>(x.FamilyName, x.Field, 17, [11 1]); |
---|
| 197 | 0134 x.Data(ihcm) = x.Data(ihcm) + 17; |
---|
| 198 | 0135 <span class="keyword">else</span> |
---|
| 199 | 0136 HCM(ihcm) = HCM(ihcm) + <a href="hw2physics.html" class="code" title="function S = hw2physics(Family, Field, value, DeviceList, Energy)">hw2physics</a>(x.FamilyName, x.Field, 14, [11 1]); |
---|
| 200 | 0137 x.Data(ihcm) = x.Data(ihcm) + 14; |
---|
| 201 | 0138 <span class="keyword">end</span> |
---|
| 202 | 0139 <span class="keyword">end</span> |
---|
| 203 | 0140 <span class="keyword">catch</span> |
---|
| 204 | 0141 fprintf(<span class="string">'%s\n'</span>, lasterr); |
---|
| 205 | 0142 fprintf(<span class="string">'Due to an error, the chicane "offset" on HCM(11,1) will not be removed.n\n'</span>); |
---|
| 206 | 0143 <span class="keyword">end</span> |
---|
| 207 | 0144 <span class="keyword">end</span> |
---|
| 208 | 0145 <span class="keyword">end</span> |
---|
| 209 | 0146 |
---|
| 210 | 0147 |
---|
| 211 | 0148 [DxHCM, DyHCM] = modeldisp([], x.FamilyName, x.DeviceList, <span class="string">'Numeric'</span>, <span class="string">'Physics'</span>); |
---|
| 212 | 0149 HCMEnergyChange = -1 * HCM .* DxHCM / <a href="getmcf.html" class="code" title="function Alpha = getmcf(ModelString)">getmcf</a> / L; |
---|
| 213 | 0150 HCMEnergyChangeTotal = sum(HCMEnergyChange); |
---|
| 214 | 0151 |
---|
| 215 | 0152 <span class="comment">% Delta RF to move the energy change due to the corrector to the RF frequency</span> |
---|
| 216 | 0153 DeltaRF = -1 * <a href="getrf.html" class="code" title="function [RFsp, RFam, DataTime, ErrorFlag] = getrf(varargin)">getrf</a> * <a href="getmcf.html" class="code" title="function Alpha = getmcf(ModelString)">getmcf</a> * HCMEnergyChangeTotal; <span class="comment">% Default units of getrf/setrf</span> |
---|
| 217 | 0154 DeltaRFPhysics = -1 * <a href="getrf.html" class="code" title="function [RFsp, RFam, DataTime, ErrorFlag] = getrf(varargin)">getrf</a>(<span class="string">'Physics'</span>) * <a href="getmcf.html" class="code" title="function Alpha = getmcf(ModelString)">getmcf</a> * HCMEnergyChangeTotal; <span class="comment">% Must be Hz</span> |
---|
| 218 | 0155 |
---|
| 219 | 0156 DeltaL = L * <a href="getmcf.html" class="code" title="function Alpha = getmcf(ModelString)">getmcf</a> * HCMEnergyChangeTotal; |
---|
| 220 | 0157 |
---|
| 221 | 0158 |
---|
| 222 | 0159 <span class="keyword">if</span> DisplayFlag |
---|
| 223 | 0160 LeftGraphColor = <span class="string">'b'</span>; |
---|
| 224 | 0161 RightGraphColor = <span class="string">'r'</span>; |
---|
| 225 | 0162 |
---|
| 226 | 0163 [RFUnits, RFUnitsString] = <a href="getunits.html" class="code" title="function [Units, UnitsString] = getunits(Family, Field)">getunits</a>(<span class="string">'RF'</span>); |
---|
| 227 | 0164 |
---|
| 228 | 0165 <span class="keyword">if</span> strcmpi(XAxisFlag, <span class="string">'Phase'</span>) |
---|
| 229 | 0166 [BPMxspos, BPMyspos, Sx, Sy, Tune] = modeltwiss(<span class="string">'Phase'</span>, x.FamilyName, x.DeviceList, y.FamilyName, y.DeviceList); |
---|
| 230 | 0167 BPMxspos = BPMxspos/2/pi; |
---|
| 231 | 0168 BPMyspos = BPMyspos/2/pi; |
---|
| 232 | 0169 XLabel = <span class="string">'Phase'</span>; |
---|
| 233 | 0170 <span class="keyword">else</span> |
---|
| 234 | 0171 BPMxspos = <a href="getspos.html" class="code" title="function S = getspos(Family, DeviceList)">getspos</a>(x.FamilyName, x.DeviceList); |
---|
| 235 | 0172 BPMyspos = <a href="getspos.html" class="code" title="function S = getspos(Family, DeviceList)">getspos</a>(y.FamilyName, y.DeviceList); |
---|
| 236 | 0173 XLabel = <span class="string">'Position [meters]'</span>; |
---|
| 237 | 0174 <span class="keyword">end</span> |
---|
| 238 | 0175 |
---|
| 239 | 0176 |
---|
| 240 | 0177 hfig = gcf; |
---|
| 241 | 0178 clf reset |
---|
| 242 | 0179 <span class="comment">%p = get(hfig, 'Position');</span> |
---|
| 243 | 0180 <span class="comment">%set(hfig, 'Position', [p(1) p(2)-.8*p(4) p(3) p(4)+.8*p(4)]);</span> |
---|
| 244 | 0181 |
---|
| 245 | 0182 |
---|
| 246 | 0183 subplot(2,1,1); |
---|
| 247 | 0184 [ax, h1, h2] = plotyy(BPMxspos, x.Data, BPMxspos, -HCMEnergyChange); |
---|
| 248 | 0185 FontSize = get(ax(1), <span class="string">'Fontsize'</span>); |
---|
| 249 | 0186 title(sprintf(<span class="string">'%s (%g rms [%s]): Energy Change \\Delta p / p = \\Sigma \\delta_{hcm} \\eta_{hcm} / (-\\alpha L) = %.3e'</span>, Family1, std(x.Data), x.UnitsString, HCMEnergyChangeTotal), <span class="string">'Fontsize'</span>,FontSize); |
---|
| 250 | 0187 set(get(ax(1),<span class="string">'Ylabel'</span>), <span class="string">'String'</span>, sprintf(<span class="string">'%s [%s]'</span>, Family1, x.UnitsString), <span class="string">'Fontsize'</span>,FontSize); |
---|
| 251 | 0188 set(get(ax(2),<span class="string">'Ylabel'</span>), <span class="string">'String'</span>, <span class="string">'-\Delta p/p'</span>, <span class="string">'Color'</span>, RightGraphColor, <span class="string">'Fontsize'</span>,FontSize); |
---|
| 252 | 0189 set(h1, <span class="string">'Marker'</span>,<span class="string">'.'</span>); |
---|
| 253 | 0190 set(h2, <span class="string">'Marker'</span>,<span class="string">'.'</span>); |
---|
| 254 | 0191 <span class="comment">%'\fontsize{14}\sigma_y \fontsize{10}BL 3.1 [\mum]'</span> |
---|
| 255 | 0192 set(ax(2), <span class="string">'YColor'</span>, RightGraphColor); |
---|
| 256 | 0193 set(h2, <span class="string">'Color'</span>, RightGraphColor); |
---|
| 257 | 0194 grid on |
---|
| 258 | 0195 |
---|
| 259 | 0196 <span class="keyword">if</span> ~strcmpi(XAxisFlag, <span class="string">'Phase'</span>) |
---|
| 260 | 0197 axes(ax(1)); |
---|
| 261 | 0198 aa = axis; |
---|
| 262 | 0199 aa(1) = 0; |
---|
| 263 | 0200 aa(2) = L; |
---|
| 264 | 0201 axis(aa); |
---|
| 265 | 0202 axes(ax(2)); |
---|
| 266 | 0203 aa = axis; |
---|
| 267 | 0204 aa(1) = 0; |
---|
| 268 | 0205 aa(2) = L; |
---|
| 269 | 0206 axis(aa); |
---|
| 270 | 0207 <span class="keyword">end</span> |
---|
| 271 | 0208 |
---|
| 272 | 0209 |
---|
| 273 | 0210 subplot(2,1,2); |
---|
| 274 | 0211 plot(BPMyspos, y.Data, <span class="string">'.-'</span>); |
---|
| 275 | 0212 title(sprintf(<span class="string">'%s (%g rms [%s])'</span>, Family2, std(y.Data), y.UnitsString), <span class="string">'Fontsize'</span>,FontSize); |
---|
| 276 | 0213 xlabel(XLabel, <span class="string">'Fontsize'</span>,FontSize); |
---|
| 277 | 0214 ylabel(sprintf(<span class="string">'%s [%s]'</span>,Family2, x.UnitsString), <span class="string">'Color'</span>, LeftGraphColor, <span class="string">'Fontsize'</span>,FontSize); |
---|
| 278 | 0215 set(gca,<span class="string">'YColor'</span>, LeftGraphColor); |
---|
| 279 | 0216 <span class="keyword">if</span> ~strcmpi(XAxisFlag, <span class="string">'Phase'</span>) |
---|
| 280 | 0217 xaxis([0 L]); |
---|
| 281 | 0218 <span class="keyword">end</span> |
---|
| 282 | 0219 |
---|
| 283 | 0220 addlabel(1, 0, datestr(clock,0), 7); |
---|
| 284 | 0221 addlabel(0, 0, sprintf(<span class="string">'Equivalent energy change using the RF is \\DeltaRF = %g [%s] \\DeltaL = %g [m]'</span>, DeltaRF, RFUnitsString, DeltaL), 7); |
---|
| 285 | 0222 |
---|
| 286 | 0223 <span class="keyword">if</span> strcmpi(<a href="getfamilydata.html" class="code" title="function [Data, ErrorFlag] = getfamilydata(Family, Field1, Field2, DeviceList)">getfamilydata</a>(<span class="string">'Machine'</span>),<span class="string">'ALS'</span>) |
---|
| 287 | 0224 addlabel(1, .5, <span class="string">'Nominal chicane setting may have been removed from the HCM family'</span>, 7); |
---|
| 288 | 0225 <span class="keyword">end</span> |
---|
| 289 | 0226 <span class="keyword">end</span> |
---|
| 290 | 0227 |
---|
| 291 | 0228</pre></div> |
---|
| 292 | <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> |
---|
| 293 | </body> |
---|
| 294 | </html> |
---|