2018-03-30 10:33:11 +02:00
|
|
|
% Opens GNSS-SDR tracking binary log file .dat and returns the contents
|
|
|
|
%
|
|
|
|
|
|
|
|
% -------------------------------------------------------------------------
|
|
|
|
%
|
2020-12-30 13:35:06 +01:00
|
|
|
% GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
2018-03-30 10:33:11 +02:00
|
|
|
% This file is part of GNSS-SDR.
|
|
|
|
%
|
2020-12-30 13:35:06 +01:00
|
|
|
% SPDX-FileCopyrightText: Javier Arribas 2011
|
2020-02-08 01:20:02 +01:00
|
|
|
% SPDX-License-Identifier: GPL-3.0-or-later
|
2018-03-30 10:33:11 +02:00
|
|
|
%
|
|
|
|
% -------------------------------------------------------------------------
|
2012-04-11 10:43:35 +00:00
|
|
|
|
2018-03-30 10:33:11 +02:00
|
|
|
function [observables] = read_hybrid_observables_dump (channels, filename, count)
|
2012-04-11 10:43:35 +00:00
|
|
|
|
2018-03-30 10:33:11 +02:00
|
|
|
m = nargchk (1,2,nargin);
|
|
|
|
num_double_vars=7;
|
|
|
|
double_size_bytes=8;
|
|
|
|
skip_bytes_each_read=double_size_bytes*num_double_vars*channels;
|
|
|
|
bytes_shift=0;
|
|
|
|
if (m)
|
2012-04-11 10:43:35 +00:00
|
|
|
usage (m);
|
2018-03-30 10:33:11 +02:00
|
|
|
end
|
2012-04-11 10:43:35 +00:00
|
|
|
|
2018-03-30 10:33:11 +02:00
|
|
|
if (nargin < 3)
|
2012-04-11 10:43:35 +00:00
|
|
|
count = Inf;
|
2018-03-30 10:33:11 +02:00
|
|
|
end
|
|
|
|
%loops_counter = fread (f, count, 'uint32',4*12);
|
|
|
|
f = fopen (filename, 'rb');
|
|
|
|
if (f < 0)
|
|
|
|
else
|
2012-04-11 10:43:35 +00:00
|
|
|
for N=1:1:channels
|
2017-07-28 18:24:36 +02:00
|
|
|
observables.RX_time(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
|
|
|
|
bytes_shift=bytes_shift+double_size_bytes;
|
|
|
|
fseek(f,bytes_shift,'bof'); % move to next interleaved
|
2013-10-30 18:08:25 +00:00
|
|
|
observables.d_TOW_at_current_symbol(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
|
2012-04-11 10:43:35 +00:00
|
|
|
bytes_shift=bytes_shift+double_size_bytes;
|
|
|
|
fseek(f,bytes_shift,'bof'); % move to next interleaved
|
2017-07-28 18:24:36 +02:00
|
|
|
observables.Carrier_Doppler_hz(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
|
2012-04-11 10:43:35 +00:00
|
|
|
bytes_shift=bytes_shift+double_size_bytes;
|
|
|
|
fseek(f,bytes_shift,'bof'); % move to next interleaved
|
2017-07-28 18:24:36 +02:00
|
|
|
observables.Carrier_phase_hz(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
|
2012-04-11 10:43:35 +00:00
|
|
|
bytes_shift=bytes_shift+double_size_bytes;
|
|
|
|
fseek(f,bytes_shift,'bof'); % move to next interleaved
|
2017-07-28 18:24:36 +02:00
|
|
|
observables.Pseudorange_m(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
|
2012-04-11 10:43:35 +00:00
|
|
|
bytes_shift=bytes_shift+double_size_bytes;
|
|
|
|
fseek(f,bytes_shift,'bof'); % move to next interleaved
|
|
|
|
observables.PRN(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
|
|
|
|
bytes_shift=bytes_shift+double_size_bytes;
|
|
|
|
fseek(f,bytes_shift,'bof'); % move to next interleaved
|
2017-07-28 18:24:36 +02:00
|
|
|
observables.valid(N,:) = fread (f, count, 'float64',skip_bytes_each_read-double_size_bytes);
|
|
|
|
bytes_shift=bytes_shift+double_size_bytes;
|
|
|
|
fseek(f,bytes_shift,'bof'); % move to next interleaved
|
2012-04-11 10:43:35 +00:00
|
|
|
end
|
2020-12-30 13:35:06 +01:00
|
|
|
|
2012-04-11 10:43:35 +00:00
|
|
|
fclose (f);
|
2020-12-30 13:35:06 +01:00
|
|
|
|
2012-04-11 10:43:35 +00:00
|
|
|
%%%%%%%% output vars %%%%%%%%
|
2018-03-30 10:33:11 +02:00
|
|
|
% double tmp_double;
|
|
|
|
% for (unsigned int i = 0; i < d_nchannels; i++)
|
|
|
|
% {
|
|
|
|
% tmp_double = current_gnss_synchro[i].RX_time;
|
|
|
|
% d_dump_file.write((char*)&tmp_double, sizeof(double));
|
2018-06-05 22:53:34 +02:00
|
|
|
% tmp_double = current_gnss_synchro[i].TOW_at_current_symbol_ms;
|
2018-03-30 10:33:11 +02:00
|
|
|
% d_dump_file.write((char*)&tmp_double, sizeof(double));
|
|
|
|
% tmp_double = current_gnss_synchro[i].Carrier_Doppler_hz;
|
|
|
|
% d_dump_file.write((char*)&tmp_double, sizeof(double));
|
|
|
|
% tmp_double = current_gnss_synchro[i].Carrier_phase_rads/GPS_TWO_PI;
|
|
|
|
% d_dump_file.write((char*)&tmp_double, sizeof(double));
|
|
|
|
% tmp_double = current_gnss_synchro[i].Pseudorange_m;
|
|
|
|
% d_dump_file.write((char*)&tmp_double, sizeof(double));
|
|
|
|
% tmp_double = current_gnss_synchro[i].PRN;
|
|
|
|
% d_dump_file.write((char*)&tmp_double, sizeof(double));
|
|
|
|
% tmp_double = current_gnss_synchro[i].Flag_valid_pseudorange;
|
|
|
|
% d_dump_file.write((char*)&tmp_double, sizeof(double));
|
|
|
|
% }
|
|
|
|
end
|