AGI STK Objects 11 Send comments on this topic.
IAgCoverageDefinition Interface
Windows






Windows & Linux

Description

Coverage definition properties.

Object Model









Public Methods

Public Method ClearAccessesRemove access information currently maintained in association with each grid point in the coverage area.
Public Method ComputeAccessesCompute accesses between the grid points and the assigned assets.
Public Method ExportAccessesAsTextExport all computed accesses to an ASCII text file.
Public Method ReloadAccessesReload access data that was previously saved with a coverage definition object.

Public Properties

Public Property AdvancedAdvanced properties of the coverage definition.
Public Property AssetListList of assets to use in coverage computations.
Public Property Graphics2D Graphics properties of the coverage definition.
Public Property GridDefinition of the coverage grid.
Public Property GridInspectorThe grid inspector tool
Public Property IntervalCoverage interval.
Public Property PointDefinitionLocation of points on the coverage grid.
Public Property VO3D Graphics properties of the coverage definition.

Example

Create a coverage definition (on the current scenario central body)
[C#]Copy Code
// Create the CoverageDefinition 
IAgCoverageDefinition cd = root.CurrentScenario.Children.New(AgESTKObjectType.eCoverageDefinition, "cd1"as IAgCoverageDefinition; 
 

Define a coverage definition by points
[C#]Copy Code
// Get the IAgCvGrid interface 
IAgCvGrid cvGrid = coverageDefinition.Grid; 
 
// Define custom region 
cvGrid.BoundsType = AgECvBounds.eBoundsCustomRegions; 
IAgCvBoundsCustomRegions oBoundsCustom = cvGrid.Bounds as IAgCvBoundsCustomRegions; 
oBoundsCustom.RegionFiles.Add(regionFilePath); 
oBoundsCustom.AreaTargets.Add("AreaTarget/AreaTarget1"); 
 
// Create an Array of LLA points 
// Array should contain Lat, Lon, Alt values 
Array points = new object[,] 

    { 6.9346423789e+01, -5.0260748372e+010.0000000000e+00 }, 
    { 3.9613371741e+01, -6.6285429903e+010.0000000000e+00 }, 
    { 3.9880319688e+01, -7.3881767479e+010.0000000000e+00 }, 
    { 4.0700636942e+01, -1.1224999998e+020.0000000000e+00 } 
}; 
 
// SetPointsLLA expects a two dimensional array of LLA points 
coverageDefinition.PointDefinition.SetPointsLLA(ref points); 
 

Compute a coverage definition access
[C#]Copy Code
// Set AutoRecomputer for Accesses 
coverageDefinition.Advanced.AutoRecompute = false
 
// Compute 
coverageDefinition.ComputeAccesses(); 
 
// Export to File 
coverageDefinition.ExportAccessesAsText("MyAccess.txt"); 
coverageDefinition.ReloadAccesses(); 
 
// Clear accesses if necessary 
//coverageDefinition.ClearAccesses(); 
 

Define and configure grid constraint options
[C#]Copy Code
IAgCvPointDefinition pointDefinition = coverageDefinition.PointDefinition; 
 
// Set facility as object seed instance 
pointDefinition.GridClass = AgECvGridClass.eGridClassFacility; 
pointDefinition.UseGridSeed = true
pointDefinition.SeedInstance = "Facility/North"
 
// Configure Altitude 
pointDefinition.AltitudeMethod = AgECvAltitudeMethod.eAltitude; 
pointDefinition.Altitude = 0.0
coverageDefinition.PointDefinition.GroundAltitudeMethod = AgECvGroundAltitudeMethod.eCvGroundAltitudeMethodUsePointAlt; 
 

Configure a coverage definition fixed step sampling
[C#]Copy Code
// Get the Sampling interface 
IAgCvAdvanced advanced = coverageDefinition.Advanced; 
IAgAccessSampling sampling = advanced.Sampling; 
 
// Set the Sampling Method 
sampling.SetType(AgESamplingMethod.eSamplingMethodFixedStep); 
IAgSamplingMethodFixedStep fixedStep = sampling.Strategy as IAgSamplingMethodFixedStep; 
 
// Set properties on the Fixed Stop sampling method interface 
fixedStep.FixedTimeStep = 360.0
fixedStep.TimeBound = 5.0
 

Configure a coverage definition adaptive sampling
[C#]Copy Code
// Get the Sampling interface 
IAgCvAdvanced advanced = coverageDefinition.Advanced; 
IAgAccessSampling sampling = advanced.Sampling; 
 
// Set the Sampling Method 
sampling.SetType(AgESamplingMethod.eSamplingMethodAdaptive); 
IAgSamplingMethodAdaptive adaptive = sampling.Strategy as IAgSamplingMethodAdaptive; 
 
// Set properties on the Adaptive sampling method interface 
adaptive.MaxTimeStep = 180.0
adaptive.MinTimeStep = 1.0
 

Set the coverage analysis time to the asset object time periods.
[C#]Copy Code
string currentDateFormat = stkRoot.UnitPreferences.GetCurrentUnitAbbrv("DateFormat"); 
 
// For this example, we will set the coverage analysis time to the times the asset is available. 
// Note, this doesn't handle subassets. To do that, you'll just have to iterate through the subasset list. 
IAgDate minStartTime = null
IAgDate maxStartTime = null
 
foreach (IAgCvAssetListElement cvAsset in coverage.AssetList) 

    IAgStkObject subAsset = stkRoot.GetObjectFromPath(cvAsset.ObjectName); 
    if (subAsset.Vgt.EventIntervals.Contains("AvailabilityTimeSpan")) 
    { 
        IAgCrdnEventIntervalResult availableTimeSpan = subAsset.Vgt.EventIntervals["AvailabilityTimeSpan"].FindInterval(); 
        IAgDate startDate = stkRoot.ConversionUtility.NewDate(currentDateFormat, availableTimeSpan.Interval.Start.ToString()); 
        if (!(minStartTime != null) || startDate.OLEDate < minStartTime.OLEDate) 
        { 
            minStartTime = startDate; 
        } 
 
        IAgDate stopTime = stkRoot.ConversionUtility.NewDate(currentDateFormat, availableTimeSpan.Interval.Stop.ToString()); 
        if (!(maxStartTime != null) || stopTime.OLEDate > maxStartTime.OLEDate) 
        { 
            maxStartTime = stopTime; 
        } 
    } 

 
if (minStartTime != null && maxStartTime != null

    // Now, that we have the minimum start time and the maximum stop time of the asset list, we can explicitly set the coverage analysis time. 
    coverage.Interval.AnalysisInterval.SetExplicitInterval(minStartTime.Format(currentDateFormat), maxStartTime.Format(currentDateFormat)); 

 
Console.WriteLine( 
    "Coverage Analysis Interval, StartTime = {0}, StopTime = {1}"
    coverage.Interval.AnalysisInterval.FindStartTime(), 
    coverage.Interval.AnalysisInterval.FindStopTime()); 
 

Create a coverage definition (on the current scenario central body)
[Visual Basic .NET]Copy Code
' Create the CoverageDefinition
Dim cd As IAgCoverageDefinition = TryCast(root.CurrentScenario.Children.[New](AgESTKObjectType.eCoverageDefinition, "cd1"), IAgCoverageDefinition)

Define a coverage definition by points
[Visual Basic .NET]Copy Code
' Get the IAgCvGrid interface
Dim cvGrid As IAgCvGrid = coverageDefinition.Grid

' Define custom region
cvGrid.BoundsType = AgECvBounds.eBoundsCustomRegions
Dim oBoundsCustom As IAgCvBoundsCustomRegions = TryCast(cvGrid.Bounds, IAgCvBoundsCustomRegions)
oBoundsCustom.RegionFiles.Add(regionFilePath)
oBoundsCustom.AreaTargets.Add("AreaTarget/AreaTarget1")

' Create an Array of LLA points
' Array should contain Lat, Lon, Alt values
Dim points As Array = New Object(,) {{69.346423789, -50.260748372, 0}, {39.613371741, -66.285429903, 0}, {39.880319688, -73.881767479, 0}, {40.700636942, -112.24999998, 0}}

' SetPointsLLA expects a two dimensional array of LLA points
coverageDefinition.PointDefinition.SetPointsLLA(points)

Compute a coverage definition access
[Visual Basic .NET]Copy Code
' Set AutoRecomputer for Accesses
coverageDefinition.Advanced.AutoRecompute = False

' Compute
coverageDefinition.ComputeAccesses()

' Export to File
coverageDefinition.ExportAccessesAsText("MyAccess.txt")
coverageDefinition.ReloadAccesses()

' Clear accesses if necessary
'coverageDefinition.ClearAccesses();

Define and configure grid constraint options
[Visual Basic .NET]Copy Code
Dim pointDefinition As IAgCvPointDefinition = coverageDefinition.PointDefinition

' Set facility as object seed instance
pointDefinition.GridClass = AgECvGridClass.eGridClassFacility
pointDefinition.UseGridSeed = True
pointDefinition.SeedInstance = "Facility/North"

' Configure Altitude
pointDefinition.AltitudeMethod = AgECvAltitudeMethod.eAltitude
pointDefinition.Altitude = 0
coverageDefinition.PointDefinition.GroundAltitudeMethod = AgECvGroundAltitudeMethod.eCvGroundAltitudeMethodUsePointAlt

Configure a coverage definition fixed step sampling
[Visual Basic .NET]Copy Code
' Get the Sampling interface
Dim advanced As IAgCvAdvanced = coverageDefinition.Advanced
Dim sampling As IAgAccessSampling = advanced.Sampling

' Set the Sampling Method
sampling.SetType(AgESamplingMethod.eSamplingMethodFixedStep)
Dim fixedStep As IAgSamplingMethodFixedStep = TryCast(sampling.Strategy, IAgSamplingMethodFixedStep)

' Set properties on the Fixed Stop sampling method interface
fixedStep.FixedTimeStep = 360
fixedStep.TimeBound = 5

Configure a coverage definition adaptive sampling
[Visual Basic .NET]Copy Code
' Get the Sampling interface
Dim advanced As IAgCvAdvanced = coverageDefinition.Advanced
Dim sampling As IAgAccessSampling = advanced.Sampling

' Set the Sampling Method
sampling.SetType(AgESamplingMethod.eSamplingMethodAdaptive)
Dim adaptive As IAgSamplingMethodAdaptive = TryCast(sampling.Strategy, IAgSamplingMethodAdaptive)

' Set properties on the Adaptive sampling method interface
adaptive.MaxTimeStep = 180
adaptive.MinTimeStep = 1

Set the coverage analysis time to the asset object time periods.
[Visual Basic .NET]Copy Code
Dim currentDateFormat As String = stkRoot.UnitPreferences.GetCurrentUnitAbbrv("DateFormat")

' For this example, we will set the coverage analysis time to the times the asset is available.
' Note, this doesn't handle subassets. To do that, you'll just have to iterate through the subasset list.
Dim minStartTime As IAgDate = Nothing
Dim maxStartTime As IAgDate = Nothing

For Each cvAsset As IAgCvAssetListElement In coverage.AssetList
    Dim subAsset As IAgStkObject = stkRoot.GetObjectFromPath(cvAsset.ObjectName)
    If subAsset.Vgt.EventIntervals.Contains("AvailabilityTimeSpan") Then
        Dim availableTimeSpan As IAgCrdnEventIntervalResult = subAsset.Vgt.EventIntervals("AvailabilityTimeSpan").FindInterval()
        Dim startDate As IAgDate = stkRoot.ConversionUtility.NewDate(currentDateFormat, availableTimeSpan.Interval.Start.ToString())
        If Not (minStartTime IsNot Nothing) OrElse startDate.OLEDate < minstarttime.oledate="">Then
            minStartTime = startDate
        End If

        Dim stopTime As IAgDate = stkRoot.ConversionUtility.NewDate(currentDateFormat, availableTimeSpan.Interval.[Stop].ToString())
        If Not (maxStartTime IsNot Nothing) OrElse stopTime.OLEDate > maxStartTime.OLEDate Then
            maxStartTime = stopTime
        End If
    End If
Next

If minStartTime IsNot Nothing AndAlso maxStartTime IsNot Nothing Then
    ' Now, that we have the minimum start time and the maximum stop time of the asset list, we can explicitly set the coverage analysis time.
    coverage.Interval.AnalysisInterval.SetExplicitInterval(minStartTime.Format(currentDateFormat), maxStartTime.Format(currentDateFormat))
End If

Console.WriteLine("Coverage Analysis Interval, StartTime = {0}, StopTime = {1}", coverage.Interval.AnalysisInterval.FindStartTime(), coverage.Interval.AnalysisInterval.FindStopTime())

Create a New CoverageDefinition (on the current scenario central body)
[MATLAB]Copy Code
% IAgScenario scenario: Scenario object 
%Create new Coverage Defintion and set the Bounds to an area target 
coverage = scenario.Children.New('eCoverageDefinition', 'MyCoverage'); 
coverage.Grid.BoundsType = 'eBoundsCustomRegions'; 
covGrid = coverage.Grid; 
bounds = covGrid.Bounds; 
bounds.AreaTargets.Add('AreaTarget/MyAreaTarget'); 
%Define the Grid Resolution 
Res = covGrid.Resolution; 
Res.LatLon = .5;   %deg 
%Set the satellite as the Asset 
coverage.AssetList.Add('Satellite/MySatellite'); 
 
% Turn off Show Grid Points 
coverage.Graphics.Static.IsPointsVisible = false; 
 
 
Set the Coverage Interval to an object's availability Analysis interval
[MATLAB]Copy Code
% IAgSatellite satellite: Satellite object 
% IAgCoverageDefinition coverage: Coverage object 
satVGT = satellite.vgt; 
AvailTimeSpan = satVGT.EventIntervals.Item('AvailabilityTimeSpan'); 
IntResult = AvailTimeSpan.FindInterval; 
coverage.Interval.AnalysisInterval.SetStartAndStopTimes(IntResult.Interval.Start,IntResult.Interval.Stop) 
 
 
Set Advanced Settings for Coverage
[MATLAB]Copy Code
% IAgCoverageDefinition coverage: Coverage object 
advanced = coverage.Advanced; 
advanced.AutoRecompute = false; 
advanced.DataRetention = 'eAllData'; 
advanced.SaveMode = 'eSaveAccesses'; 
 
 
Add Grid Constraint to Coverage
[MATLAB]Copy Code
% IAgCoverageDefinition coverage: Coverage object 
coverage.PointDefinition.GridClass = 'eGridClassFacility'; 
coverage.PointDefinition.UseGridSeed =  true; 
coverage.PointDefinition.SeedInstance = 'Facility/MyFacility'; 
 
 
Compute Coverage
[MATLAB]Copy Code
% IAgCoverageDefinition coverage: Coverage object 
coverage.ComputeAccesses; 
 
 
Create a New CoverageDefinition (on the current scenario central body)
[Python]Copy Code
# IAgScenario scenario: Scenario object 
#Create new Coverage Defintion and set the Bounds to an area target 
coverage = scenario.Children.New(7, 'MyCoverage') 
coverage.Grid.BoundsType = 0 # eBoundsCustomRegions 
covGrid = coverage.Grid 
bounds = covGrid.Bounds 
bounds.AreaTargets.Add('AreaTarget/MyAreaTarget') 
#Define the Grid Resolution 
Res = covGrid.Resolution 
Res.LatLon = .5   #deg 
#Set the satellite as the Asset 
coverage.AssetList.Add('Satellite/MySatellite') 
 
# Turn off Show Grid Points 
coverage.Graphics.Static.IsPointsVisible = False 
 
 
Set the Coverage Interval to an object's availability Analysis interval
[Python]Copy Code
# IAgSatellite satellite: Satellite object 
# IAgCoverageDefinition coverage: Coverage object 
satVGT = satellite.vgt 
AvailTimeSpan = satVGT.EventIntervals.Item('AvailabilityTimeSpan') 
IntResult = AvailTimeSpan.FindInterval() 
coverage.Interval.AnalysisInterval.SetStartAndStopTimes(IntResult.Interval.Start,IntResult.Interval.Stop) 
 
 
Set Advanced Settings for Coverage
[Python]Copy Code
# IAgCoverageDefinition coverage: Coverage object 
advanced = coverage.Advanced 
advanced.AutoRecompute = False 
advanced.DataRetention = 0 # eAllData 
advanced.SaveMode = 2 # eSaveAccesses 
 
 
Compute Coverage
[Python]Copy Code
# IAgCoverageDefinition coverage: Coverage object 
coverage.ComputeAccesses() 
 
 

CoClasses that Implement IAgCoverageDefinition

© 2018 Analytical Graphics, Inc. All Rights Reserved.