% . . IMGSTACK figure
clear all ; clc; close all;
A = load_data(load_history('EC-STACK.H'));
ELLIPTIC=A.data;
ELLIPTIC = ELLIPTIC / max(abs(ELLIPTIC(:)));
B = load_data(load_history('CC-STACK.H'));
CART=B.data;
CART = CART / max(abs(CART(:)));
zaxis = ([0:B.n(1)-1]*B.d(1)+B.o(1))/1000.;
xaxis = ([0:B.n(2)-1]*B.d(2)+B.o(2))/1000.;

pcut=prctile(CART(:),98.5);
figure(1)
%subplot(211)
axes('position',[0.1 0.075 0.9 0.4])

imagesc(xaxis,zaxis,CART,[-pcut pcut])
t1=xlabel('Distance (km)');
t2=ylabel('Depth (km)');
axis ij
axis equal
axis tight
t3 = text(3,-0.5,'b)');
set(t3,'FontSize',16);


%subplot(212)
axes('position',[0.1 0.575 0.9 0.4])
imagesc(xaxis',zaxis,ELLIPTIC,[-pcut pcut])
t1=xlabel('Distance (km)');
t2=ylabel('Depth (km)');
axis ij
axis equal
axis tight
colormap('gray')
t3 = text(3,-0.5,'a)');
set(t3,'FontSize',16);


print -depsc2 IMGSTACK.eps
dos('epstopdf IMGSTACK.eps');
dos('cp IMGSTACK.pdf ./Fig');






