% tune_plots        - Plot some simple (crude) tune plots
%
% Copyright (c) 2009 Dimtel, Inc., All Rights Reserved
%
% $Id: tune_plots.m,v 1.1.1.1 2010/10/05 16:43:01 dim Exp $
% $Date: 2010/10/05 16:43:01 $
% $Author: dim $
% $Revision: 1.1.1.1 $
% $Log: tune_plots.m,v $
% Revision 1.1.1.1  2010/10/05 16:43:01  dim
% Initial import of iGp12
%
%

frev = rf_freq*1e3/ring_size;

% Define frequency selection index
u = find(prm.freq > f1 & prm.freq < f2);

% Search for minima
[foo, midx] = min(S(u,:));

% Plot the results
figure(2); clf
subplot(211);
h = plot(1:n, frev-prm.freq(u(midx))/1e3, '-o');
set(h, 'linewidth', 2, 'markersize', 7);
set(gca, 'fontsize', 14);
xlabel('Bunch number (4 ns)');
ylabel('Tune (kHz)');
grid;
subplot(212);
set(gca, 'fontsize', 14);
pcolor(1:n, frev-prm.freq(u)/1e3, log(S(u,:))); shading('interp');
xlabel('Bunch number (4 ns)');
ylabel('Frequency (kHz)');
grid;
