STK ObjectsSend comments on this topic.
IAgCoverageDefinition Interface

Description

Coverage definition properties.

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.

Interfaces

CoClasses that Implement IAgCoverageDefinition

Example

Create a coverage definition (on the current scenario central body)
[C#]
// Create the CoverageDefinition
IAgCoverageDefinition cd = root.CurrentScenario.Children.New(AgESTKObjectType.eCoverageDefinition, "cd1") as IAgCoverageDefinition;
Define a coverage definition by points
[C#]
// 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+01, 0.0000000000e+00 },
    { 3.9613371741e+01, -6.6285429903e+01, 0.0000000000e+00 },
    { 3.9880319688e+01, -7.3881767479e+01, 0.0000000000e+00 },
    { 4.0700636942e+01, -1.1224999998e+02, 0.0000000000e+00 }
};

// SetPointsLLA expects a two dimensional array of LLA points
coverageDefinition.PointDefinition.SetPointsLLA(ref points);
Compute a coverage definition access
[C#]
// Set AutoRecomputer for Accesses
coverageDefinition.Advanced.AutoRecompute = false;

// Compute
coverageDefinition.ComputeAccesses();

// Export to File
string tempFile = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "MyAccess.txt");
coverageDefinition.ExportAccessesAsText(tempFile);
coverageDefinition.ReloadAccesses();

// Clear accesses if necessary
//coverageDefinition.ClearAccesses();
Define and configure grid constraint options
[C#]
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#]
// 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#]
// 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#]
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]
' 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]
' 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]
' Set AutoRecomputer for Accesses
coverageDefinition.Advanced.AutoRecompute = False

' Compute
coverageDefinition.ComputeAccesses()

' Export to File
Dim tempFile As String = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "MyAccess.txt")
coverageDefinition.ExportAccessesAsText(tempFile)
coverageDefinition.ReloadAccesses()

' Clear accesses if necessary
'coverageDefinition.ClearAccesses();
Define and configure grid constraint options
[Visual Basic .NET]
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]
' 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]
' 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]
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)
[Python - STK API]
# IAgScenario scenario: Scenario object
# Create new Coverage Definition and set the Bounds to an area target
coverage = scenario.Children.New(AgESTKObjectType.eCoverageDefinition, 'MyCoverage')
coverage.Grid.BoundsType = AgECvBounds.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 - STK API]
# 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 - STK API]
# IAgCoverageDefinition coverage: Coverage object
advanced = coverage.Advanced
advanced.AutoRecompute = False
advanced.DataRetention = AgECvDataRetention.eAllData
advanced.SaveMode = AgEDataSaveMode.eSaveAccesses

Compute Coverage
[Python - STK API]
# IAgCoverageDefinition coverage: Coverage object
coverage.ComputeAccesses()

Create a New CoverageDefinition (on the current scenario central body)
[MATLAB]
% IAgScenario scenario: Scenario object
% Create new Coverage Definition 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]
% 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]
% IAgCoverageDefinition coverage: Coverage object
advanced = coverage.Advanced;
advanced.AutoRecompute = false;
advanced.DataRetention = 'eAllData';
advanced.SaveMode = 'eSaveAccesses';


        
Add Grid Constraint to Coverage
[MATLAB]
% IAgCoverageDefinition coverage: Coverage object
coverage.PointDefinition.GridClass = 'eGridClassFacility';
coverage.PointDefinition.UseGridSeed =  true;
coverage.PointDefinition.SeedInstance = 'Facility/MyFacility';


        
Compute Coverage
[MATLAB]
% IAgCoverageDefinition coverage: Coverage object
coverage.ComputeAccesses;


        
© 2024 Analytical Graphics, Inc. All Rights Reserved.