📄 plskyplt.m
字号:
function plskyplt (eph,azim,elev,cutoff)%PLELETIM: Create skyplot%% The function create a plot showing the elevation and azimuths% of GPS satellites in time (2D)%% Syntax:% plskyplt (eph,azim,elev,cutoff);%% Input arguments:% eph - Ephemerides% azim - Azimuth of satellites% elev - Elevation for each satellite% cutoff - Cutoff elevation%% Output arguments:% none% ----------------------------------------------------------------------% File.....: plskyplt.m% Date.....: 29-APR-1999% Version..: 1.0% Author...: Peter Joosten% Mathematical Geodesy and Positioning% Delft University of Technology% ----------------------------------------------------------------------% --------------------------------------% --- Create the figure, set options ---% --------------------------------------h = figure('Units','normalized', ... 'Position',[0.2 0.3 0.6 0.6], ... 'Color',[0 0 0], ... 'Name','Skyplot (Azimuth/Elevation)', ... 'NumberTitle','off');h = axes ('Units','normalized', ... 'Position',[0.05 0.05 0.90 0.90], ... 'Color',[0 0 0], ... 'XColor',[0 0 0], ... 'YColor',[0 0 0], ... 'Xgrid','off', ... 'Ygrid','off', ... 'Box','off');axis squarehold on;% -----------------------------------------% --- Limits, grid, labels and such ... ---% -----------------------------------------set (gca,'Xlim',[-90 90]);set (gca,'Ylim',[-90 90]);set (gca,'FontWeight','bold');set (gca,'FontSize',16);set (gca,'LineWidth',2);for i = 0:30:330; [x,y] = pol2cart (-deg2rad(i-90),90); plot ([0 x], [0 y],'w-'); [x,y] = pol2cart (-deg2rad(i-92),94); h = text (x,y,num2str(i)); set (h,'Color',[1 1 1]); set (h,'FontSize',12); set (h,'FontWeight','bold'); set (h,'Rotation',-i);end;for i = [0:15:90 cutoff]; az = [0:1:360]; el = (90-i)*ones(size(az)); [x,y] = pol2cart (deg2rad(az),el); h = plot (x,y,'w-'); set (h,'LineWidth',1); if i == cutoff; set (h,'LineStyle',':'); else if i ~= 0; h = text (2,90-i+3,num2str(i)); set (h,'Color',[1 1 1]); set (h,'FontSize',12); set (h,'FontWeight','bold'); end; end;end;% -------------------% --- Actual plot ---% -------------------lcol = get(gca,'ColorOrder');for i = 1:size(eph,1); idx1 = find(elev(i,:)>cutoff); if ~isempty(idx1); idx2 = [0 (find (idx1(1:length(idx1)-1) ~= idx1(2:length(idx1))-1)) length(idx1)]; for j = 1:length(idx2)-1 [x,y] = pol2cart(-deg2rad(-azim(i,idx1(idx2(j)+1):idx1(idx2(j+1)))-90), ... 90-elev(i,idx1(idx2(j)+1):idx1(idx2(j+1)))); h = plot (-x,y); set (h,'Marker','.'); set (h,'LineWidth',3); set (h,'Color',lcol(mod(i,size(lcol,1))+1,:)); [tx,ty] = pol2cart (-deg2rad(-azim(i,idx1(idx2(j)+1))-90),90-elev(i,idx1(idx2(j)+1))); tx = tx + 5; ty = ty + 2; h = text(-tx,ty,num2str(eph(i,1))); set (h,'Color',lcol(mod(i,size(lcol,1))+1,:)); set (h,'FontSize',18); set (h,'FontWeight','bold'); end; end end;% ----------------------% --- End of routine ---% ----------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -