source: MML/trunk/machine/SOLEIL/common/naff/naffutils/tracy_readnudp.m @ 4

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

Initial import--MML version from SOLEIL@2013

File size: 1.2 KB
Line 
1function [dp nux nuz] = tracy_readnudp(file)
2% function tracy_readnudp(file)
3% plot tune shift with energy from tracy output file
4
5DisplayFlag = 0;
6
7if nargin < 1
8    file ='nudp.out'
9end
10
11try
12    [header data] = hdrload(file);
13catch
14    error('Error while opening filename %s',file)
15end
16
17%% energy in percent
18dp = data(:,1)*100;
19
20%% fractional tunes
21nux = data(:,2);
22nuz = data(:,3);
23nux(nux==0)=NaN;
24nuz(nuz==0)=NaN;
25
26%% closed orbit
27xcod = data(:,4)*1e3;
28zcod = data(:,5)*1e3;
29
30if DisplayFlag
31    %% Set default properties
32    set(0,'DefaultAxesXgrid','on');
33    set(0,'DefaultAxesYgrid','on');
34
35    %% Plot
36    figure(44)
37    subplot(1,2,1)
38    plot(dp,nux,'.')
39    xlabel('\delta (%)')
40    ylabel('\nu_x')
41
42    subplot(1,2,2)
43    plot(dp,nuz,'.')
44    xlabel('\delta (%)')
45    ylabel('\nu_z')
46    suptitle('Tune shift with energy')
47
48    addlabel(0,0,datestr(now))
49
50    h=figure(45)
51    pos=get(h,'Position');
52    set(h,'Position', [pos(1:2)  900 380]);
53    subplot(1,2,1)
54    plot(dp,xcod,'.')
55    xlabel('\delta (%)')
56    ylabel('xcod (mm)')
57
58    subplot(1,2,2)
59    plot(dp,zcod,'.')
60    xlabel('\delta (%)')
61    ylabel('zcod (mm)')
62    suptitle('Closed orbit variation with energy')
63
64    addlabel(0,0,datestr(now))
65end
Note: See TracBrowser for help on using the repository browser.