STK ObjectsSend comments on this topic.
IAgStkObjectCoverage Interface

Description

Provides access to the Data Providers on an ObjectCoverage Object.

Public Methods

Public Method ClearRemoves the computation on the object coverage.
Public Method ClearCoverageClear object coverage.
Public Method ComputeComputes the object coverage.

Public Properties

Public Property AccessIntervalThe object coverage's access interval.
Public Property AssetsGet the asset list collection.
Public Property DataProvidersReturns the object representing a list of available data providers for the object.
Public Property FOMGet the figure of merit on the object coverage.
Public Property IsCoverageConfigurationSavedSave the single-object coverage definitions when the scenario is saved to disk, if a compute has been done.
Public Property StartTimeGets or sets the start time of object coverage. Uses DateFormat Dimension.
Public Property StopTimeGets or sets the stop time of object coverage. Uses DateFormat Dimension.
Public Property UseObjectTimesUse object interval times.

Example

Execute an object coverage data provider and dump its result
[C#]
IAgStkObject aircraft = root.CurrentScenario.Children["aircraft340"];

IAgStkObjectCoverage objectCoverage = aircraft.ObjectCoverage;
objectCoverage.Clear();
objectCoverage.Assets.Add("Constellation/gps_const");
objectCoverage.Compute();

IAgDataPrvTimeVar provider = objectCoverage.DataProviders["FOM by Time"] as IAgDataPrvTimeVar;

IAgDrResult result = provider.Exec("1 Jan 2012 12:00:00.00", "1 Jan 2012 13:00:00.00", 1);

foreach (IAgDrSubSection section in result.Sections)
{
    foreach (IAgDrInterval interval in section.Intervals)
    {
        Array arBoundaries = new object[]
                             {
                                 1.0, 2.0, 3.0, 4.0, 5.0
                             };

        // MultipleThresholdCrossings expects the second parameter
        // to be a one demensional array of boundary index values
        Array arRanges = interval.MultipleThresholdCrossings("FOM Value", ref arBoundaries);

        for (int iRange = 0; iRange < arRanges.GetLength(0); iRange++)
        {
            Console.Write("\nRange: {0}\n", iRange);

            Array arTimeSpans = arRanges.GetValue(iRange) as Array;
            for (int iSpan = 0; iSpan < arTimeSpans.GetLength(0); iSpan++)
            {
                string strStart = arTimeSpans.GetValue(iSpan, 0).ToString();
                string strStop = arTimeSpans.GetValue(iSpan, 1).ToString();

                Console.Write("Start: {0}	Stop: {1}\n", strStart, strStop);
            }
        }
    }
}
Sets the interval of the object coverage to the sunlight times of an object
[C#]
// For this example, set the access times to use the light intervals of the area target.
IAgStkObject uavAircraft = root.GetObjectFromPath("Aircraft/UAV/Sensor/UAV_Camera");
IAgStkObject airspaceAreaTarget = root.GetObjectFromPath("AreaTarget/Airspace");

IAgCrdnEvent firstSunlightEpoch = airspaceAreaTarget.Vgt.Events["LightingIntervals.Sunlight.First.Start"];
IAgCrdnEvent lastSunlightEpoch = airspaceAreaTarget.Vgt.Events["LightingIntervals.Sunlight.First.Stop"];

uavAircraft.ObjectCoverage.UseObjectTimes = false;
IAgCrdnEventSmartEpoch startEpoch = uavAircraft.ObjectCoverage.AccessInterval.GetStartEpoch();
startEpoch.SetImplicitTime(firstSunlightEpoch);

IAgCrdnEventSmartEpoch stopEpoch = uavAircraft.ObjectCoverage.AccessInterval.GetStopEpoch();
stopEpoch.SetImplicitTime(lastSunlightEpoch);

uavAircraft.ObjectCoverage.AccessInterval.SetStartAndStopEpochs(startEpoch, stopEpoch);
Execute an object coverage data provider and dump its result
[Visual Basic .NET]
Dim aircraft As IAgStkObject = root.CurrentScenario.Children("aircraft340")

Dim objectCoverage As IAgStkObjectCoverage = aircraft.ObjectCoverage
objectCoverage.Clear()
objectCoverage.Assets.Add("Constellation/gps_const")
objectCoverage.Compute()

Dim provider As IAgDataPrvTimeVar = TryCast(objectCoverage.DataProviders("FOM by Time"), IAgDataPrvTimeVar)

Dim result As IAgDrResult = provider.Exec("1 Jan 2012 12:00:00.00", "1 Jan 2012 13:00:00.00", 1)

For Each section As IAgDrSubSection In result.Sections
	For Each interval As IAgDrInterval In section.Intervals
		Dim arBoundaries As Array = New Object() {1, 2, 3, 4, 5}

		' MultipleThresholdCrossings expects the second parameter
		' to be a one demensional array of boundary index values
		Dim arRanges As Array = interval.MultipleThresholdCrossings("FOM Value", arBoundaries)

		Dim iRange As Integer = 0
		While iRange < arRanges.GetLength(0)
			Console.Write(vbLf & "Range: {0}" & vbLf, iRange)

			Dim arTimeSpans As Array = TryCast(arRanges.GetValue(iRange), Array)
			Dim iSpan As Integer = 0
			While iSpan < arTimeSpans.GetLength(0)
				Dim strStart As String = arTimeSpans.GetValue(iSpan, 0).ToString()
				Dim strStop As String = arTimeSpans.GetValue(iSpan, 1).ToString()

				Console.Write("Start: {0}" & vbTab & "Stop: {1}" & vbLf, strStart, strStop)
				System.Math.Max(System.Threading.Interlocked.Increment(iSpan),iSpan - 1)
			End While
			System.Math.Max(System.Threading.Interlocked.Increment(iRange),iRange - 1)
		End While
	Next
Next
Sets the interval of the object coverage to the sunlight times of an object
[Visual Basic .NET]
' For this example, set the access times to use the light intervals of the area target.
Dim uavAircraft As IAgStkObject = root.GetObjectFromPath("Aircraft/UAV/Sensor/UAV_Camera")
Dim airspaceAreaTarget As IAgStkObject = root.GetObjectFromPath("AreaTarget/Airspace")

Dim firstSunlightEpoch As IAgCrdnEvent = airspaceAreaTarget.Vgt.Events("LightingIntervals.Sunlight.First.Start")
Dim lastSunlightEpoch As IAgCrdnEvent = airspaceAreaTarget.Vgt.Events("LightingIntervals.Sunlight.First.Stop")

uavAircraft.ObjectCoverage.UseObjectTimes = False
Dim startEpoch As IAgCrdnEventSmartEpoch = uavAircraft.ObjectCoverage.AccessInterval.GetStartEpoch()
startEpoch.SetImplicitTime(firstSunlightEpoch)

Dim stopEpoch As IAgCrdnEventSmartEpoch = uavAircraft.ObjectCoverage.AccessInterval.GetStopEpoch()
stopEpoch.SetImplicitTime(lastSunlightEpoch)

uavAircraft.ObjectCoverage.AccessInterval.SetStartAndStopEpochs(startEpoch, stopEpoch)
Compute Object Coverage
[Python - STK API]
# IAgAircraft aircraft: Aircraft object
objCoverage = aircraft.ObjectCoverage
objCoverage.Assets.RemoveAll
objCoverage.Assets.Add('Satellite/MySatellite')
objCoverage.UseObjectTimes = True
objCoverage.Compute()

objCoverageFOM = objCoverage.FOM
objCoverageFOM.SetDefinitionType(AgEFmDefinitionType.eFmCoverageTime)
objCoverageFOM.Definition.SetComputeType(AgEFmCompute.eTotal)

Compute Object Coverage
[MATLAB]
% IAgAircraft aircraft: Aircraft object
objCoverage = aircraft.ObjectCoverage;
objCoverage.Assets.RemoveAll;
objCoverage.Assets.Add('Satellite/MySatellite');
objCoverage.UseObjectTimes = true;
objCoverage.Compute;

objCoverageFOM = objCoverage.FOM;
if objCoverageFOM.IsDefinitionTypeSupported('eFmAccessDuration')
    objCoverageFOM.SetDefinitionType('eFmAccessDuration');
    objCoverageFOM.Definition.SetComputeType('eMaximum');
end


        
© 2024 Analytical Graphics, Inc. All Rights Reserved.