clear;

load data/isabel_dat.mat;
load data/xland_isabel;
s_pres=squeeze(pres(1,:,:));
s_pres(XLAND<2)=NaN;

wind=squeeze(sqrt(u(1,:,:).^2+v(1,:,:).^2));

[a1, ny]=min(min(s_pres,[],2));
[a1, nx]=min(min(s_pres,[],1));

x=[1:374];
y=[1:288];
[X,Y]=meshgrid(x,y);

x1=x-nx;
y1=y-ny;
[X1,Y1]=meshgrid(x1,y1);

r=[0:100];
th=[0:360];
yy=r'*sind(th);
xx=r'*cosd(th);
[TH,R]=meshgrid(th,r);

s_pres_pol=interp2(X1,Y1,s_pres,xx,yy)/100;
wind_pol=interp2(X1,Y1,wind,xx,yy);

figure(1);
plot(r,nanmean(s_pres_pol,2));

figure(2);
plot(r,nanmean(wind_pol,2));

figure(3);
[AX,H1,H2]=plotyy(r,nanmean(s_pres_pol,2),r,nanmean(wind_pol,2),'plot');
set(get(AX(1),'Ylabel'),'String','surface pressure (Pa)','fontsize',12);
set(get(AX(2),'Ylabel'),'String','surface wind speed (m/s','fontsize',12);
xlabel('Radial distance (km)');
set(H1,'LineStyle','-','linewidth',2);
set(H2,'LineStyle','--','linewidth',2);
set(AX(1),'fontsize',12,'ylim',[930 1020],'ytick',[930:10:1020],'box','off');
set(AX(2),'fontsize',12,'ylim',[0 60],'ytick',[0:10:60],'xticklabe',[]);
hold off;


