AGI STK Objects 11 Send comments on this topic.
IAgStkAccess Interface





Description

Provides access to the Data Providers and access computations.

Object Model







Public Methods

Public Method ClearAccess Clears the access intervals, but not the definitional settings of the access object itself (like step size, light time delay settings, time interval, etc.)
Public Method ComputeAccess Recomputes the access between two objects. Calls to ComputeAccess should not be made between calls to BeginUpdate and EndUpdate.
Public Method RemoveAccess Removes the access that was computed between two objects.
Public Method SpecifyAccessEventIntervals Access is computed using the intervals in the specified event interval list.
Public Method SpecifyAccessIntervals Allows a list of intervals to be used for the access calculation.
Public Method SpecifyAccessTimePeriod If eUserSpec is selected for AccessTimePeriod, specify the start and stop times for the user-defined period.

Public Properties

Public Property AccessTimePeriod Specifies the time period option. A member of the AgEAccessTimeType enumeration.
Public Property AccessTimePeriodData Returns an IAgIntervalCollection if AccessTimePeriod is eAccessTimeIntervals; returns an IAgAccessTimePeriod if AccessTimePeriod is eUserSpecAccessTime; returns an IAgAccessTimeEventIntervals if AccessTimePeriod is eAccessTimeEventIntervals.
Public Property Advanced Gets the Advanced properties for the Access computations.
Public Property ComputedAccessIntervalTimes Returns a list of the computed access interval times.
Public Property DataDisplays Gets the VO Data Display Collection.
Public Property DataProviders Returns the object representing a list of available data providers for the object.
Public Property Graphics Gets the Graphics properties for the Access computations.
Public Property Vgt Gets a VGT provider to access the analytical vector geometry, timeline, calculation and other types of components.

Example

