function genigscodclk
C=299792458;
epoch=[2004,12,26,0,0,0];
td=caltomjd(epoch);
dirs='k:\gps\clk\%Y%m';
sats={}; for n=1:31, sats={sats{:},sprintf('GPS%02d',n)}; end

tims=0:300:86400; time=0:30:86400;
igsclk=readclk(caltomjd(epoch),tims,sats,dirs,'igs');
codclk=readclk(caltomjd(epoch),time,sats,dirs,'cod');

for n=1:length(sats)
    off=codclk(:,1,n)-interp1(tims,codclk(1:10:end,1,n),time)';
    data=C*(interp1(tims,igsclk(:,1,n),time)'+off);
    sat=sats{n};
    file=sprintf('clkf_%s_%04d%02d%02d%02d.mat',sat,epoch(1:4));
    save(file,'epoch','time','sat','data');
end
