%plot_all_4_sv_image.m

%NOTE: don't forget to make the "make104_...._image.m files

close all;fclose all;clear all;

filename='nbp103_119';

%colmap=colormap;              % datrange = 1e-4 to 1e-8
%%%%colmap=[colmap;ones(10,3)];   % add white for range -55 to -50dB
%m=32;
%g=[12:m-1]'/max(m-1,1);
%g=1-g;
%g=[g g g];
%colormap(cmap(1,100));         % make color map for -80 to -55 dB when
%colmap=colormap;              % datrange = 1e-4 to 1e-8
%colmap=[colmap;ones(10,3)];   % add white for range -55 to -50dB
%m=32;
%g=[12:m-1]'/max(m-1,1);
%g=1-g;
%g=[g g g];
%colmap=[colmap;g];            % add gray-scale for range -55 to -45dB
%colmap=[colmap;zeros(20,3)];  % add black for range -45 to -40dB
%colormap(colmap);
%save colmap colmap -ascii
%%%% datrange= max and min values for 10log(sv) data (Albatross IV data series)
%datrange =[10*log10(1e-4) 10*log10(1e-10)]; %this sets range of color bar.
%clegend5(datrange,'SV',.87);colmap=[colmap;g];            % add gray-scale for range -55 to -45dB

load (filename);


[r,c]=size(sv_1(:,8:end));

img = sv_1(:,8:407)';
img = 10*log10(img + 10^-10);  %% this is to not take the log of a negative number
yaxlab=(0:1.5:599);

xaxlab = sv_1(1:max(r),1);

figure
set(gcf,'units','normalized');

subplot(4,1,1)

imagesc(xaxlab,yaxlab,img);

%%%%%set(gca,'clim',[-100 -43]);   %This is to use same color scale for
%%%%%same channel day to day  -- get away from auto scaling

text(106.35, 521.664, '43 Khz','color','w','fontsize',[4]);

title('nbp0103\_119')

%%%set(gca,'units','normalized');   %not really needed

lasttime = size(img,2);
dtime = sv_2(lasttime,1) - sv_2(1, 1);

hold on;

subplot(4,1,2)
new_img = sv_2(:,8:407)';
new_img = 10*log10(new_img + 10^-10);
imagesc(xaxlab,yaxlab,new_img);

text(106.35, 521.664, '120 Khz','color','w','fontsize',[4]);

hold on;

subplot(4,1,3)
newer_img = sv_3(:,8:407)';

newer_img = 10*log10(newer_img + 10^-10);
imagesc(xaxlab,yaxlab,newer_img);
text(106.35, 521.664, '200 Khz','color','w','fontsize',[4]);


hold on;

subplot(4,1,4)
newest_img = sv_4(:,8:407)';
newest_img = 10*log10(newest_img + 10^-10);
imagesc(xaxlab,yaxlab,newest_img);
text(106.35, 521.664, '420 Khz','color','w','fontsize',[4]);

xlabel('time');
ylabel('depth');

hold on;

%%%colorbar;

print -djpeg nbp103_119_all.jpg
