STK ObjectsSend comments on this topic.
IAgDataProviderCollection Interface

Description

Represents a collection of data providers.

Public Methods

Public Method GetDataPrvFixedFromPathReturns the fixed data provider specified by the data provider path.
Public Method GetDataPrvInfoFromPathReturns the data provider information specified by the data provider path.
Public Method GetDataPrvIntervalFromPathReturns the interval data provider specified by the data provider path.
Public Method GetDataPrvTimeVarFromPathReturns the time variable data provider specified by the data provider path.
Public Method GetItemByIndexRetrieves a data provider from the collection by index.
Public Method GetItemByNameRetrieves a data provider from the collection by name.
Public Method GetSchemaReturns a string containing the XML representation of the available data providers.

Public Properties

Public Property CountReturns number of elements in the collection.
Public Property ItemGiven 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
[Python - STK API]
# 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
# Python
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)

accessStartTimes = accessDP.DataSets.GetDataSetByName('Start Time').GetValues
accessStopTimes = accessDP.DataSets.GetDataSetByName('Stop Time').GetValues

Using a Time Dependent Data Provider and requesting only specified elements
[Python - STK API]
# 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
# Python
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 = satDP.DataSets.Item(0).GetValues
satq1 = satDP.DataSets.Item(1).GetValues
satq2 = satDP.DataSets.Item(2).GetValues
satq3 = satDP.DataSets.Item(3).GetValues
satq4 = satDP.DataSets.Item(4).GetValues

Extracting Elements from Data Providers with Groups
[Python - STK API]
# 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
# Python
root.UnitPreferences.Item('DateFormat').SetCurrentUnit('EpSec')
satPosDP = satellite.DataProviders.Item('Cartesian Position').Group.Item('ICRF').Exec(scenario.StartTime, scenario.StopTime, 60)
satx = satPosDP.DataSets.GetDataSetByName('x').GetValues()
saty = satPosDP.DataSets.GetDataSetByName('y').GetValues()
satz = 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 = satVelDP.DataSets.GetDataSetByName('x').GetValues()
satvy = satVelDP.DataSets.GetDataSetByName('y').GetValues()
satvz = satVelDP.DataSets.GetDataSetByName('z').GetValues()


Extracting Elements from Data Providers with PreData
[Python - STK API]
# 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
# Python
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 = datasets.GetDataSetByName('Time').GetValues()
facTODx = datasets.GetDataSetByName('x').GetValues()
facTODy = datasets.GetDataSetByName('y').GetValues()
facTODz = datasets.GetDataSetByName('z').GetValues()

Getting Data for a Single Point in Time
[Python - STK API]
# IAgStkObjectRoot root: STK Object Model root
# IAgSatellite satellite: Satellite object
# Change DateFormat dimension to epoch seconds to make the data easier to handle in
# Python
root.UnitPreferences.Item('DateFormat').SetCurrentUnit('EpSec')
satPassDP = satellite.DataProviders.Item('Precision Passes').ExecSingle(2600)
passes = satPassDP.DataSets.GetDataSetByName('Precision Pass Number').GetValues()

Getting Data for Specific Points and Elements
[Python - STK API]
# IAgStkObjectRoot root: STK Object Model root
# IAgSatellite satellite: Satellite object
# Change DateFormat dimension to epoch seconds to make the data easier to handle in
# Python
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 = satPassesDP.GetArray(1)

Using an interval Data Provider
[MATLAB]
% 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 a Time Dependent Data Provider and requesting only specified elements
[MATLAB]
% 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 a Time Independent Data Provider
[MATLAB]
% 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]
% 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]
% 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]
% 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]
% 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]
% 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

© 2024 Analytical Graphics, Inc. All Rights Reserved.