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 measdispresp</title> |
---|
6 | <meta name="keywords" content="measdispresp"> |
---|
7 | <meta name="description" content="MEASDISPRESP - Measures Amman TERMs in response matrix"> |
---|
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> > measdispresp.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>measdispresp |
---|
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>MEASDISPRESP - Measures Amman TERMs in response matrix</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 [D] = measdispresp(CMfamily, CMlist); </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"> MEASDISPRESP - Measures Amman TERMs in response matrix |
---|
31 | Dmat = measdispresp(CMfamily, CMlist); |
---|
32 | |
---|
33 | INPUTS |
---|
34 | 1. CMfamily - Magnet corrector family |
---|
35 | 2. CMlist - List of magnet corrector |
---|
36 | |
---|
37 | OUTPUTS |
---|
38 | 1. D Energy part of the bpm response matrix |
---|
39 | |
---|
40 | Seems to measure Amman TERMs in response matrix</pre></div> |
---|
41 | |
---|
42 | <!-- crossreference --> |
---|
43 | <h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
44 | This function calls: |
---|
45 | <ul style="list-style-image:url(../matlabicon.gif)"> |
---|
46 | <li><a href="getbpm.html" class="code" title="function [BPM1, BPM2, FileName]=getbpm(varargin);">getbpm</a> GETBPM - Returns the horizontal and vertical orbit</li><li><a href="getdcct.html" class="code" title="function [DCCT, tout, DataTime, ErrorFlag] = getdcct(varargin)">getdcct</a> GETDCCT - returns the beam current</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="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="getvcmfamily.html" class="code" title="function Family = getvcmfamily">getvcmfamily</a> GETVCMFAMILY - Returns the default vertical corrector family</li><li><a href="setsp.html" class="code" title="function ErrorFlag = setsp(Family, varargin)">setsp</a> SETSP - Makes an absolute setpoint change to the 'Setpoint' field</li></ul> |
---|
47 | This function is called by: |
---|
48 | <ul style="list-style-image:url(../matlabicon.gif)"> |
---|
49 | </ul> |
---|
50 | <!-- crossreference --> |
---|
51 | |
---|
52 | |
---|
53 | <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2> |
---|
54 | <div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [D] = measdispresp(CMfamily, CMlist);</a> |
---|
55 | 0002 <span class="comment">% MEASDISPRESP - Measures Amman TERMs in response matrix</span> |
---|
56 | 0003 <span class="comment">% Dmat = measdispresp(CMfamily, CMlist);</span> |
---|
57 | 0004 <span class="comment">%</span> |
---|
58 | 0005 <span class="comment">% INPUTS</span> |
---|
59 | 0006 <span class="comment">% 1. CMfamily - Magnet corrector family</span> |
---|
60 | 0007 <span class="comment">% 2. CMlist - List of magnet corrector</span> |
---|
61 | 0008 <span class="comment">%</span> |
---|
62 | 0009 <span class="comment">% OUTPUTS</span> |
---|
63 | 0010 <span class="comment">% 1. D Energy part of the bpm response matrix</span> |
---|
64 | 0011 <span class="comment">%</span> |
---|
65 | 0012 <span class="comment">% Seems to measure Amman TERMs in response matrix</span> |
---|
66 | 0013 |
---|
67 | 0014 <span class="comment">% Written By Spear3 people</span> |
---|
68 | 0015 <span class="comment">% Modified by Laurent S. Nadolski</span> |
---|
69 | 0016 |
---|
70 | 0017 <span class="comment">% Initialize</span> |
---|
71 | 0018 MMmax = 6; <span class="comment">% to set corrector strength magnitude</span> |
---|
72 | 0019 Navg=6; |
---|
73 | 0020 DeltaMO = 1; |
---|
74 | 0021 Delay1 = 2; |
---|
75 | 0022 Delay2 = 2; |
---|
76 | 0023 |
---|
77 | 0024 <span class="keyword">if</span> CMfamily == <a href="getvcmfamily.html" class="code" title="function Family = getvcmfamily">getvcmfamily</a> |
---|
78 | 0025 Dim = 2; |
---|
79 | 0026 <span class="keyword">elseif</span> CMfamily == <a href="gethcmfamily.html" class="code" title="function Family = gethcmfamily">gethcmfamily</a> |
---|
80 | 0027 Dim = 1; |
---|
81 | 0028 <span class="keyword">else</span> |
---|
82 | 0029 error(<span class="string">'Dim set problem'</span>); |
---|
83 | 0030 <span class="keyword">end</span> |
---|
84 | 0031 |
---|
85 | 0032 |
---|
86 | 0033 <span class="comment">% Save corrector magnet starting points</span> |
---|
87 | 0034 CM0 = <a href="getsp.html" class="code" title="function [SP, tout, DataTime, ErrorFlag] = getsp(Family, varargin)">getsp</a>(CMfamily, CMlist); |
---|
88 | 0035 MO0 = getmo; |
---|
89 | 0036 DCCT0 = <a href="getdcct.html" class="code" title="function [DCCT, tout, DataTime, ErrorFlag] = getdcct(varargin)">getdcct</a>; |
---|
90 | 0037 |
---|
91 | 0038 <span class="keyword">for</span> i=1:max(size(CMlist,1)) |
---|
92 | 0039 fprintf(<span class="string">'%s Sector %d Magnet #%d\n'</span>,CMfamily, CMlist(i,1), CMlist(i,2)); drawnow; |
---|
93 | 0040 |
---|
94 | 0041 <span class="comment">% Get change in amps</span> |
---|
95 | 0042 DeltaAmps = mm2amps(CMfamily, MMmax, CMlist(i,:)) |
---|
96 | 0043 |
---|
97 | 0044 <span class="comment">% plus CM</span> |
---|
98 | 0045 CMam=<a href="setsp.html" class="code" title="function ErrorFlag = setsp(Family, varargin)">setsp</a>(CMfamily, CM0(i)+DeltaAmps, CMlist(i,:)); |
---|
99 | 0046 setmo(MO0+DeltaMO); |
---|
100 | 0047 sleep(Delay1); |
---|
101 | 0048 BPMp = <a href="getbpm.html" class="code" title="function [BPM1, BPM2, FileName]=getbpm(varargin);">getbpm</a>(Dim, Navg); |
---|
102 | 0049 RFp= <a href="getrf.html" class="code" title="function [RFsp, RFam, DataTime, ErrorFlag] = getrf(varargin)">getrf</a>; |
---|
103 | 0050 |
---|
104 | 0051 setmo(MO0-DeltaMO); |
---|
105 | 0052 sleep(Delay2); |
---|
106 | 0053 BPMm = <a href="getbpm.html" class="code" title="function [BPM1, BPM2, FileName]=getbpm(varargin);">getbpm</a>(Dim, Navg); |
---|
107 | 0054 RFm= <a href="getrf.html" class="code" title="function [RFsp, RFam, DataTime, ErrorFlag] = getrf(varargin)">getrf</a>; |
---|
108 | 0055 |
---|
109 | 0056 Dp = (BPMp-BPMm)/(RFp-RFm); |
---|
110 | 0057 |
---|
111 | 0058 <span class="comment">% minus CM</span> |
---|
112 | 0059 CMam=<a href="setsp.html" class="code" title="function ErrorFlag = setsp(Family, varargin)">setsp</a>(CMfamily, CM0(i)-DeltaAmps, CMlist(i,:)); |
---|
113 | 0060 setmo(MO0+DeltaMO); |
---|
114 | 0061 sleep(Delay1); |
---|
115 | 0062 BPMp = <a href="getbpm.html" class="code" title="function [BPM1, BPM2, FileName]=getbpm(varargin);">getbpm</a>(Dim, Navg); |
---|
116 | 0063 RFp= <a href="getrf.html" class="code" title="function [RFsp, RFam, DataTime, ErrorFlag] = getrf(varargin)">getrf</a>; |
---|
117 | 0064 |
---|
118 | 0065 setmo(MO0-DeltaMO); |
---|
119 | 0066 sleep(Delay2); |
---|
120 | 0067 BPMm = <a href="getbpm.html" class="code" title="function [BPM1, BPM2, FileName]=getbpm(varargin);">getbpm</a>(Dim, Navg); |
---|
121 | 0068 RFm= <a href="getrf.html" class="code" title="function [RFsp, RFam, DataTime, ErrorFlag] = getrf(varargin)">getrf</a>; |
---|
122 | 0069 |
---|
123 | 0070 Dm = (BPMp-BPMm)/(RFp-RFm); |
---|
124 | 0071 |
---|
125 | 0072 <span class="comment">% Reset corrector magnet and MO</span> |
---|
126 | 0073 CMam=<a href="setsp.html" class="code" title="function ErrorFlag = setsp(Family, varargin)">setsp</a>(CMfamily, CM0(i), CMlist(i,:)); |
---|
127 | 0074 setmo(MO0); |
---|
128 | 0075 |
---|
129 | 0076 D(:,i) = (Dp-Dm)/(2*DeltaAmps); |
---|
130 | 0077 |
---|
131 | 0078 <span class="keyword">if</span> (abs(DCCT0-<a href="getdcct.html" class="code" title="function [DCCT, tout, DataTime, ErrorFlag] = getdcct(varargin)">getdcct</a>) > 10) |
---|
132 | 0079 disp(<span class="string">'Beam current dropped 10 milliamps.'</span>); |
---|
133 | 0080 disp(<span class="string">'Refill then hit return.'</span>); pause; |
---|
134 | 0081 DCCT0 = <a href="getdcct.html" class="code" title="function [DCCT, tout, DataTime, ErrorFlag] = getdcct(varargin)">getdcct</a>; |
---|
135 | 0082 <span class="keyword">end</span>; |
---|
136 | 0083 <span class="keyword">end</span></pre></div> |
---|
137 | <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> |
---|
138 | </body> |
---|
139 | </html> |
---|