利用不同卫星的仰角方位角绘制站心星空图

简介

        站心坐标系,是以接收机位置作为zh,正北方向为方位角零度方向,天顶方向为仰角90°方向的坐标系。计算不同卫星相对于接收机位置的仰角与方位角,确定卫星在坐标系中的位置,即可绘制站心星空图。中心

读取文件

         上图为不同编号卫星的仰角与方位角信息。首先读取文件:

绘制星空图

function hpol = skyPlot(az, el, prn, ss)
%% 准备坐标轴 ===========================================================
hAxis = newplot([]);
hold(hAxis, 'on');
%--- 绘制圆环 --------------------------------------------------------
rectangle('position', [-90, -90, 180, 180], ...
          'Curvature', [1 1], ...
          'facecolor', 'white', ...
          'edgecolor', 'k');
%--- 绘制辐条 ----------------------------------------------------
th = (1:6) * 2*pi / 12;
cst = cos(th); snt = sin(th);
cs = [cst; -cst];
sn = [snt; -snt];
line(90*sn, 90*cs, 'linestyle', ':', 'color', 'k', 'linewidth', 0.5, ...
    'handlevisibility', 'off');
rt = 1.1 * 90;
for i = 1:max(size(th))
    %--- 在绘图的右半部分标注方位角 -------------------------
    text(rt*snt(i), rt*cst(i), int2str(i*30), ...
        'horizontalalignment', 'center', 'handlevisibility', 'off');
    if i == max(size(th))
        loc = int2str(0);
    else
        loc = int2str(180 + i*30);
    end
    %--- 在绘图的另一半标注方位角 ----------------------
    text(-rt*snt(i), -rt*cst(i), loc, ...
        'handlevisibility', 'off', 'horizontalalignment', 'center');
end

%--- 绘制仰角网格 ----------------------------------------
th = 0 : pi/50 : 2*pi;
xunit = cos(th);
yunit = sin(th);
for elevation = 0 : 15 : 90
    elevationSpherical = 90*cos((pi/180) * elevation);
    line(yunit * elevationSpherical, xunit * elevationSpherical, ...
        'lineStyle', ':', 'color', 'k', 'linewidth', 0.5, ...
        'handlevisibility', 'off');
    text(0, elevationSpherical, num2str(elevation), ...
        'BackgroundColor', 'white', 'horizontalalignment','center', ...
        'handlevisibility', 'off');
end
%--- 切换为二维视角 ------------------------------------------------------
view(0, 90);
%--- 设定坐标轴范围 ------------------------------------------------------
axis([-95 95 -90 101]);
%% 将仰角转换为到中心的距离 ------
elSpherical = 90*cos(el * pi/180);
%--- 转换为笛卡尔坐标 ------------------------------
yy = elSpherical .* cos(az * pi/180);
xx = elSpherical .* sin(az * pi/180);
%% 在网格顶部绘制数据 ===========================================
hpol = plot(hAxis, xx', yy', '.-');
%--- 标注卫星最后位置 ------------------------------
plot(hAxis, xx(:,end)', yy(:,end)', 'o', 'MarkerSize', 7);

%--- 标注卫星编号 -------------------
for i = 1:length(prn)
    if(prn(i) ~= 0)
        text(xx(i, end), yy(i, end), ['  ',ss, int2str(prn(i))], 'color', 'b');
    end
end
%--- 设定xy轴具有相同的数据纵横比 ------------------
axis(hAxis, 'equal');
%--- 关闭笛卡尔坐标系坐标轴 -------------------------------
axis(hAxis, 'off');

  • 1
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

程度上可能

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值