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#
Remove all chain accesses. |
|
Compute access for the chain. |
|
Reset the .int file containing the strand access intervals. |
|
Opt to produce an .int file containing the strand access intervals. |
|
Set the option used to specify the time period. |
Name of the .int file containing the strand access intervals. |
|
Allow a strand to contain an object more than once. |
|
Get the collection of connections in the chain. |
|
Constellation constraints mode, apply to strands or per instance. |
|
Get the constraints applicable to the chain. |
|
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. |
|
Specify the mode for saving or recomputing accesses. |
|
Flags control whether event times are computed just using the sampling or by sub-sampling. |
|
Specify whether to take light time delay into account in the computation. |
|
End object for the Chain. |
|
Event detection strategy used for access calculations. |
|
Get the 2D graphics properties of the chain. |
|
Get the 3D graphics properties of the chain. |
|
Allow strands with no access intervals to included in reports. |
|
Maximum number of objects in all strands for the Chain. |
|
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. |
|
Do not use this property, as it is deprecated. Use the StartObject, EndObject and Connections properties to configure objects in the chain. |
|
Optimal strands settings for the Chain. |
|
Opt to have STK automatically recompute accesses each time that an object on which the chain depends is updated. |
|
Sampling method used for access calculations. |
|
Start object for the Chain. |
|
Get or set the time convergence for determining access intervals when computing the chain. Uses Time Dimension. |
|
Get the time period for the chain. |
|
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.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.reset_access_intervals_file(self) None #
Reset the .int file containing the strand access intervals.
- Returns:
- Chain.set_access_intervals_file(self, filename: str) None #
Opt to produce an .int file containing the strand access intervals.
- 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: