Computing Coverage and Figures of Merit |
This topic contains details pertaining to coverage calculation and computing figures of merit.
Note |
---|
The functionality described in this topic requires a license for the Spatial Analysis Library. |
Once the grid and assets are configured, DME Component Libraries can compute and return a CoverageResults object which holds the set of CoverageGridPointWithResults, each of which stores coverage data represented by CoverageQueryResults in addition to the geometric grid point represented by CoverageGridPoint. Once we compute the CoverageResults, there are two ways to compute a "figure of merit". We can choose from a number of static figures of merit, or we can instantiate a dynamic figure of merit which implements the IFigureOfMeritDefinition interface. Each figure of merit can operate on a single grid point, and the GridDescriptiveStatistics class can be used to compute statistics on the figures of merit for all grid points. The following is an example of computing coverage and applying several static figures of merit to acquire meaningful interpretation of the results:
CoverageResults resultsOverTheGrid = coverage.ComputeCoverageOverTheGrid(start, stop); // Retrieve results for a single grid point CoverageQueryResult resultForFirstGridPoint = resultsOverTheGrid.GridPoints[0].AssetCoverage; // The percentage of the grid which was covered over the given span of time // (Weighted by surface area, since the grid was generated by SurfaceRegionsCoverageGrid) double percentCovered = GridDescriptiveStatistics.PercentCovered(resultsOverTheGrid.GridPoints); // Find the maximum response time to the first grid point double maximumResponseOfFirstPoint = ResponseTime.MaximumResponseTime(resultForFirstGridPoint); // Find the value of the absolute maximum response time for any point in the grid double maximumResponseTimeOverGrid = GridDescriptiveStatistics.MaximumFigureOfMerit<double>(resultsOverTheGrid.GridPoints, ResponseTime.MaximumResponseTime);
To create dynamic figures of merit, instantiate a type that implements IFigureOfMeritDefinition and call the appropriate static method in GridDescriptiveStatistics or compute GridTimeSampledValues directly by calling the ComputeData method. Several of the libraries included with DME Component Libraries, such as the Navigation Accuracy Library, contain additional dynamic figures of merit for use with Spatial Analysis Library. Presented here is an example of how to set up a coverage definition for use with the navigation figures of merit:
// Create a coverage definition ParameterizedSpatiallyPartitionedCoverageDefinition coverageDefinition = GetCoverageDefinition(); // When creating grid points, make sure to add a GpsReceiverExtension Platform template = new Platform(); template.LocationPoint = coverageDefinition.GridPoint; template.OrientationAxes = new AxesNorthEastDown(earth, template.LocationPoint); GpsReceiver receiver = GetGpsReceiver(); GpsReceiverExtension extension = new GpsReceiverExtension(receiver); template.Extensions.Add(extension); coverageDefinition.GridPointPlaceholder = template; PlatformCollection gps = GetConstellation(); foreach (Platform gpsSV in gps) { ElevationAngleConstraint constraint = new ElevationAngleConstraint(minimumElevation); // Create a link from the SV to the grid constraint.ConstrainedLink = new LinkSpeedOfLight(gpsSV, coverageDefinition.GridPointPlaceholder, earth.InertialFrame); constraint.ConstrainedLinkEnd = LinkRole.Receiver; // Add the asset to the coverage definition with the "asset object" being // the instance of the GPS SV platform. // The navigation figures of merit will use the GPS SV to identify // coverage data by PRN. coverageDefinition.AddAsset(new AssetDefinition(gpsSV, constraint)); }
Note that there must be a GpsReceiverExtension added to the grid points and that the asset objects added to the AssetDefinition must be the Platforms for the GPS SVs with a GpsSatelliteExtension on them. Once the coverage data is available, instantiate a figure of merit and compute over the grid:
// Compute coverage results over the grid CoverageResults coverageResult = coverageDefinition.ComputeCoverageOverTheGrid(analysisInterval.Start, analysisInterval.Stop); // If it isn't already constrained, make sure that we only consider times // when there are at least 4 navigation satellites coverageResult = coverageResult.ApplyFilter(new CoverageFilter(CoverageFilterType.AtLeastN, 4)); // Create a dilution of precision figure of merit DilutionOfPrecisionFigureOfMerit dopFom = new DilutionOfPrecisionFigureOfMerit(DilutionOfPrecisionType.Position); // Compute the figure of merit data over the grid GridTimeSampledValues dopFomResults = GridTimeSampledValues.ComputeData(coverageResult, dopFom, analysisInterval, timeStep);
The navigation figures of merit will make use of the coverage results to improve performance when determining which GPS SVs are available for a navigation solution. GridTimeSampledValues computes a set of TimeSampledValues for each grid point using multiple threads (depending on the settings in the ThreadingPolicy). We can then obtain statistics over the grid:
// Compute the overall statistics for the // entire grid over the entire time double gridMean = dopFomResults.ComputeOverallMean(); double gridMin = dopFomResults.ComputeOverallMinimum(); double gridMax = dopFomResults.ComputeOverallMaximum(); double gridStd = dopFomResults.ComputeOverallStandardDeviation(); double gridRms = dopFomResults.ComputeOverallRootMeanSquare(); double gridPrct = dopFomResults.ComputeOverallPercentile(90); // Compute statistics for a particular grid point sampled over time TimeSampledValues particularResult = dopFomResults.GridPointData[0]; double min = particularResult.ComputeMinimum(); double max = particularResult.ComputeMaximum(); double mean = DescriptiveStatistics.Mean(particularResult.Data); double std = DescriptiveStatistics.StandardDeviation(particularResult.Data); double rms = DescriptiveStatistics.RootMeanSquare(particularResult.Data);
Note that the list of GridPointData on the GridTimeSampledValues corresponds to the list of CoverageGridPointWithResults on the CoverageResults used to generate the figure of merit data.