AreaTarget#

class ansys.stk.core.stkobjects.AreaTarget#

Bases: ISTKObject, ILifetimeInformation, IDisplayTime

Class defining the AreaTarget object.

Overview#

use_local_time_offset

Opt whether to use a local time offset from GMT.

local_time_offset

The amount of the time offset from GMT, if this option is used. Uses Time Dimension.

automatic_computation_of_centroid

Opt whether to have the centroid automatically computed.

position

Get the position of the area target centroid.

access_constraints

Get the constraints imposed on the area target. Basic constraints for area targets apply to all points within or along the area target. If the constraint is satisfied for at least one point, access to the area target is considered valid.

graphics

Get the area target’s 2D Graphics properties.

graphics_3d

Get the area target’s 3D Graphics properties.

area_type

The method for defining the area target boundary. A member of the AreaType enumeration.

area_type_data

Get the data defining the boundary with the selected method.

use_terrain_data

Opt whether to use terrain data for altitude updates.

allow_object_access

Opt whether access to the object is constrained with respect to the entire object, as opposed to any part of it.

common_tasks

Common tasks associated with AreaTargets.

Examples#

List all points in an area target

# AreaTarget areaTarget: AreaTarget object
if areaTarget.area_type == AreaType.PATTERN:
    # Get IAgAreaTypePatternCollection interface from AreaTypeData
    patternPoints = areaTarget.area_type_data

    # ToArray returns a two dimensional array of latitude and longitude points
    areaTargetPoints = patternPoints.to_array()

    print("All points in Area Target")
    for i in range(0, len(areaTargetPoints)):
        print("Latitude: %s Longitude: %s" % (str(areaTargetPoints[i][0]), str(areaTargetPoints[i][1])))

Define an area target boundary and position from a list of lat/lon/alt (using common tasks)

# AreaTarget areaTarget: AreaTarget object
# Remove all points in the area target
areaTarget.area_type_data.remove_all()

# By using the CommonTasks interface,
# make an array of latitude and longitude boundary points
boundary = [[29, -12], [29, 34], [6, 34], [6, -12]]

# SetAreaTypePattern expects a two dimensional array of latitude and longitude values
areaTarget.common_tasks.set_area_type_pattern(boundary)

Define an area target boundary and position from a list of lat/lon/alt

# STKObjectRoot root: STK Object Model Root
# AreaTarget areaTarget: AreaTarget object

# By using the fine grained interfaces,
# BeginUpdate/EndUpdate prevent intermediate redraws
root.begin_update()
areaTarget.area_type = AreaType.PATTERN
patterns = areaTarget.area_type_data
patterns.add(48.897, 18.637)
patterns.add(46.534, 13.919)
patterns.add(44.173, 21.476)
root.end_update()
areaTarget.automatic_computation_of_centroid = True

Set an elliptical area target (using common tasks)

# STKObjectRoot root: STK Object Model Root
# AreaTarget areaTarget: AreaTarget object

# By using the CommonTasks interface
areaTarget.common_tasks.set_area_type_ellipse(85.25, 80.75, 44)

Set an elliptical area target

# STKObjectRoot root: STK Object Model Root
# AreaTarget areaTarget: AreaTarget object

# By using the fine grained interfaces,
# BeginUpdate/EndUpdate prevent intermediate redraws
root.begin_update()
areaTarget.area_type = AreaType.ELLIPSE
ellipse = areaTarget.area_type_data
ellipse.semi_major_axis = 85.25  # in km (distance dimension)
ellipse.semi_minor_axis = 80.75  # in km (distance dimension)
ellipse.bearing = 44  # in deg (angle dimension)
root.end_update()

Create an area target (on the current scenario central body)

# STKObjectRoot root: STK Object Model Root

# Create the AreaTarget on the current scenario central body (use
# NewOnCentralBody to specify explicitly the central body)
areaTarget = root.current_scenario.children.new(STKObjectType.AREA_TARGET, "MyAreaTarget")

Import detail#

from ansys.stk.core.stkobjects import AreaTarget

Property detail#

property AreaTarget.use_local_time_offset: bool#

Opt whether to use a local time offset from GMT.

property AreaTarget.local_time_offset: float#

The amount of the time offset from GMT, if this option is used. Uses Time Dimension.

property AreaTarget.automatic_computation_of_centroid: bool#

Opt whether to have the centroid automatically computed.

property AreaTarget.position: IPosition#

Get the position of the area target centroid.

property AreaTarget.access_constraints: AccessConstraintCollection#

Get the constraints imposed on the area target. Basic constraints for area targets apply to all points within or along the area target. If the constraint is satisfied for at least one point, access to the area target is considered valid.

property AreaTarget.graphics: AreaTargetGraphics#

Get the area target’s 2D Graphics properties.

property AreaTarget.graphics_3d: AreaTargetGraphics3D#

Get the area target’s 3D Graphics properties.

property AreaTarget.area_type: AreaType#

The method for defining the area target boundary. A member of the AreaType enumeration.

property AreaTarget.area_type_data: IAreaTypeData#

Get the data defining the boundary with the selected method.

property AreaTarget.use_terrain_data: bool#

Opt whether to use terrain data for altitude updates.

property AreaTarget.allow_object_access: bool#

Opt whether access to the object is constrained with respect to the entire object, as opposed to any part of it.

property AreaTarget.common_tasks: AreaTargetCommonTasks#

Common tasks associated with AreaTargets.