当前位置:   article > 正文

利用不同卫星的仰角方位角绘制站心星空图_站心坐标系 俯仰角

站心坐标系 俯仰角

简介

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

读取文件

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

绘制星空图

  1. function hpol = skyPlot(az, el, prn, ss)
  2. %% 准备坐标轴 ===========================================================
  3. hAxis = newplot([]);
  4. hold(hAxis, 'on');
  5. %--- 绘制圆环 --------------------------------------------------------
  6. rectangle('position', [-90, -90, 180, 180], ...
  7. 'Curvature', [1 1], ...
  8. 'facecolor', 'white', ...
  9. 'edgecolor', 'k');
  10. %--- 绘制辐条 ----------------------------------------------------
  11. th = (1:6) * 2*pi / 12;
  12. cst = cos(th); snt = sin(th);
  13. cs = [cst; -cst];
  14. sn = [snt; -snt];
  15. line(90*sn, 90*cs, 'linestyle', ':', 'color', 'k', 'linewidth', 0.5, ...
  16. 'handlevisibility', 'off');
  17. rt = 1.1 * 90;
  18. for i = 1:max(size(th))
  19. %--- 在绘图的右半部分标注方位角 -------------------------
  20. text(rt*snt(i), rt*cst(i), int2str(i*30), ...
  21. 'horizontalalignment', 'center', 'handlevisibility', 'off');
  22. if i == max(size(th))
  23. loc = int2str(0);
  24. else
  25. loc = int2str(180 + i*30);
  26. end
  27. %--- 在绘图的另一半标注方位角 ----------------------
  28. text(-rt*snt(i), -rt*cst(i), loc, ...
  29. 'handlevisibility', 'off', 'horizontalalignment', 'center');
  30. end
  31. %--- 绘制仰角网格 ----------------------------------------
  32. th = 0 : pi/50 : 2*pi;
  33. xunit = cos(th);
  34. yunit = sin(th);
  35. for elevation = 0 : 15 : 90
  36. elevationSpherical = 90*cos((pi/180) * elevation);
  37. line(yunit * elevationSpherical, xunit * elevationSpherical, ...
  38. 'lineStyle', ':', 'color', 'k', 'linewidth', 0.5, ...
  39. 'handlevisibility', 'off');
  40. text(0, elevationSpherical, num2str(elevation), ...
  41. 'BackgroundColor', 'white', 'horizontalalignment','center', ...
  42. 'handlevisibility', 'off');
  43. end
  44. %--- 切换为二维视角 ------------------------------------------------------
  45. view(0, 90);
  46. %--- 设定坐标轴范围 ------------------------------------------------------
  47. axis([-95 95 -90 101]);
  48. %% 将仰角转换为到中心的距离 ------
  49. elSpherical = 90*cos(el * pi/180);
  50. %--- 转换为笛卡尔坐标 ------------------------------
  51. yy = elSpherical .* cos(az * pi/180);
  52. xx = elSpherical .* sin(az * pi/180);
  53. %% 在网格顶部绘制数据 ===========================================
  54. hpol = plot(hAxis, xx', yy', '.-');
  55. %--- 标注卫星最后位置 ------------------------------
  56. plot(hAxis, xx(:,end)', yy(:,end)', 'o', 'MarkerSize', 7);
  57. %--- 标注卫星编号 -------------------
  58. for i = 1:length(prn)
  59. if(prn(i) ~= 0)
  60. text(xx(i, end), yy(i, end), [' ',ss, int2str(prn(i))], 'color', 'b');
  61. end
  62. end
  63. %--- 设定xy轴具有相同的数据纵横比 ------------------
  64. axis(hAxis, 'equal');
  65. %--- 关闭笛卡尔坐标系坐标轴 -------------------------------
  66. axis(hAxis, 'off');

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/989461
推荐阅读
相关标签
  

闽ICP备14008679号