%
%   script to analyze the velocity and resuduals
%
load junk2.dat
lon=junk2(:,1);
lat=junk2(:,2);
ve=junk2(:,3);
vn=junk2(:,4);
vem=junk2(:,5);
vnm=junk2(:,6);
%
%   plot the locations of the GPD receivers
%
figure(1)
clf
orient tall
plot(lon,lat,'.');xlabel('longitude');ylabel('latitude')
%
%   plot the north and east velocities
%
figure(2)
clf
subplot(2,1,1);plot(ve,vem,'.')
axis([-25,25,-25,25])
xlabel('GPS Ve (mm/yr)')
ylabel('model Ve (mm/yr)')
axis('square')
grid
subplot(2,1,2);plot(vn,vnm,'.')
axis([-25,25,-25,25])
axis('square')
grid
xlabel('GPS Vn (mm/yr)')
ylabel('model Vn (mm/yr)')
%
%   now look at the histograms
figure(3)
clf
x=-25:25;
subplot(2,1,1);hist(ve-vem,x)
axis([-25,25,0,140])
median(ve-vem)
mad(ve-vem)
xlabel('Ve, GPS-model')
ylabel('# stations')
subplot(2,1,2);hist(vn-vnm,x)
axis([-25,25,0,140])
median(vn-vnm)
mad(vn-vnm)
xlabel('Vn, GPS-model')
ylabel('# stations')

