% for entrance77massave;  estimate pairwise frame 7 to 8
% i found it was not needed anymore with the multiscale parameter estimator
% (seemed to be only needed with est_pchrirp2r, but not with est_pchirp2m)

M=480; N=640;
err_history=[]; p=[];
filt = [1 1 1 1 1 1 1];

l = 8;% test on pairwise of frames 7 and 8  (problem frames)
  A = eval(sprintf('loadframe(%d)',l-1));
  % Af=filt2d(A,filt);
  figure(1);  % keep from running out of memory (limit fig use)
  B = eval(sprintf('loadframe(%d)',l));
  % Bf=filt2d(B,filt);
  disp(sprintf('--- estimating translation frame 0 to %d',l))
  p_trans=est_trans_fft2(A,B); % now takes B to A
  disp('setting translation in ``m'' direction to zero')
  p_trans(3)=0;
  % disp('--- doing single level (est_pchirp2r instead of est_pchirp2m)')
  p0708=est_pchirp2m(A,B,6,5,p_trans,1);%6 iterations per level is quite a lot
  mse=mean2nan(abs(A-pchirp2(p0708,B)));
  err_history0708=mse;
  s = sprintf('save entrance77_parameters_pairwise0708m p0708 err_history0708');
  disp(s)
  eval(s)
end%for
save

