source: MML/trunk/mml/at/plottwiss.m @ 4

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

Initial import--MML version from SOLEIL@2013

File size: 1.0 KB
Line 
1function plottwiss(varargin)
2%PLOTTWISS - Plot the optical functions and tune of the present lattice
3
4
5%[TD, Tune] = twissring(RING,0,1:(length(RING)+1),'chrom');
6
7[BetaX, BetaY, Sx, Sy, Tune] = modeltwiss('Beta', 'All');
8[EtaX, EtaY] = modeltwiss('Eta', 'All');
9
10
11%figure
12clf reset;
13
14plot(Sx, BetaX, '-b');
15hold on;
16plot(Sy, BetaY, 'r');
17plot(Sx, 100*EtaX, '-g');
18plot(Sy, 100*EtaY, '-m');
19
20xlabel('s - position [meters]');
21%ylabel('[meters]');
22title(sprintf('Optical Functions ({\\it \\nu_x} = %5.3f, {\\it \\nu_y} = %5.3f)', Tune(1),Tune(2)));
23
24axis tight;
25
26
27% Plot 1 sector
28a = axis;
29N = getnumberofsectors;
30L = getfamilydata('Circumference');
31if ~isempty(L) && ~isempty(N)
32    a(2) = L / N;
33end
34
35% Make room for the lattice
36DeltaY = a(4) - a(3);
37a(3) = a(3) - .12 * DeltaY;
38axis(a);
39
40
41% Draw the lattice
42a = axis;
43drawlattice(a(3)+.06*DeltaY, .05*DeltaY);
44axis(a);
45hold off;
46
47
48legend('{\it\beta_x [meters]}','{\it\beta_y [meters]}','{\it\eta_x [cm]}','{\it\eta_y [cm]}',0);
49%legend('{\it\beta_x}','{\it\beta_y}','{\it\eta_x \times 100}','{\it\eta_y \times 100}',0);
Note: See TracBrowser for help on using the repository browser.