SCS=load('scs_repaired.dat');
TSG=load('tsg.log');

Ts=datenum(SCS(:,1:6));
Tt=datenum(TSG(:,1:6));

SCS(:,13)=interp1(Tt,tsg(:,12),Ts);

fid=fopen('scs_w_sss.dat','w');
fprintf(fid,'%4d %2d %2d  %2d %2d %2d  %02d %07.4f  %03d %07.4f  %g %g %g %g %g %g %g %g %g\n',SCS.');
fclose(fid);

track=[TSG(:,[8,7]),Tt];
I=find(track(:,1)==0 & track(:,2)==0); track(I,1:2)=NaN;
fid=fopen('whots8track','w');
fprintf(fid,'%10.5f %10.5f %17.9f\n',track.');
fclose(fid);

