function [Vrm,scale,ee]=vpair(x,z,u,w,xd1,zd1,xd2,zd2,xd,zd,az,el,Vreff,thetaprime)

xx=x+xd2*ones(size(x));
zz=z+zd2*ones(size(z));
UUR=interp2(xx,zz,u,xd,zd,'linear',0.0);
WWR=interp2(xx,zz,w,xd,zd,'linear',0.0);

xx=x+xd1*ones(size(x));
zz=z+zd1*ones(size(z));
UUL=interp2(xx,zz,-u,xd,zd,'linear',0.0);
WWL=interp2(xx,zz,-w,xd,zd,'linear',0.0);
UU=0.5*UUL+0.5*UUR;
WW=0.5*WWL+0.5*WWR;
UUP=UU*cosd(thetaprime);
VVP=UU*sind(thetaprime);
Vrm=sind(az).*cosd(el).*UUP+cosd(az).*cosd(el).*VVP+sind(el).*WW;
in=find(~isnan(Vreff)&abs(Vrm)>0.001);
%scale=mean(abs(Vreff(in))./abs(Vrm(in)));
ee=pcorr(Vreff(in),Vrm(in));
scale=std(Vreff(in))/std(Vrm(in));
%ee=sqrt(sum((Vreff(in)-Vrm(in)*scale).^2)/length(Vrm(in)));
return
end