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#

clear_access

Remove all chain accesses.

compute_access

Compute access for the chain.

reset_access_intervals_file

Reset the .int file containing the strand access intervals.

set_access_intervals_file

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

set_time_period_type

Set the option used to specify the time period.

access_intervals_filename

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

allow_duplicate_objects_in_strands

Allow a strand to contain an object more than once.

connections

Get the collection of connections in the chain.

const_constraints_mode

Constellation constraints mode, apply to strands or per instance.

constraints

Get the constraints applicable to the chain.

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.

data_save_mode

Specify the mode for saving or recomputing accesses.

detect_events_based_on_samples_only

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

enable_light_time_delay

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

end_object

End object for the Chain.

event_detection

Event detection strategy used for access calculations.

graphics

Get the 2D graphics properties of the chain.

graphics_3d

Get the 3D graphics properties of the chain.

keep_empty_strands

Allow strands with no access intervals to included in reports.

max_strand_depth

Maximum number of objects in all strands for the Chain.

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.

objects

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

optimal_strand_opts

Optimal strands settings for the Chain.

recompute_automatically

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

sampling

Sampling method used for access calculations.

start_object

Start object for the Chain.

time_convergence

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

time_period

Get the time period for the chain.

time_period_type

Get the option used to specify the time period 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.access_intervals_filename: str#

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

property Chain.allow_duplicate_objects_in_strands: bool#

Allow a strand to contain an object more than once.

property Chain.connections: ChainConnectionCollection#

Get the collection of connections in the chain.

property Chain.const_constraints_mode: ChainConstellationConstraintsMode#

Constellation constraints mode, apply to strands or per instance.

property Chain.constraints: ChainConstraints#

Get the constraints applicable to the chain.

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.data_save_mode: DataSaveMode#

Specify the mode for saving or recomputing accesses.

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.enable_light_time_delay: bool#

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

property Chain.end_object: ISTKObject#

End object for the Chain.

property Chain.event_detection: AccessEventDetection#

Event detection strategy used for access calculations.

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.keep_empty_strands: bool#

Allow strands with no access intervals to included in reports.

property Chain.max_strand_depth: int#

Maximum number of objects in all strands for the Chain.

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.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.optimal_strand_opts: ChainOptimalStrandOpts#

Optimal strands settings for 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.sampling: AccessSampling#

Sampling method used for access calculations.

property Chain.start_object: ISTKObject#

Start object for the Chain.

property Chain.time_convergence: float#

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

property Chain.time_period: IChainTimePeriod#

Get the time period for the chain.

property Chain.time_period_type: ChainTimePeriodType#

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

Method detail#

Chain.clear_access(self) None#

Remove all chain accesses.

Returns:

None

Chain.compute_access(self) None#

Compute access for the chain.

Returns:

None

Chain.reset_access_intervals_file(self) None#

Reset the .int file containing the strand access intervals.

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.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