function [est4log est] = updateResultSGMP(est);
%---------------------------------------------------------
% Update estimation result
% Ju-Yong Do,  Feb 2, 2009
%---------------------------------------------------------
% input  : est, oldEst
% output : est, oldEst
%=========================================================
%=========================================================
global opt const

%store result
est4log     = est;                  %store results for record
est4log     = rmfield(est4log, 'oldpos');       %not needed anymore
est4log     = rmfield(est4log, 'oldclkbias');   %not needed anymore
est4log     = rmfield(est4log, 'rotmat');       %not needed anymore

%store valid estimate to old
if est.valid, 
    est.oldpos      = est.pos;      %seed location
    est.oldclkbias  = est.clkbias;  %seed clk bias
    est.rotmat      = calRotMat(est.oldpos);%rotation matrix
end

%reset estimation variable
est.valid   = 0;                    %validity flag of next epoch data

return;
%=========================================================
%=========================================================