Compute an access between two STK Objects (using object path)
[C#] Copy Code
// Get access by object path 
IAgStkAccess access = stkObject.GetAccess("Facility/fac1"); 
 
// Compute access 
access.ComputeAccess(); 
 

Compute an access between two STK Objects (using IAgStkObject interface)
[C#] Copy Code
// Get access by STK Object 
IAgStkAccess access = stkObject1.GetAccessToObject(stkObject2); 
 
// Compute access 
access.ComputeAccess(); 
 

Compute an access and get constraint data from data provider
[C#] Copy Code
// Compute Access between the facility and the satellite 
IAgStkObject sat1 = root.GetObjectFromPath("Satellite/Satellite1"); 
IAgStkObject fac1 = root.GetObjectFromPath("Facility/Facility1"); 
IAgStkAccess access = sat1.GetAccessToObject(fac1); 
access.ComputeAccess(); 
 
// Get the access intervals 
IAgIntervalCollection accessIntervals = access.ComputedAccessIntervalTimes; 
 
// Set unit preferences - change to get your preferred units 
root.UnitPreferences.SetCurrentUnit("Distance""km"); 
root.UnitPreferences.SetCurrentUnit("Angle""deg"); 
root.UnitPreferences.SetCurrentUnit("Time""sec"); 
root.UnitPreferences.SetCurrentUnit("DateFormat""UTCG"); 
 
// Extract the access intervals and the range information for each access interval 
Array dataPrvElements = new object[] 
    { 
        "Time""FromAngularRate""FromRange" 
    }; 
 
IAgDataPrvTimeVar dp = access.DataProviders["Constraint Data"as IAgDataPrvTimeVar; 
 
for (int index0 = 0; index0 < accessIntervals.Count; ++index0) 

    object startTime = null, stopTime = null
 
    accessIntervals.GetInterval(index0, out startTime, out stopTime); 
 
    Console.WriteLine("Access Interval #{0} - Start={1} Stop={2}", index0, startTime, stopTime); 
 
    IAgDrResult result = dp.ExecElements(startTime, stopTime, 60ref dataPrvElements); 
 
    Array timeValues = result.DataSets[0].GetValues(); 
    Array fromAngularRateValues = result.DataSets[1].GetValues(); 
    Array fromRangeValues = result.DataSets[2].GetValues(); 
 
    for (int index1 = 0; index1 < timeValues.GetLength(0); ++index1) 
    { 
        Console.WriteLine("{0}: FromAngularRate={1} FromRange={2}"
            timeValues.GetValue(index1), 
            fromAngularRateValues.GetValue(index1), 
            fromRangeValues.GetValue(index1)); 
    } 
 
    Console.WriteLine(); 

 

Configure the access analysis time period to specified time instants.
[C#] Copy Code
IAgStkObject uav = stkRoot.GetObjectFromPath("/Aircraft/UAV"); 
IAgStkObject sensor = stkRoot.GetObjectFromPath("/Aircraft/UAV/Sensor/UAVSensor"); 
IAgStkObject coloradoSprings = stkRoot.GetObjectFromPath("/Place/ColoradoSprings"); 
 
// For this code snippet, let's use the time interval when the UAV reached min and max altitude values. 
// Note, this assumes time at min happens before time at max. 
IAgCrdnEvent timeOfAltMin = uav.Vgt.Events["GroundTrajectory.Detic.LLA.Altitude.TimeOfMin"]; 
IAgCrdnEvent timeOfAltMax = uav.Vgt.Events["GroundTrajectory.Detic.LLA.Altitude.TimeOfMax"]; 
 
// Set the access time period with the times we figured out above. 
IAgStkAccess access = sensor.GetAccessToObject(coloradoSprings); 
access.AccessTimePeriod = AgEAccessTimeType.eUserSpecAccessTime; 
IAgAccessTimePeriod accessTimePeriod = access.AccessTimePeriodData as IAgAccessTimePeriod; 
 
accessTimePeriod.AccessInterval.State = AgECrdnSmartIntervalState.eCrdnSmartIntervalStateStartStop; 
 
IAgCrdnEventSmartEpoch accessStartEpoch = accessTimePeriod.AccessInterval.GetStartEpoch(); 
accessStartEpoch.SetImplicitTime(timeOfAltMin); 
accessTimePeriod.AccessInterval.SetStartEpoch(accessStartEpoch); 
 
IAgCrdnEventSmartEpoch accessStopEpoch = accessTimePeriod.AccessInterval.GetStopEpoch(); 
accessStopEpoch.SetImplicitTime(timeOfAltMax); 
accessTimePeriod.AccessInterval.SetStopEpoch(accessStopEpoch); 
 

Configure the access interval to the availability time span of the object where access is being computed to.
[C#] Copy Code
IAgStkObject satellite = stkRoot.GetObjectFromPath("/Satellite/GEO"); 
IAgStkObject otherObject = stkRoot.GetObjectFromPath("/Aircraft/UAV/Sensor/UAVSensor"); 
IAgStkAccess access = satellite.GetAccessToObject(otherObject); 
 
access.AccessTimePeriod = AgEAccessTimeType.eUserSpecAccessTime; 
IAgAccessTimePeriod accessTimePeriod = access.AccessTimePeriodData as IAgAccessTimePeriod; 
 
if (otherObject.Vgt.EventIntervals.Contains("AvailabilityTimeSpan")) 

    IAgCrdnEventInterval availabilityTimeSpan = otherObject.Vgt.EventIntervals["AvailabilityTimeSpan"]; 
    accessTimePeriod.AccessInterval.SetImplicitInterval(availabilityTimeSpan); 

 

Compute an access between two STK Objects (using object path)
[Visual Basic .NET] Copy Code
' Get access by object path
Dim access As IAgStkAccess = stkObject.GetAccess("Facility/fac1")

' Compute access
access.ComputeAccess()

Compute an access between two STK Objects (using IAgStkObject interface)
[Visual Basic .NET] Copy Code
' Get access by STK Object
Dim access As IAgStkAccess = stkObject1.GetAccessToObject(stkObject2)

' Compute access
access.ComputeAccess()

Compute an access and get constraint data from data provider
[Visual Basic .NET] Copy Code
' Compute Access between the facility and the satellite
Dim sat1 As IAgStkObject = root.GetObjectFromPath("Satellite/Satellite1")
Dim fac1 As IAgStkObject = root.GetObjectFromPath("Facility/Facility1")
Dim access As IAgStkAccess = sat1.GetAccessToObject(fac1)
access.ComputeAccess()

' Get the access intervals
Dim accessIntervals As IAgIntervalCollection = access.ComputedAccessIntervalTimes

' Set unit preferences - change to get your preferred units
root.UnitPreferences.SetCurrentUnit("Distance", "km")
root.UnitPreferences.SetCurrentUnit("Angle", "deg")
root.UnitPreferences.SetCurrentUnit("Time", "sec")
root.UnitPreferences.SetCurrentUnit("DateFormat", "UTCG")

' Extract the access intervals and the range information for each access interval
#If Not CSToJava Then
#Else
#End If
Dim dataPrvElements As Array = New Object() {"Time", "FromAngularRate", "FromRange"}

Dim dp As IAgDataPrvTimeVar = TryCast(access.DataProviders("Constraint Data"), IAgDataPrvTimeVar)

Dim index0 As Integer = 0
While index0 <>
    Dim startTime As Object = Nothing, stopTime As Object = Nothing

    #If Not CSToJava Then
    accessIntervals.GetInterval(index0, startTime, stopTime)
    #Else
    #End If

    Console.WriteLine("Access Interval #{0} - Start={1} Stop={2}", index0, startTime, stopTime)

    #If Not CSToJava Then
    Dim result As IAgDrResult = dp.ExecElements(startTime, stopTime, 60, dataPrvElements)
    #Else
    #End If

    Dim timeValues As Array = result.DataSets(0).GetValues()
    Dim fromAngularRateValues As Array = result.DataSets(1).GetValues()
    Dim fromRangeValues As Array = result.DataSets(2).GetValues()

    Dim index1 As Integer = 0
    While index1 <>
        Console.WriteLine("{0}: FromAngularRate={1} FromRange={2}", timeValues.GetValue(index1), fromAngularRateValues.GetValue(index1), fromRangeValues.GetValue(index1))
        System.Threading.Interlocked.Increment(index1)
    End While

    Console.WriteLine()
    System.Threading.Interlocked.Increment(index0)
End While

Configure the access analysis time period to specified time instants.
[Visual Basic .NET] Copy Code
Dim uav As IAgStkObject = stkRoot.GetObjectFromPath("/Aircraft/UAV")
Dim sensor As IAgStkObject = stkRoot.GetObjectFromPath("/Aircraft/UAV/Sensor/UAVSensor")
Dim coloradoSprings As IAgStkObject = stkRoot.GetObjectFromPath("/Place/ColoradoSprings")

' For this code snippet, let's use the time interval when the UAV reached min and max altitude values.
' Note, this assumes time at min happens before time at max.
Dim timeOfAltMin As IAgCrdnEvent = uav.Vgt.Events("GroundTrajectory.Detic.LLA.Altitude.TimeOfMin")
Dim timeOfAltMax As IAgCrdnEvent = uav.Vgt.Events("GroundTrajectory.Detic.LLA.Altitude.TimeOfMax")

' Set the access time period with the times we figured out above.
Dim access As IAgStkAccess = sensor.GetAccessToObject(coloradoSprings)
access.AccessTimePeriod = AgEAccessTimeType.eUserSpecAccessTime
Dim accessTimePeriod As IAgAccessTimePeriod = TryCast(access.AccessTimePeriodData, IAgAccessTimePeriod)

accessTimePeriod.AccessInterval.State = AgECrdnSmartIntervalState.eCrdnSmartIntervalStateStartStop

Dim accessStartEpoch As IAgCrdnEventSmartEpoch = accessTimePeriod.AccessInterval.GetStartEpoch()
accessStartEpoch.SetImplicitTime(timeOfAltMin)
accessTimePeriod.AccessInterval.SetStartEpoch(accessStartEpoch)

Dim accessStopEpoch As IAgCrdnEventSmartEpoch = accessTimePeriod.AccessInterval.GetStopEpoch()
accessStopEpoch.SetImplicitTime(timeOfAltMax)
accessTimePeriod.AccessInterval.SetStopEpoch(accessStopEpoch)

Configure the access interval to the availability time span of the object where access is being computed to.
[Visual Basic .NET] Copy Code
Dim satellite As IAgStkObject = stkRoot.GetObjectFromPath("/Satellite/GEO")
Dim otherObject As IAgStkObject = stkRoot.GetObjectFromPath("/Aircraft/UAV/Sensor/UAVSensor")
Dim access As IAgStkAccess = satellite.GetAccessToObject(otherObject)

access.AccessTimePeriod = AgEAccessTimeType.eUserSpecAccessTime
Dim accessTimePeriod As IAgAccessTimePeriod = TryCast(access.AccessTimePeriodData, IAgAccessTimePeriod)

If otherObject.Vgt.EventIntervals.Contains("AvailabilityTimeSpan") Then
    Dim availabilityTimeSpan As IAgCrdnEventInterval = otherObject.Vgt.EventIntervals("AvailabilityTimeSpan")
    accessTimePeriod.AccessInterval.SetImplicitInterval(availabilityTimeSpan)
End If

Compute an access between two STK Objects (using IAgStkObject interface)
[MATLAB] Copy Code
% IAgSatellite satellite: Satellite object 
% IAgFacility facility: Facility object 
 
% Get access by STK Object 
access = satellite.GetAccessToObject(facility); 
 
% Compute access 
access.ComputeAccess(); 
 
 
Compute an access between two STK Objects (using object path)
[MATLAB] Copy Code
% IAgSatellite satellite: Satellite object 
 
% Get access by object path 
access = satellite.GetAccess('Facility/MyFacility'); 
 
% Compute access 
access.ComputeAccess(); 
 
 
Compute Access with Advanced Settings
[MATLAB] Copy Code
% IAgStkAccess access: Access object 
 
access.Advanced.EnableLightTimeDelay = true; 
access.Advanced.TimeLightDelayConvergence = .00005; 
access.Advanced.AberrationType = 'eAberrationAnnual'; 
access.Advanced.UseDefaultClockHostAndSignalSense = false; 
access.Advanced.ClockHost = 'eIvBase'; 
access.Advanced.SignalSenseOfClockHost = 'eIvTransmit'; 
access.ComputeAccess; 
 
 
Compute and extract access interval times
[MATLAB] Copy Code
% IAgStkAccess access: Access calculation 
% Get and display the Computed Access Intervals 
intervalCollection = access.ComputedAccessIntervalTimes; 
 
% Set the intervals to use to the Computed Access Intervals 
computedIntervals = intervalCollection.ToArray(0, -1); 
access.SpecifyAccessIntervals(computedIntervals); 
 
 
Configure the access analysis time period to specified time instants.
[MATLAB] Copy Code
% IAgStkObjectRoot root: STK Object Model root 
 
satellite = root.GetObjectFromPath('/Satellite/MySatellite'); 
facility = root.GetObjectFromPath('/Facility/MyFacility'); 
 
% For this code snippet, let's use the time interval when the satellite reached min and max altitude values. 
% Note, this assumes time at min happens before time at max. 
timeOfAltMin = satellite.Vgt.Events.Item('GroundTrajectory.Detic.LLA.Altitude.TimeOfMin'); 
timeOfAltMax = satellite.Vgt.Events.Item('GroundTrajectory.Detic.LLA.Altitude.TimeOfMax'); 
 
% Set the access time period with the times we figured out above. 
access = satellite.GetAccessToObject(facility); 
access.AccessTimePeriod = 'eUserSpecAccessTime'; 
accessTimePeriod = access.AccessTimePeriodData; 
 
accessTimePeriod.AccessInterval.State = 'eCrdnSmartIntervalStateStartStop'; 
 
accessStartEpoch = accessTimePeriod.AccessInterval.GetStartEpoch(); 
accessStartEpoch.SetImplicitTime(timeOfAltMin); 
accessTimePeriod.AccessInterval.SetStartEpoch(accessStartEpoch); 
 
accessStopEpoch = accessTimePeriod.AccessInterval.GetStopEpoch(); 
accessStopEpoch.SetImplicitTime(timeOfAltMax); 
accessTimePeriod.AccessInterval.SetStopEpoch(accessStopEpoch); 
 
 

CoClasses that Implement IAgStkAccess

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1