Chain#

class ansys.stk.core.stkobjects.Chain#

Bases: ISTKObject, ILifetimeInformation

Chain Class is used to access the methods and properties of the STK Chain Object.

Overview#

set_time_period_type

Set the option used to specify the time period.

set_access_intervals_file

Opt to produce an .int file containing the strand access intervals.

reset_access_intervals_file

Reset the .int file containing the strand access intervals.

compute_access

Compute access for the chain.

clear_access

Remove all chain accesses.

objects

Do not use this property, as it is deprecated. Use the StartObject, EndObject and Connections properties to configure objects in the chain.

recompute_automatically

Opt to have STK automatically recompute accesses each time that an object on which the chain depends is updated.

time_period_type

Get the option used to specify the time period for the chain.

time_period

Get the time period for the chain.

data_save_mode

Specify the mode for saving or recomputing accesses.

access_intervals_filename

Name of the .int file containing the strand access intervals.

enable_light_time_delay

Specify whether to take light time delay into account in the computation.

maximum_time_step

Get or set the maximum sampling step size used when computing the chain. The maximum step size limits the amount of time that is allowed to elapse between sampling of the constraint functions during access computations. Uses Time Dimension.

time_convergence

Get or set the time convergence for determining access intervals when computing the chain. Uses Time Dimension.

constraints

Get the constraints applicable to the chain.

graphics

Get the 2D graphics properties of the chain.

graphics_3d

Get the 3D graphics properties of the chain.

event_detection

Event detection strategy used for access calculations.

sampling

Sampling method used for access calculations.

detect_events_based_on_samples_only

Flags control whether event times are computed just using the sampling or by sub-sampling.

const_constraints_mode

Constellation constraints mode, apply to strands or per instance.

keep_empty_strands

Allow strands with no access intervals to included in reports.

allow_duplicate_objects_in_strands

Allow a strand to contain an object more than once.

coverage_asset_mode

When Computing Coverage and the Chain is used as a coverage asset, append the grid instance to the end of the chain or update the grid instance inside the chain.

start_object

Start object for the Chain.

end_object

End object for the Chain.

max_strand_depth

Maximum number of objects in all strands for the Chain.

connections

Get the collection of connections in the chain.

optimal_strand_opts

Optimal strands settings for the Chain.

Examples#

Print the strand intervals of chain object

# Chain chain: Chain Object
# Compute the chain access if not done already.
chain.compute_access()

# Considered Start and Stop time
print(
    "Chain considered start time: %s"
    % chain.analysis_workbench_components.time_instants.item("ConsideredStartTime").find_occurrence().epoch
)
print(
    "Chain considered stop time: %s"
    % chain.analysis_workbench_components.time_instants.item("ConsideredStopTime").find_occurrence().epoch
)

objectParticipationIntervals = chain.analysis_workbench_components.time_interval_collections.item(
    "StrandAccessIntervals"
)
intervalListResult = objectParticipationIntervals.find_interval_collection()

for i in range(0, intervalListResult.interval_collections.count):
    if intervalListResult.IsValid:
        print("Link Name: %s" % objectParticipationIntervals.Labels(i + 1))
        print("--------------")
        for j in range(0, intervalListResult.IntervalCollections.Item(i).Count):
            startTime = intervalListResult.IntervalCollections.Item(i).Item(j).Start
            stopTime = intervalListResult.IntervalCollections.Item(i).Item(j).Stop
            print("Start: %s Stop: %s" % (startTime, stopTime))

Define and compute a chain (advanced)

# Chain chain: Chain object
# Satellite satellite: Satellite object

# Remove all previous accesses
chain.clear_access()

# Add some objects to chain
chain.objects.add("Facility/MyFacility")
chain.objects.add_object(satellite)

# Configure chain parameters
chain.recompute_automatically = False
chain.enable_light_time_delay = False
chain.time_convergence = 0.001
chain.data_save_mode = DataSaveMode.SAVE_ACCESSES

# Specify our own time period
chain.set_time_period_type(ChainTimePeriodType.SPECIFIED_TIME_PERIOD)

