source: MML/trunk/machine/SOLEIL/common/naff/naffutils/plot_fmapdp.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: 2.8 KB
Line 
1function plot_fmapdp(file)
2% PLOT_FMAPDP - Plot frequency map
3% plot_fmapdp('fmapdp.out')
4%
5%  INPUTS
6%  1. file - filename for plotting frequency maps (output file from Tracy
7%  II)
8%
9%  See also naffgui, plot_fmap, resongui
10
11%
12% Written Laurent S. Nadolski, SOLEIL, 03/04
13% Modifications for R14 compatibility, June'05
14
15%% grille par defaut
16set(0,'DefaultAxesXgrid','on');
17set(0,'DefaultAxesYgrid','on');
18pwd0 = pwd;
19 
20if nargin <1
21  help (mfilename)
22  file ='fmapdp.out';
23end
24
25try
26    [dp x fx fz dfx dfz] = textread(file,'%f %f %f %f %f %f','headerlines',3);
27catch
28    error('Error while opening filename %s',file)
29end
30
31%% ajoute parties entieres
32fx=18+abs(fx);
33fz=10+abs(fz);
34%% energie en %
35dp = dp*1e2;
36%% position en mm
37x = x*1e3;
38           
39% select stable particles
40indx=(fx~=18.0);
41
42%% carte N&B
43figure; clf;
44subplot(2,1,1)
45plot(fx,fz,'.','MarkerSize',0.5)
46xlabel('\nu_x'); ylabel('\nu_z')
47%axis([18.15 18.27 10.265 10.32])
48
49subplot(2,1,2)
50plot(dp(indx),x(indx),'.','MarkerSize',0.5); hold on
51ind_amplitude
52xlabel('\delta (%)'); ylabel('x(mm)')
53[pathName DirName] = fileparts (pwd0);
54addlabel(0,0, DirName);
55
56%% Carte avec diffusion
57figure; clf
58dpgrid = [];
59xgrid = [];
60dfxgrid = [];
61dfzgrid = [];
62fxgrid = [];
63fzgrid = [];
64
65%% Calcul automatique de la taille des donnees
66nx = sum(dp==dp(1));
67ndp = size(dp,1)/nx;
68
69xgrid = reshape(x,nx,ndp);
70dpgrid = reshape(dp,nx,ndp);
71fxgrid = reshape(fx,nx,ndp);
72fzgrid = reshape(fz,nx,ndp);
73dfxgrid = reshape(dfx,nx,ndp);
74dfzgrid = reshape(dfz,nx,ndp);
75
76%% Diffusion
77temp = sqrt(dfxgrid.*dfxgrid+dfzgrid.*dfzgrid);
78nonzero = (temp ~= 0);
79diffu = NaN*ones(size(temp));
80diffu(nonzero) = log10(temp(nonzero));
81clear nonzero temp;
82
83% diffu = log10(sqrt(dfxgrid.*dfxgrid+dfzgrid.*dfzgrid));
84
85%% saturation
86% ind = isinf(diffu);
87% diffu(ind) = NaN;
88diffumax = -2; diffumin = -10;
89diffu(diffu< diffumin) = diffumin; % very stable
90diffu(diffu> diffumax) = diffumax; %chaotic
91diffu(end)    = diffumin;
92diffu(end-1) = diffumax;
93
94%% fmap
95h1=subplot(2,1,1);
96
97% Get Matlab version
98v = ver('matlab');
99
100if strcmp(v.Release,'(R13SP1)')
101    mesh(fxgrid,fzgrid,diffu,'LineStyle','.','MarkerSize',5.0,'FaceColor','none');
102else % For Release R14 and later
103    mesh(fxgrid,fzgrid,diffu,'Marker','.','LineStyle','none','MarkerSize',5.0,'FaceColor','none');
104end
105
106caxis([-10 -2]); % Echelle absolue
107%axis([18.15 18.27 10.26 10.32])
108% axis([18.195 18.27 s10.26 10.32])
109set(gca,'View',[0 90]);
110hold on
111shading flat
112%hp=colorbar('horiz');
113xlabel('\nu_x')
114ylabel('\nu_z')
115
116%% DA
117h2=subplot(2,1,2);
118%% colorbar position
119% p1 = get(h1,'position'); p2 = get(h2,'position'); p0 = get(hp,'position');
120% set(hp,'position',[p0(1) p1(2) - 1.2*(p1(2)-p2(2)-p2(4))/2 p0(3:4)]);
121%
122 pcolor(dpgrid,xgrid,diffu); hold on
123 caxis([-10 -2]); % Echelle absolue
124 shading flat
125xlabel('dp (%)')
126ylabel('x(mm)')
127%axis([-6 6 -25 0 ])
128% ind_amplitude
129[pathName DirName] = fileparts (pwd0);
130addlabel(0,0, DirName);
Note: See TracBrowser for help on using the repository browser.