function glo_eph = rinex_nav_to_eph_GLO(rinex_nav_file)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% wxd 20100328 读取rinex文件
% function rinex_nav_to_eph(rinex_nav_file,eph_file)
%
% This function reads in a standard RINEX ephemeris file and converts %
% it to the standard binary eph format for ephemeris data. %
% %
% Input parameters: %
% rinex_nav_file: The name of the file containing the RINEx data %
% eph_file: the desired name of the binary output eph file %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
format long;
check = 0;EOH = 0;
fin = fopen(rinex_nav_file,'rt');
prn_vec=zeros(32,1);
max_vec=zeros(32,1);
min_vec=ones(32,1)*999999;
eph_array = [];
if fin<0
disp(sprintf('Error opening RINEX nav file %s',rinex_nav_file))
else
%% section to avoid the header information %%
while EOH == 0
nextline = fgetl(fin);
headline = sscanf(nextline,'%s');
check = strmatch('ENDOFHEADER',headline,'exact');
if length(check)>0
if check == 1
EOH = 1;
end
end
end
i = 0;
while feof(fin) == 0
i = i+1;
nextline_1 = fgetl(fin);
%line_1 = sscanf(nextline_1,'%e');
line_1 = get_data_from_line(nextline_1);
nextline_2 = fgetl(fin);
%line_2 = sscanf(nextline_2,'%e');
line_2 = get_data_from_line(nextline_2);
nextline_3 = fgetl(fin);
%line_3 = sscanf(nextline_3,'%e');
line_3 = get_data_from_line(nextline_3);
nextline_4 = fgetl(fin);
%line_4 = sscanf(nextline_4,'%e');
line_4 = get_data_from_line(nextline_4);
toc = line_1(10);
glo_eph(i).toc = toc;
glo_eph(i).x = line_2(1)*1000;
glo_eph(i).xv = line_2(2)*1000;
glo_eph(i).xa = line_2(3)*1000;
glo_eph(i).y = line_3(1)*1000;
glo_eph(i).yv = line_3(2)*1000;
glo_eph(i).ya = line_3(3)*1000;
glo_eph(i).z = line_4(1)*1000;
glo_eph(i).zv = line_4(2)*1000;
glo_eph(i).za = line_4(3)*1000;
glo_eph(i).tau = line_1(8);
glo_eph(i).delta_tau = line_1(9);
end
end
- 1
- 2
前往页