% Plot average conversion into mode-1
path='/projects/awacs/PE/2013/Apr08_skelly/for_Tim/';
load([path,'small'])

% Plot average mode-1 pressure amplitude and phase (with generation contour)
BTamp=squeeze(nanmean(abs(small.Ptot(:,:,:,1))));
BTphase=squeeze(nanmean(angle(small.Ptot(:,:,:,1))));
H=small.H;

mode=1;
amp=squeeze(nanmean(abs(small.Ptot(:,:,:,mode+1))));
phase=squeeze(nanmean(angle(small.Ptot(:,:,:,mode+1))));
C=squeeze(nanmean(small.Cn(:,:,:,mode+1)));

% Actual figure
subplot(2,2,1)
pcolor(small.lon,small.lat,BTamp);shading flat;caxis([4000 5500]);colorbar;hold on;
contour(small.lon,small.lat,H,[0:100:5000],'k');
title('BT pressure amplitude [Pa]')

subplot(2,2,2)
pcolor(small.lon,small.lat,BTphase*360/(2*pi));shading flat;caxis([-180 180]);colorbar;hold on;
contour(small.lon,small.lat,H,[0:100:5000],'k');
title('BT pressure phase [deg]')

subplot(2,2,3)
pcolor(small.lon,small.lat,amp);shading flat;caxis([0 50]);colorbar;hold on;
contour(small.lon,small.lat,C,[.01 .01],'k');
title('Mode-1 pressure amplitude [Pa]')

subplot(2,2,4)
pcolor(small.lon,small.lat,phase*360/(2*pi));shading flat;caxis([-180 180]);colorbar;hold on;
contour(small.lon,small.lat,C,[.01 .01],'k');
title('Mode-1 pressure phase [deg]')

print('-dpng','-r720',[path,'amp_phase']);
