function plot_blendsm(data)
% plot_blendsm(data)
%must have already run blend_sm.m to get data

%[date refu refv shipu shipv lng lat ?]     

ideep = data.ideep;
smask = ones(size(data.deep(:,1)));
smask(ideep) = 0;
ishallow = find(smask == 1);
ylim = [-1.2 1.2];

clg
subplot(411)
h=plot(data.shallow(:,1), data.shallow(:,2),'g');lw(h,2)
hold on
h=plot(data.shallow(ishallow,1), data.shallow(ishallow,2),'k+');
set(gca, 'ylim', ylim)
set(h, 'markersize', 3)
h = title('shallow u reference layer')
set(h,'position', get(h,'position') - [0 .2*diff(ylim) 0])
set(gca, 'xlim', [min(data.deep(:,1)) max(data.deep(:,1))])
set(gca, 'xtick', [])


subplot(412)
h=plot(data.deep(:,1), data.deep(:,2),'c');lw(h,2)
hold on
h=plot(data.deep(ideep,1), data.deep(ideep,2),'k+');
set(gca, 'ylim', ylim)
set(h, 'markersize', 3)
h = title('deep u reference layer')
set(h,'position', get(h,'position') - [0 .2*diff(ylim) 0])
set(gca, 'xlim', [min(data.deep(:,1)) max(data.deep(:,1))])
pos = get(gca, 'position');
set(gca, 'pos', pos + [0 .04 0 0])
xlabel('decimal day')

%=======================================================

h3 = subplot(413);
h=plot(data.shallow(:,1), data.shallow(:,3),'g');lw(h,2)
hold on
h=plot(data.shallow(ishallow,1), data.shallow(ishallow,3),'k+');
set(gca, 'ylim', ylim)
set(h, 'markersize', 3)
h = title('shallow v reference layer')
set(h,'position', get(h,'position') - [0 .2*diff(ylim) 0])
set(gca, 'xlim', [min(data.deep(:,1)) max(data.deep(:,1))])
set(gca, 'xtick', [])
pos = get(h3, 'position');
set(gca, 'pos', pos + [0 -.04 0 0])


subplot(414)
h=plot(data.deep(:,1), data.deep(:,3),'c');lw(h,2)
hold on
h=plot(data.deep(ideep,1), data.deep(ideep,3),'k+');
set(gca, 'ylim', ylim)
set(h, 'markersize', 3)
h = title('deep v reference layer')
set(h,'position', get(h,'position') - [0 .2*diff(ylim) 0])
set(gca, 'xlim', [min(data.deep(:,1)) max(data.deep(:,1))])
pos = get(gca, 'position');
xlabel('decimal day')



orient tall
print -dpsc blendsm.ps
