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