-
Notifications
You must be signed in to change notification settings - Fork 10
/
getRinex.m
49 lines (44 loc) · 1.32 KB
/
getRinex.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
function [obs_time, prn, tecl_, tecp_] = getRinex(filename)
dbstop if error;
[~, ipath, opath] = ver_chk;
cd(strjoin({ipath, 'SolarEclipse'}, filesep));
outfmt = '.mat';
fpath = strjoin({ipath, 'SolarEclipse', filename}, filesep);
matpath = strjoin({ipath, 'SolarEclipse', [filename, outfmt]}, filesep);
if ~exist(matpath, 'file')
[obs, obs_qual, type_str, clk_off] = rd_rnx_o6(filename);
else
load(matpath);
end
[gps_time, prn, obsout] = refrinex3(obs, obs_qual, clk_off);
obs_time = datenum(gps2utc(gps_time(:, 1:2), gps_time(:, 3)));
obs_time = datenum(gps2utc(gps_time(:, 1:2)));
for i = 1:size(type_str, 1)
type = type_str(i, :);
switch type
case 'L1'
l1 = obsout{i};
case 'L2'
l2 = obsout{i};
case 'C1'
p1 = obsout{i};
case 'C2'
p2 = obsout{i};
end
end
[tecl_, tecp_] = getStec(l1, l2, p1, p2);
% ax1 = subplot(2,1,1);
% ax2 = subplot(2,1,2);
% hold(ax1, 'on');
% hold(ax2, 'on');
% for j = 1:length(prn)
% [tecl_, tecp_] = getStec(l1(:, j), l2(:, j), p1(:, j), p2(:, j));
% plot(ax1, obs_time, tecl_, '.');
% plot(ax2, obs_time, tecp_, '.');
% end
% title(ax1, ['Phase Slant TEC, PRN:']);
% title(ax2, ['Code Slant TEC, PRN:']);
% legend(ax2, num2str(prn));
% datetick(ax1, 'x', 'HH:MM');
% datetick(ax2, 'x', 'HH:MM');
end