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