【Skyplot】卫星天空视图绘制

1. 绘制天空视图源码(Matlab)

clear;clc;
close all

filename='posgo_azel.txt';
fid = fopen(filename, 'r');MAXSAT=211;ix=0;
az=zeros(1,MAXSAT);el=zeros(1,MAXSAT);
% read file
while(1)
    line=fgetl(fid);
    if (line == -1)
        break;
    end
    if(line(1:1)=='>')
        fprintf('%s\n',line);ix=ix+1;
        yr=str2double(line(3:6));mon=str2double(line(8:9));day=str2double(line(11:12));
        hr=str2double(line(14:15));min=str2double(line(17:18));sec=str2double(line(20:26));
    else
        if(line(1:1)=='G')
            prn_s=0;
        elseif(line(1:1)=='R')
            prn_s=32;
        elseif(line(1:1)=='E')
            prn_s=59;
        elseif(line(1:1)=='C')
            prn_s=95;
        end
        sat=prn_s+str2double(line(2:3));
        az(ix,sat)=str2double(line(4:12));el(ix,sat)=str2double(line(13:21));
    end
end

tip=1;ms=5;
for i=1:MAXSAT
    id=find(abs(az(:,i))>0);
    if ~isempty(id)
        [row,col]=size(id);
        rho = rad2deg(el(id,i));% 极径=90度-高度角(deg)
        theta =az(id,i); % 极角=方位角(rad)
        if(i<33)
            polarplot(theta, rho, 'b.','MarkerSize',ms);
            leg{tip}=num2str(i,'G%02d');tip=tip+1;%#ok
        elseif(i<32+27)
            polarplot(theta, rho, 'c.','MarkerSize',ms);
            leg{tip}=num2str(i-32,'R%02d');tip=tip+1;%#ok
        elseif(i<32+27+36)
            polarplot(theta, rho, 'm.','MarkerSize',ms);
            leg{tip}=num2str(i-32-27,'E%02d');tip=tip+1;%#ok
        else
            polarplot(theta, rho, 'r.','MarkerSize',ms);
            leg{tip}=num2str(i-95,'C%02d');tip=tip+1;%#ok
        end
        text(theta(end), rho(end), leg{tip-1}, 'HorizontalAlignment', 'center',...
            'VerticalAlignment', 'middle','FontName','Times New Roman');
        hold on
    end
end
rlim([0,90]); % 设置极径范围(0到90度)
thetaticks([0:30:360]);%#ok
ax=gca;
ax.ThetaZeroLocation = 'top';
ax.RTick=[0,15,30,45,60,75,90];
ax.RTickLabel={'','15','30','45','60','75',''};
ax.RDir='reverse';
ax.ThetaTickLabel={'North','30^{o}','60^{o}','East','120^{o}','150^{o}',...
    'South','210^{o}','240^{o}','West','300^{o}','330^{o}'};
set(gca,'FontName','Times New Roman','ThetaDir','clockwise',...
    'GridLineStyle','--','gridalpha',0.5,'Fontsize',11);

2. 绘图结果

(1) rtklib plot

(2) 脚本绘图

注:部分系统中的卫星(如E14)因健康状况或其它原因被剔除,即未参与解算,导致脚本未输出其信息。


参考链接

文中测试数据(提取码:0817)

【rtkplot】天空视图及问题解决方案-CSDN博客

评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值