AGI STK Objects 11 Send comments on this topic.
IAgDataProviderCollection Collection





Description

Represents a collection of data providers.

Object Model

Public Methods

Public Method GetDataPrvFixedFromPath returns the fixed data provider specified by the data provider path.
Public Method GetDataPrvInfoFromPath returns the data provider information specified by the data provider path.
Public Method GetDataPrvIntervalFromPath returns the interval data provider specified by the data provider path.
Public Method GetDataPrvTimeVarFromPath returns the time variable data provider specified by the data provider path.
Public Method GetSchema Returns a string containing the XML representation of the available data providers.

Public Properties

Public Property Count returns number of elements in the collection.
Public Property Item Given an index, returns the element in the collection. If the index is an integer, then method returns the element in the collection at the given position. If the index is a string, then the method returns the element with the specified name.

Example

Using an interval Data Provider
[MATLAB] Copy Code
% IAgStkObjectRoot root: STK Object Model root 
% IAgSatellite satellite: Satellite object 
% IAgFacility facility: Facility object 
 
%Change DateFormat dimension to epoch seconds to make the data easier to handle in 
%MATLAB 
root.UnitPreferences.Item('DateFormat').SetCurrentUnit('EpSec'); 
%Get the current scenario 
scenario = root.CurrentScenario; 
%Set up the access object 
access = satellite.GetAccessToObject(facility); 
access.ComputeAccess; 
%Get the Access AER Data Provider 
accessDP = access.DataProviders.Item('Access Data').Exec(scenario.StartTime, scenario.StopTime); 
%DP results return cell data types.  cell2mat 
accessStartTimes = cell2mat(accessDP.DataSets.GetDataSetByName('Start Time').GetValues); 
accessStopTimes = cell2mat(accessDP.DataSets.GetDataSetByName('Stop Time').GetValues); 
 
 
Using an Time Dependent Data Provider and requesting only specified elements
[MATLAB] Copy Code
% IAgStkObjectRoot root: STK Object Model root 
% IAgSatellite satellite: Satellite object 
% IAgScenario scenario: Scenario object 
%Change DateFormat dimension to epoch seconds to make the data easier to handle in 
%MATLAB 
root.UnitPreferences.Item('DateFormat').SetCurrentUnit('EpSec'); 
elems = {'Time';'q1';'q2';'q3';'q4'}; 
satDP = satellite.DataProviders.Item('Attitude Quaternions').ExecElements(scenario.StartTime, scenario.StopTime, 60, elems); 
%Whenever you pass an index to an array, you need to cast it to a long 
%equivalent (int32) 
satTime = cell2mat(satDP.DataSets.Item(cast(0,'int32')).GetValues); 
satq1 = cell2mat(satDP.DataSets.Item(cast(1,'int32')).GetValues); 
satq2 = cell2mat(satDP.DataSets.Item(cast(2,'int32')).GetValues); 
satq3 = cell2mat(satDP.DataSets.Item(cast(3,'int32')).GetValues); 
satq4 = cell2mat(satDP.DataSets.Item(cast(4,'int32')).GetValues); 
 
 
Using an Time Independent Data Provider
[MATLAB] Copy Code
% IAgStkObjectRoot root: STK Object Model root 
% IAgFacility facility: Facility object 
%Change DateFormat dimension to epoch seconds to make the data easier to handle in 
%MATLAB 
root.UnitPreferences.Item('DateFormat').SetCurrentUnit('EpSec'); 
facDP = facility.DataProviders.Item('Cartesian Position').Exec; 
facx = cell2mat(facDP.DataSets.GetDataSetByName('x').GetValues); 
facy = cell2mat(facDP.DataSets.GetDataSetByName('y').GetValues); 
facz = cell2mat(facDP.DataSets.GetDataSetByName('z').GetValues); 
 
 
Extracting Elements from Data Providers with Groups
[MATLAB] Copy Code
% IAgStkObjectRoot root: STK Object Model root 
% IAgSatellite satellite: Satellite object 
% IAgScenario scenario: Scenario object 
%Change DateFormat dimension to epoch seconds to make the data easier to handle in 
%MATLAB 
root.UnitPreferences.Item('DateFormat').SetCurrentUnit('EpSec'); 
satPosDP = satellite.DataProviders.Item('Cartesian Position').Group.Item('ICRF').Exec(scenario.StartTime,scenario.StopTime,60); 
satx = cell2mat(satPosDP.DataSets.GetDataSetByName('x').GetValues); 
saty = cell2mat(satPosDP.DataSets.GetDataSetByName('y').GetValues); 
satz = cell2mat(satPosDP.DataSets.GetDataSetByName('z').GetValues); 
 
