STK12.2+Python开发(二):添加访问约束,新建场景、卫星、地面站等,获取当前场景的信息

新建场景

1.获取当前打开的场景

#获取当前打开的场景
scenario = root.CurrentScenario

2.设置当前场景的时间

scenario.SetTimePeriod('Today','+24hr')

3.添加一个地面目标到当前的场景

scenario.SetTimePeriod('Today','+24hr')

4.添加一个地面目标到当前的场景,括号内是三维坐标

target.Position.AssignGeodetic(50,-100,0)

在这里插入图片描述

5.添加和配置太阳仰角访问限制

# IAgAccessConstraintCollection accessConstraints: Access Constraint collection
# To make this more efficient, wrap this method between calls to root.BeginUpdate() and root.EndUpdate()
minmax = accessConstraints.AddConstraint(58)  # eCstrSunElevationAngle
minmax.EnableMin = True
minmax.Min = 22.2
minmax.EnableMax = True
minmax.Max = 77.7

6.添加和配置高度访问限制Add and configure an altitude access constraint

# IAgAccessConstraintCollection accessConstraints: Access Constraint collection

# To make this more efficient, wrap this method between calls to root.BeginUpdate() and root.EndUpdate()
# Attitude constraint
altitude = accessConstraints.AddConstraint(2)  # eCstrAltitude
altitude.EnableMin = True
altitude.Min = 20.5  # km

7.为 STK 对象添加多个相同类型的访问约束

# IAgAccessConstraintCollection accessConstraints: Access Constraint collection

# Add constraints
# Only the eCstrApparentTime (4), eCstrDuration (13), eCstrGMT (16), eCstrIntervals (22), eCstrLocalTime (27) constraint
# types can be added multiple times to the constraint collection.
time1 = accessConstraints.AddConstraint(27)  # eCstrLocalTime
time1.Min = '00:00:00.000'
time1.Max = '23:00:00.000'
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值