function deref_u = deref(u, reflrange)
% deref_u = deref(u, reflrange)
% dereference a velocity matrix of size (Nbins x Ntimes)

if (length(reflrange) > 1)
   refu = mstdgap(data.umeas([reflrange(1):reflrange(2)],:));
else
   refu = data.umeas(reflrange,:);
end


deref_u = u - ones(length(u(:,1)),1)*refu;



