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 plotidfftable2</title> |
---|
6 | <meta name="keywords" content="plotidfftable2"> |
---|
7 | <meta name="description" content=""> |
---|
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="#">machine</a> > <a href="#">Soleil</a> > <a href="index.html">StorageRing</a> > plotidfftable2.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 machine/Soleil/StorageRing <img alt=">" border="0" src="../../../right.png"></a></td></tr></table>--> |
---|
19 | |
---|
20 | <h1>plotidfftable2 |
---|
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></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 ffcompare </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"></pre></div> |
---|
31 | |
---|
32 | <!-- crossreference --> |
---|
33 | <h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2> |
---|
34 | This function calls: |
---|
35 | <ul style="list-style-image:url(../../../matlabicon.gif)"> |
---|
36 | </ul> |
---|
37 | This function is called by: |
---|
38 | <ul style="list-style-image:url(../../../matlabicon.gif)"> |
---|
39 | </ul> |
---|
40 | <!-- crossreference --> |
---|
41 | |
---|
42 | |
---|
43 | <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2> |
---|
44 | <div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function ffcompare</a> |
---|
45 | 0002 |
---|
46 | 0003 |
---|
47 | 0004 BLeffHCM = 410; <span class="comment">% gauss cm / amp;</span> |
---|
48 | 0005 BLeffVCM = 171; <span class="comment">% gauss cm / amp;</span> |
---|
49 | 0006 Leff = 55; <span class="comment">% cm</span> |
---|
50 | 0007 labelmat = []; |
---|
51 | 0008 |
---|
52 | 0009 DirStart = pwd; |
---|
53 | 0010 gotodata |
---|
54 | 0011 cd gaptrack |
---|
55 | 0012 cd archive |
---|
56 | 0013 |
---|
57 | 0014 figure |
---|
58 | 0015 ha=subplot(2,2,1); |
---|
59 | 0016 hb=subplot(2,2,2); |
---|
60 | 0017 hc=subplot(2,2,3); |
---|
61 | 0018 hd=subplot(2,2,4); |
---|
62 | 0019 |
---|
63 | 0020 SectorIn = menu(<span class="string">'Which Sector?'</span>,<span class="string">'4'</span>,<span class="string">'5'</span>,<span class="string">'7'</span>,<span class="string">'8'</span>,<span class="string">'9'</span>,<span class="string">'10'</span>,<span class="string">'12'</span>,<span class="string">'Cancel'</span>); |
---|
64 | 0021 <span class="keyword">if</span> SectorIn == 1 |
---|
65 | 0022 Sector = 4; |
---|
66 | 0023 <span class="keyword">elseif</span> SectorIn == 2 |
---|
67 | 0024 Sector = 5; |
---|
68 | 0025 <span class="keyword">elseif</span> SectorIn == 3 |
---|
69 | 0026 Sector = 7; |
---|
70 | 0027 <span class="keyword">elseif</span> SectorIn == 4 |
---|
71 | 0028 Sector = 8; |
---|
72 | 0029 <span class="keyword">elseif</span> SectorIn == 5 |
---|
73 | 0030 Sector = 9; |
---|
74 | 0031 <span class="keyword">elseif</span> SectorIn == 6 |
---|
75 | 0032 Sector = 10; |
---|
76 | 0033 <span class="keyword">elseif</span> SectorIn == 7 |
---|
77 | 0034 Sector = 12; |
---|
78 | 0035 <span class="keyword">elseif</span> SectorIn == 8 |
---|
79 | 0036 <span class="keyword">return</span> |
---|
80 | 0037 <span class="keyword">end</span> |
---|
81 | 0038 <span class="keyword">if</span> Sector == 0 |
---|
82 | 0039 <span class="keyword">return</span>; |
---|
83 | 0040 <span class="keyword">end</span> |
---|
84 | 0041 |
---|
85 | 0042 <span class="keyword">for</span> i = 1:100000 |
---|
86 | 0043 <span class="comment">% Load the table1</span> |
---|
87 | 0044 [Datafn, DirStr] = uigetfile(sprintf(<span class="string">'id%02d*.mat'</span>, Sector), <span class="string">'Choose the desired feed forward file (Cancel to stop).'</span>); |
---|
88 | 0045 <span class="keyword">if</span> Datafn == 0 |
---|
89 | 0046 <span class="comment">% Return of original directory</span> |
---|
90 | 0047 eval([<span class="string">'cd '</span>, DirStart]); |
---|
91 | 0048 |
---|
92 | 0049 <span class="comment">%subplot(2,2,1);</span> |
---|
93 | 0050 axes(ha); |
---|
94 | 0051 title(<span class="string">''</span>); |
---|
95 | 0052 hold off |
---|
96 | 0053 axis tight |
---|
97 | 0054 <span class="comment">%subplot(2,2,2);</span> |
---|
98 | 0055 axes(hb); |
---|
99 | 0056 title(<span class="string">''</span>); |
---|
100 | 0057 hold off |
---|
101 | 0058 axis tight |
---|
102 | 0059 <span class="comment">%subplot(2,2,3);</span> |
---|
103 | 0060 axes(hc); |
---|
104 | 0061 title(<span class="string">''</span>); |
---|
105 | 0062 hold off |
---|
106 | 0063 axis tight |
---|
107 | 0064 <span class="comment">%subplot(2,2,4);</span> |
---|
108 | 0065 axes(hd); |
---|
109 | 0066 title(<span class="string">''</span>); |
---|
110 | 0067 hold off |
---|
111 | 0068 axis tight |
---|
112 | 0069 orient landscape |
---|
113 | 0070 |
---|
114 | 0071 h=addlabel(.5,1,sprintf(<span class="string">'Sector %d Feed Forward Tables'</span>, Sector1),12); |
---|
115 | 0072 set(h,<span class="string">'HorizontalAlignment'</span>,<span class="string">'center'</span>); |
---|
116 | 0073 |
---|
117 | 0074 <span class="keyword">for</span> j = 1:size(labelmat,1) |
---|
118 | 0075 h=addlabel(1,1-.02*(j-1),labelmat(j,:),7); |
---|
119 | 0076 set(h,<span class="string">'color'</span>,labelcmat(j,:)); |
---|
120 | 0077 <span class="comment">%set(h(j),'EraseMode','background');</span> |
---|
121 | 0078 <span class="comment">%set(h(j),'EraseMode','Normal');</span> |
---|
122 | 0079 <span class="comment">%set(h(j),'EraseMode','xor');</span> |
---|
123 | 0080 <span class="keyword">end</span> |
---|
124 | 0081 |
---|
125 | 0082 <span class="keyword">return</span> |
---|
126 | 0083 <span class="keyword">end</span> |
---|
127 | 0084 |
---|
128 | 0085 |
---|
129 | 0086 eval([<span class="string">'load '</span>, DirStr, Datafn]); |
---|
130 | 0087 h1 = tableX; |
---|
131 | 0088 v1 = tableY; |
---|
132 | 0089 Sector1 = str2num(Datafn(3:4)); |
---|
133 | 0090 GeVnum1 = str2num(Datafn(6:7))/10; |
---|
134 | 0091 |
---|
135 | 0092 |
---|
136 | 0093 cmat = get(gca,<span class="string">'ColorOrder'</span>); |
---|
137 | 0094 icolor=rem(i-1,size(cmat,1))+1; |
---|
138 | 0095 |
---|
139 | 0096 <span class="comment">%ha=subplot(2,2,1);</span> |
---|
140 | 0097 axes(ha); |
---|
141 | 0098 plot(h1(:,1),h1(:,2),<span class="string">'color'</span>,cmat(icolor,:)); |
---|
142 | 0099 xlabel(<span class="string">'Gap Position [mm]'</span>); |
---|
143 | 0100 ylabel(sprintf(<span class="string">'HCM(%d,%d) [amps]'</span>,Sector1-1,4)); |
---|
144 | 0101 title(sprintf(<span class="string">'Sector %d Table at %.1f GeV'</span>, Sector1, GeVnum1)); |
---|
145 | 0102 hold on |
---|
146 | 0103 |
---|
147 | 0104 <span class="comment">%hb=subplot(2,2,3);</span> |
---|
148 | 0105 axes(hb); |
---|
149 | 0106 plot(h1(:,1),h1(:,3),<span class="string">'color'</span>,cmat(icolor,:)); |
---|
150 | 0107 xlabel(<span class="string">'Gap Position [mm]'</span>); |
---|
151 | 0108 ylabel(sprintf(<span class="string">'HCM(%d,%d) [amps]'</span>,Sector1,1)); |
---|
152 | 0109 title(sprintf(<span class="string">'Sector %d Table at %.1f GeV'</span>, Sector1, GeVnum1)); |
---|
153 | 0110 hold on |
---|
154 | 0111 |
---|
155 | 0112 <span class="comment">%hc=subplot(2,2,2);</span> |
---|
156 | 0113 axes(hc); |
---|
157 | 0114 plot(v1(:,1),v1(:,2),<span class="string">'color'</span>,cmat(icolor,:)); |
---|
158 | 0115 xlabel(<span class="string">'Gap Position [mm]'</span>); |
---|
159 | 0116 ylabel(sprintf(<span class="string">'VCM(%d,%d) [amps]'</span>,Sector1-1,4)); |
---|
160 | 0117 title(sprintf(<span class="string">'Sector %d Table at %.1f GeV'</span>, Sector1, GeVnum1)); |
---|
161 | 0118 hold on |
---|
162 | 0119 |
---|
163 | 0120 <span class="comment">%hd=subplot(2,2,4);</span> |
---|
164 | 0121 axes(hd); |
---|
165 | 0122 plot(v1(:,1),v1(:,3),<span class="string">'color'</span>,cmat(icolor,:)); |
---|
166 | 0123 xlabel(<span class="string">'Gap Position [mm]'</span>); |
---|
167 | 0124 ylabel(sprintf(<span class="string">'VCM(%d,%d) [amps]'</span>,Sector1,1)); |
---|
168 | 0125 title(sprintf(<span class="string">'Sector %d Table at %.1f GeV'</span>, Sector1, GeVnum1)); |
---|
169 | 0126 hold on |
---|
170 | 0127 |
---|
171 | 0128 fprintf(<span class="string">' %d. %s Sector %d %.1f GeV\n'</span>, i, FFDate, Sector1, GeVnum1); |
---|
172 | 0129 |
---|
173 | 0130 labelmat = strvcat(labelmat, sprintf(<span class="string">'%s, Sector %d, %.1f GeV'</span>, FFDate, Sector1, GeVnum1)); |
---|
174 | 0131 labelcmat(i,:) = cmat(icolor,:); |
---|
175 | 0132 <span class="comment">%h(i)=addlabel(1,1-.03*i,sprintf('%s Sector %d %.1f GeV', FFDate, Sector1, GeVnum1),7);</span> |
---|
176 | 0133 <span class="comment">%set(h(i),'color',cmat(icolor,:));</span> |
---|
177 | 0134 |
---|
178 | 0135 <span class="keyword">for</span> j = 1:i |
---|
179 | 0136 h=addlabel(1,1-.02*(j-1),labelmat(j,:),7); |
---|
180 | 0137 set(h,<span class="string">'color'</span>,labelcmat(j,:)); |
---|
181 | 0138 <span class="comment">%set(h(j),'EraseMode','background');</span> |
---|
182 | 0139 <span class="comment">%set(h(j),'EraseMode','Normal');</span> |
---|
183 | 0140 <span class="comment">%set(h(j),'EraseMode','xor');</span> |
---|
184 | 0141 <span class="keyword">end</span> |
---|
185 | 0142 |
---|
186 | 0143 drawnow |
---|
187 | 0144 <span class="keyword">end</span> |
---|
188 | 0145 |
---|
189 | 0146 |
---|
190 | 0147 |
---|
191 | 0148 <span class="keyword">return</span> |
---|
192 | 0149 |
---|
193 | 0150 |
---|
194 | 0151 |
---|
195 | 0152 |
---|
196 | 0153 |
---|
197 | 0154 <span class="comment">% Load the table2</span> |
---|
198 | 0155 [Datafn, DirStr] = uigetfile(<span class="string">'*.mat'</span>, <span class="string">'Choose the desired feed forward file.'</span>); |
---|
199 | 0156 eval([<span class="string">'load '</span>, DirStr, Datafn]); |
---|
200 | 0157 h1 = tableX; |
---|
201 | 0158 v1 = tableY; |
---|
202 | 0159 Sector2 = str2num(Datafn(3:4)); |
---|
203 | 0160 GeVnum2 = str2num(Datafn(6:7))/10; |
---|
204 | 0161 |
---|
205 | 0162 |
---|
206 | 0163 subplot(2,1,1); |
---|
207 | 0164 plot(h1(:,1),h1(:,2),<span class="string">'-.r'</span>, h1(:,1),h1(:,3),<span class="string">':g'</span>); |
---|
208 | 0165 hold off; |
---|
209 | 0166 xlabel(<span class="string">'Gap Position [mm]'</span>); |
---|
210 | 0167 ylabel(<span class="string">'Horizontal Corrector Strength [amps]'</span>); |
---|
211 | 0168 title([<span class="string">'Insertion Device Feedfoward Tables'</span>]); |
---|
212 | 0169 legend([<span class="string">'HCM4, Sector '</span>,num2str(Sector1-1),<span class="string">' '</span>, num2str(GeVnum1), <span class="string">' GeV'</span>], <span class="keyword">...</span> |
---|
213 | 0170 [<span class="string">'HCM1, Sector '</span>,num2str(Sector1),<span class="string">' '</span>, num2str(GeVnum1), <span class="string">' GeV'</span>], <span class="keyword">...</span> |
---|
214 | 0171 [<span class="string">'HCM4, Sector '</span>,num2str(Sector2-1),<span class="string">' '</span>, num2str(GeVnum2), <span class="string">' GeV'</span>], <span class="keyword">...</span> |
---|
215 | 0172 [<span class="string">'HCM1, Sector '</span>,num2str(Sector2),<span class="string">' '</span>, num2str(GeVnum2), <span class="string">' GeV'</span>]); |
---|
216 | 0173 |
---|
217 | 0174 |
---|
218 | 0175 subplot(2,1,2); |
---|
219 | 0176 plot(v1(:,1),v1(:,2),<span class="string">'-.r'</span>, v1(:,1),v1(:,3),<span class="string">':g'</span>); |
---|
220 | 0177 hold off; |
---|
221 | 0178 xlabel(<span class="string">'Gap Position [mm]'</span>); |
---|
222 | 0179 ylabel(<span class="string">'Vertical Corrector Strength [amps]'</span>); |
---|
223 | 0180 title([<span class="string">'Insertion Device Feedfoward Tables'</span>]); |
---|
224 | 0181 legend([<span class="string">'VCM4, Sector '</span>,num2str(Sector1-1),<span class="string">' '</span>, num2str(GeVnum1), <span class="string">' GeV'</span>], <span class="keyword">...</span> |
---|
225 | 0182 [<span class="string">'VCM1, Sector '</span>,num2str(Sector1),<span class="string">' '</span>, num2str(GeVnum1), <span class="string">' GeV'</span>], <span class="keyword">...</span> |
---|
226 | 0183 [<span class="string">'VCM4, Sector '</span>,num2str(Sector2-1),<span class="string">' '</span>, num2str(GeVnum2), <span class="string">' GeV'</span>], <span class="keyword">...</span> |
---|
227 | 0184 [<span class="string">'VCM1, Sector '</span>,num2str(Sector2),<span class="string">' '</span>, num2str(GeVnum2), <span class="string">' GeV'</span>]);</pre></div> |
---|
228 | <hr><address>Generated on Mon 21-May-2007 15:35:27 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> © 2003</address> |
---|
229 | </body> |
---|
230 | </html> |
---|