function srshift(t)
% compute gps around-time offset to sidereal day
dirs='k:\gps\nav\%Y%m';
srday=86164; % sidereal day time(sec)=23:56:04
MU=3.986005E14;

[nav,inav]=readnav(caltomjd(t),0,{},{},dirs,'brdc');
offset=repmat(nan,31,1);
for i=1:31
    j=min(find(inav==i));
    if ~isempty(j)
        n=sqrt(MU/nav(j,17)^6)+nav(j,12);
        offset(i)=2*2*pi/n-srday;
    end
end
offset(32)=mean(offset(~isnan(offset))); % average

disp(sprintf('GPS AROUND TIME OFFSET TO SIDEREAL DAY (sec) : %04d/%02d/%02d',t))
for n={1:16,17:32}
    disp(sprintf('   %02d ',n{:})), disp(sprintf('%5.1f ',offset(n{:})))
end
