function rlookit(data, config, beamnum, reflrange);
% rlookit(data, config, beamnum, reflrange);
% beamnum 1-4
% show vel, sw, amp and measured refl in reflrange (bins)
%
% eg: dd = read(nb,..)
%     [data, config] = restruct(nb, dd);
%     rlookit(data, config, 1, [3 5])

if (nargin ~=4)
   help rlookit
   error('must specify beamnum and refl range')
end

if ~(exist('reflrange'))
   reflrange = [3 8];
end


data.mins = 24*60*(data.dday - data.dday(1));
config.abc_name = 'mins';
config.xlim = [data.mins(1) data.mins(end)];

reflrange = unique(reflrange);

%plot velocities
numplots = 4;
clg;whitebg('w')
cfg =aplotit(data, config, 'cur_ax', subplot(numplots,1,1), ...
             'fn', sprintf('vel%d', beamnum));
cfg =aplotit(data, config, 'cur_ax', subplot(numplots,1,2), ...
             'fn', sprintf('amp%d', beamnum));

if (isfield(data,sprintf('sw%d', beamnum)))
   cfg =aplotit(data, config, 'cur_ax', subplot(numplots,1,3), ...
                'fn', sprintf('sw%d', beamnum));
elseif (isfield(data,sprintf('cor%d', beamnum)))
   cfg =aplotit(data, config, 'cur_ax', subplot(numplots,1,3), ...
                'fn', sprintf('cor%d', beamnum));
end


eval(sprintf('vel = data.vel%d;', beamnum))
if (length(reflrange) > 1)
   refl = mstdgap(vel([reflrange(1):reflrange(2)],:));
else
   refl = vel(reflrange,:);
end
ax = subplot(numplots, 1, 4);
h = plot(data.mins, refl, 'k', 'linewidth', 1);
matchbox(ax, cfg.cur_ax, 'width')
xlabel('minutes')
ylabel('refl vel (m/s)')

date_it

if (length(reflrange) > 1)
   reflstr = sprintf('refl bins = [%d - %d]', reflrange(1), reflrange(2));
else
   reflstr = sprintf('refl bin = %d', reflrange(1));
end


subtitle_comment = ...
    sprintf('BEAM COORDS, raw data, %s, (dday %3.3f - %3.3f)',...
            reflstr, min(data.dday), max(data.dday));
subtitle(subtitle_comment)