# Get chain time period interface
chainUserTimePeriod = chain.time_period
chainUserTimePeriod.time_interval.set_explicit_interval(
    root.current_scenario.analysis_interval.find_start_time(),
    root.current_scenario.analysis_interval.find_stop_time(),
)  # Set to scenario period

# Compute the chain
chain.compute_access()

Define and compute a chain (basic)

# Chain chain: Chain object

# Add some objects to chain (using STK path)
chain.objects.add("Facility/MyFacility")
chain.objects.add("Satellite/MySatellite")

# Compute the chain
chain.compute_access()

Create a chain (on the current scenario central body)

# STKObjectRoot root: STK Object Model Root
# Create the Chain on the current scenario central body (use
# NewOnCentralBody to specify explicitly the central body)
chain = root.current_scenario.children.new(STKObjectType.CHAIN, "MyChain")

Import detail#

from ansys.stk.core.stkobjects import Chain

Property detail#

property Chain.objects: ObjectLinkCollection#

Do not use this property, as it is deprecated. Use the StartObject, EndObject and Connections properties to configure objects in the chain.

property Chain.recompute_automatically: bool#

Opt to have STK automatically recompute accesses each time that an object on which the chain depends is updated.

property Chain.time_period_type: ChainTimePeriodType#

Get the option used to specify the time period for the chain.

property Chain.time_period: IChainTimePeriod#

Get the time period for the chain.

property Chain.data_save_mode: DataSaveMode#

Specify the mode for saving or recomputing accesses.

property Chain.access_intervals_filename: str#

Name of the .int file containing the strand access intervals.

property Chain.enable_light_time_delay: bool#

Specify whether to take light time delay into account in the computation.

property Chain.maximum_time_step: float#

Get or set the maximum sampling step size used when computing the chain. The maximum step size limits the amount of time that is allowed to elapse between sampling of the constraint functions during access computations. Uses Time Dimension.

property Chain.time_convergence: float#

Get or set the time convergence for determining access intervals when computing the chain. Uses Time Dimension.

property Chain.constraints: ChainConstraints#

Get the constraints applicable to the chain.

property Chain.graphics: ChainGraphics#

Get the 2D graphics properties of the chain.

property Chain.graphics_3d: ChainGraphics3D#

Get the 3D graphics properties of the chain.

property Chain.event_detection: AccessEventDetection#

Event detection strategy used for access calculations.

property Chain.sampling: AccessSampling#

Sampling method used for access calculations.

property Chain.detect_events_based_on_samples_only: bool#

Flags control whether event times are computed just using the sampling or by sub-sampling.

property Chain.const_constraints_mode: ChainConstellationConstraintsMode#

Constellation constraints mode, apply to strands or per instance.

property Chain.keep_empty_strands: bool#

Allow strands with no access intervals to included in reports.

property Chain.allow_duplicate_objects_in_strands: bool#

Allow a strand to contain an object more than once.

property Chain.coverage_asset_mode: ChainCoverageAssetMode#

When Computing Coverage and the Chain is used as a coverage asset, append the grid instance to the end of the chain or update the grid instance inside the chain.

property Chain.start_object: ISTKObject#

Start object for the Chain.

property Chain.end_object: ISTKObject#

End object for the Chain.

property Chain.max_strand_depth: int#

Maximum number of objects in all strands for the Chain.

property Chain.connections: ChainConnectionCollection#

Get the collection of connections in the chain.

property Chain.optimal_strand_opts: ChainOptimalStrandOpts#

Optimal strands settings for the Chain.

Method detail#

Chain.set_time_period_type(self, time_period_type: ChainTimePeriodType) None#

Set the option used to specify the time period.

Parameters:

time_period_type : ChainTimePeriodType

Returns:

None

Chain.set_access_intervals_file(self, filename: str) None#

Opt to produce an .int file containing the strand access intervals.

Parameters:

filename : str

Returns:

None

Chain.reset_access_intervals_file(self) None#

Reset the .int file containing the strand access intervals.

Returns:

None

Chain.compute_access(self) None#

Compute access for the chain.

Returns:

None

Chain.clear_access(self) None#

Remove all chain accesses.

Returns:

None