任务描述
设置卫星编队(沿航迹编队,大斜视角,幅宽100km,下视角30°,斜视角±26°),设置分析区域(中国全境),设置FigureOfMerit(展示覆盖率),COM命令格式
代码块解析
初始化:新建场景,设置分析时间为30天
clc
clear
close all
% 初始化
uiap = actxserver('STK11.application');
root = uiap.Personality2;
root.ExecuteCommand('New / Scenario MyScenario');
root.ExecuteCommand('SetAnalysisTimePeriod * "Today" "+30 days"');
设置卫星编队:这里只是最简单的沿航迹编队,除此之外还有螺旋,钟摆,车轮等编队,注意区分分析时间与轨道时间,轨道时间为轨道六根数对应的时刻
root.ExecuteCommand('New / */Satellite A');
root.ExecuteCommand('SetUnits / km'); % Default Connect Units are meters
root.ExecuteCommand( 'SetState */Satellite/A Classical J2Perturbation UseScenarioInterval 60 J2000 "Today" 6978.074293 0.0011952 60 90.0186 340.5706 89.9814'); % 轨道六根数
root.ExecuteCommand('New / */Satellite B');
root.ExecuteCommand('SetUnits / km'); % Default Connect Units are meters
root.ExecuteCommand( 'SetState */Satellite/B Classical J2Perturbation UseScenarioInterval 60 J2000 "Today" 6978.074293 0.0011952 60 90.0186 340.5706 94.0080'); % 轨道六根数
设置Sensor:斜视角,下视角,幅宽
root.ExecuteCommand('New / */Satellite/A/Sensor A');
root.ExecuteCommand('Define */Satellite/A/Sensor/A Rectangular 3.6 3.5'); % 波束宽度
root.ExecuteCommand('Point */Satellite/A/Sensor/A Fixed AzEl 51.4 60 Rotate'); % 方位角与俯仰角
root.ExecuteCommand('New / */Satellite/B/Sensor B');
root.ExecuteCommand('Define */Satellite/B/Sensor/B Rectangular 3.6 3.5'); % 波束宽度
root.ExecuteCommand('Point */Satellite/B/Sensor/B Fixed AzEl 128.4 60 Rotate'); % 方位角与俯仰角
设置覆盖分析区域:中国全境,并设置FigureOFMerit显示覆盖率
% 设置覆盖分析区域
% root.ExecuteCommand('GIS * Import "D:\STK11.6\Data\Shapefiles\Countries\China\China.shp" AreaTarget');
root.ExecuteCommand('New / */CoverageDefinition MyCoverageDefinition');
root.ExecuteCommand('Cov */CoverageDefinition/MyCoverageDefinition Grid AreaOfInterest Custom Region "D:\STK11.6\Data\Shapefiles\Countries\China\China.shp"');
root.ExecuteCommand('Cov */CoverageDefinition/MyCoverageDefinition Grid PointGranularity LatLon 1');
root.ExecuteCommand('Cov */CoverageDefinition/MyCoverageDefinition Asset Satellite/A/Sensor/A Assign');
root.ExecuteCommand('Cov */CoverageDefinition/MyCoverageDefinition Asset Satellite/B/Sensor/B Assign');
root.ExecuteCommand('Cov */CoverageDefinition/MyCoverageDefinition Access DataRetention All AutoRecompute Off'); % 关闭自动计算
root.ExecuteCommand('Cov */CoverageDefinition/MyCoverageDefinition Access DataRetention All');
root.ExecuteCommand('Cov */CoverageDefinition/MyCoverageDefinition Access SaveMode Save');
root.ExecuteCommand('Cov */CoverageDefinition/MyCoverageDefinition Interval UseScenarioInterval'); % 设置分析时间
% root.ExecuteCommand('Cov */CoverageDefinition/MyCoverageDefinition Interval "2 Sep 2011 12:00:00.00" "2 Sep 2011 14:35:00.00"')
root.ExecuteCommand('New / */CoverageDefinition/MyCoverageDefinition/FigureOfMerit MyFigure');
root.ExecuteCommand('Graphics */CoverageDefinition/MyCoverageDefinition/FigureOfMerit/MyFigure Static FillTranslucency 20');
Scenario = root.Children.Item('MyScenario');
COV = Scenario.Children.Item('MyCoverageDefinition');
COV.Graphics.Static.IsRegionVisible = 1;
COV.Graphics.Static.Color = 0x00FFFF;
FOM = COV.Children.Item('MyFigure');
FOM.Graphics.Static.Color = 0x00FF00; % 设为绿色
FOM.Graphics.Static.FillTranslucency = 20; % 透明度
root.ExecuteCommand('Cov */CoverageDefinition/MyCoverageDefinition Access Compute'); % 计算覆盖
生成报告:GraphCreate
root.ExecuteCommand('GraphCreate */CoverageDefinition/MyCoverageDefinition Type Save Style "Percent Coverage" File "D:\BaiduSyncdisk\STK\Four-D_SAR\PercenCov.bmp" TimePeriod UseScenarioInterval TimeStep 60');