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





Description

Coverage definition properties.

Object Model









Public Methods

Public Method ClearAccesses Remove access information currently maintained in association with each grid point in the coverage area.
Public Method ComputeAccesses Compute accesses between the grid points and the assigned assets.
Public Method ExportAccessesAsText Export all computed accesses to an ASCII text file.
Public Method ReloadAccesses Reload access data that was previously saved with a coverage definition object.

Public Properties

Public Property Advanced Advanced properties of the coverage definition.
Public Property AssetList List of assets to use in coverage computations.
Public Property Graphics 2D Graphics properties of the coverage definition.
Public Property Grid Definition of the coverage grid.
Public Property GridInspector The grid inspector tool
Public Property Interval Coverage interval.
Public Property PointDefinition Location of points on the coverage grid.
Public Property VO 3D 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; 
 

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
#If Not CSToJava Then
#Else
#End If
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
#If Not CSToJava Then
coverageDefinition.PointDefinition.SetPointsLLA(points)
#Else
#End If

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

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'; 
 
 
Compute Coverage
[MATLAB] Copy Code
% IAgCoverageDefinition coverage: Coverage object 
coverage.ComputeAccesses; 
 
 

CoClasses that Implement IAgCoverageDefinition

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1