disp('red_bob')
kon=0.4;
fclose('all');
flist=fopen('c:\matlab\toolbox\local\otis231.txt','r');
%stuff=fgetl(flist);
%******************  setup read data loop  **********
nx=318;%2822;				%# of lines of data  
jamset=0; 
for ibg = 1:nx 			%major read loop
	stuf=fscanf(flist,'%g%g%g%g%g%g%g%g',[8,1]);
	stug=fscanf(flist,'%g%g%g%g%g%g%g%g',[8,1]);
	stuf1(ibg,1:8)=stuf';
	stuf2(ibg,1:8)=stug';
	if jamset==0;
		if stuf(1)==0;
			if stug(2)==700;
				j=ibg;
				jamset=1;
			end;
		end;
	end;
	if stuf1(ibg,1)==0;
		for ism = 1:28
			stux=fscanf(flist,'%g%g%g%g%g',[5,1]);
			u(ibg,ism)=stux(1);
			snr(ibg,ism)=stux(2);
			pw(ibg,ism)=stux(3);
			wd(ibg,ism)=stux(4);
		end;
	else;
		if stuf1(ibg)<3	
			for ism = 1:28
				stux=fscanf(flist,'%g%g%g%g%g',[5,1]);
				u(ibg,ism)=stux(1);
				snr(ibg,ism)=stux(2);
				pw(ibg,ism)=stux(3);
				wd(ibg,ism)=stux(4);
			end;%*********************************************
		else;
			for ism = 1:30
				stux=fscanf(flist,'%g%g%g%g%g',[5,1]);
				u(ibg,ism)=stux(1);
				snr(ibg,ism)=stux(2);
				pw(ibg,ism)=stux(3);
				wd(ibg,ism)=stux(4);
			end;%
		end;
	end;
	%*******   decode date  ************
	
	
end; %  data line loop
dj=0;
ny=nx/6;
for i=1:ny;
	in=j+6*(i-1);
	jday(i)=stuf1(in,5)+stuf1(in,6)/24+stuf1(in,7)/24/60;
	for k=1:28;
		w(i,k)=u(in,k);
		ux(i,k)=u(in+1,k);
		uy(i,k)=u(in+2,k);
	end;
	
end;

