% eosfig - plot upper ocean temperature for EOS article

clear all;close all;
load eospalette


figure(1); % zonal XBT section
colormap(C);
load xbt
q=find(lon>-40 & (lon<-23.25 | lat>20));
T=fillnans(temp(:,q),0);
% smooth
for i=1:size(T,2);
    T(:,i)=smooth(T(:,i),.02,'lowess');
end;

contourf(lon(q),z,T,5:28);
shading flat;
set(gca,'ydir','reverse');
hold on;
h=contour(lon(q),z,T,5:28,'k');
clabel(h);
hold off;
xtick=get(gca,'xtick');
set(gca,'xticklabel',num2str(abs(xtick)'))
xlabel('Longitude W')
ylabel('Depth (m)')


figure(2)
colormap(C);
clear all;
load eospalette
load ctd_xbt_merged
q=find(lon>-24 & lat>=4.9);

T=fillnans(temp(:,q),0);
% smooth
for i=1:size(T,2);
    T(:,i)=smooth(T(:,i),.02,'lowess');
end;

z=sw_dpth(p,mean(lat(q)));
contourf(lat(q),z,T,5:28);
shading flat;
set(gca,'ydir','reverse','ylim',[0 900]);
hold on;
h=contour(lat(q),z,T,5:28,'k');
clabel(h,'manual');
colorbarvert;
hold off;
%xtick=get(gca,'xtick');
%set(gca,'xticklabel',num2str(abs(xtick)'))
xlabel('Latitude N')
ylabel('Depth (m)')