satVelDP = satellite.DataProviders.GetDataPrvTimeVarFromPath('Cartesian Velocity/ICRF').Exec(scenario.StartTime,scenario.StopTime,60); 
%There are 4 Methods to get DP From a Path depending on the kind of DP: 
%   GetDataPrvTimeVarFromPath 
%   GetDataPrvIntervalFromPath 
%   GetDataPrvInfoFromPath 
%   GetDataPrvFixedFromPath 
satvx = cell2mat(satVelDP.DataSets.GetDataSetByName('x').GetValues); 
satvy = cell2mat(satVelDP.DataSets.GetDataSetByName('y').GetValues); 
satvz = cell2mat(satVelDP.DataSets.GetDataSetByName('z').GetValues); 
 
 
 
Extracting Elements from Data Providers with PreData
[MATLAB] Copy Code
% IAgStkObjectRoot root: STK Object Model root 
% IAgFacility facility: Facility object 
% IAgScenario scenario: Scenario object 
%Change DateFormat dimension to epoch seconds to make the data easier to handle in 
%MATLAB 
root.UnitPreferences.Item('DateFormat').SetCurrentUnit('EpSec'); 
facChooseDP = facility.DataProviders.Item('Points Choose System'); 
dataProvCenter = facChooseDP.Group.Item('Center'); 
%Choose the referense system you want to report the Center point in 
dataProvCenter.PreData = 'CentralBody/Earth TOD'; 
rptElems = {'Time';'x';'y';'z'}; 
results = dataProvCenter.ExecElements(scenario.StartTime, scenario.StopTime, 60, rptElems); 
datasets = results.DataSets; 
Time = cell2mat(datasets.GetDataSetByName('Time').GetValues); 
facTODx = cell2mat(datasets.GetDataSetByName('x').GetValues); 
facTODy = cell2mat(datasets.GetDataSetByName('y').GetValues); 
facTODz = cell2mat(datasets.GetDataSetByName('z').GetValues); 
 
 
Getting Data for a Single Point in Time
[MATLAB] Copy Code
% IAgStkObjectRoot root: STK Object Model root 
% IAgSatellite satellite: Satellite object 
%Change DateFormat dimension to epoch seconds to make the data easier to handle in 
%MATLAB 
root.UnitPreferences.Item('DateFormat').SetCurrentUnit('EpSec'); 
satPassDP = satellite.DataProviders.Item('Precision Passes').ExecSingle(2600); 
pass = cell2mat(satPassDP.DataSets.GetDataSetByName('Precision Pass Number').GetValues); 
 
 
Getting Data for Specific Points and Elements
[MATLAB] Copy Code
% IAgStkObjectRoot root: STK Object Model root 
% IAgSatellite satellite: Satellite object 
%Change DateFormat dimension to epoch seconds to make the data easier to handle in 
%MATLAB 
root.UnitPreferences.Item('DateFormat').SetCurrentUnit('EpSec'); 
times = {0;15000;20000;55000}; 
elems = {'Time';'Precision Pass Number'}; 
satPassesDP = satellite.DataProviders.Item('Precision Passes').ExecSingleElementsArray(times,elems); 
passes = cell2mat(satPassesDP.GetArray(cast(1,'int32'))); 
 
 
Getting Time Dependent Data that's broken into Sections
[MATLAB] Copy Code
% IAgStkObjectRoot root: STK Object Model root 
% IAgScenario scenario: Scenario object 
% IAgStkAccess access: Access calculation 
%Change DateFormat dimension to epoch seconds to make the data easier to handle in 
%MATLAB 
root.UnitPreferences.Item('DateFormat').SetCurrentUnit('EpSec'); 
accessAER = access.DataProviders.Item('AER Data').Group.Item('BodyFixed').Exec(scenario.StartTime, scenario.StopTime,60); 
AERTimes = cell2mat(accessAER.Interval.Item(cast(0,'int32')).DataSets.GetDataSetByName('Time').GetValues); 
Az = cell2mat(accessAER.Interval.Item(cast(0,'int32')).DataSets.GetDataSetByName('Azimuth').GetValues); 
El = cell2mat(accessAER.Interval.Item(cast(0,'int32')).DataSets.GetDataSetByName('Elevation').GetValues); 
for i = 1:1:accessAER.Interval.Count-1 
    AERTimes = [AERTimes; cell2mat(accessAER.Interval.Item(cast(i,'int32')).DataSets.GetDataSetByName('Time').GetValues)]; 
    Az = [Az; cell2mat(accessAER.Interval.Item(cast(i,'int32')).DataSets.GetDataSetByName('Azimuth').GetValues)]; 
    El = [El; cell2mat(accessAER.Interval.Item(cast(i,'int32')).DataSets.GetDataSetByName('Elevation').GetValues)]; 
end 
 
 

See Also

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1