Application Scope Functions
You should load a scenario prior to running these functions from a script. This allows the Ansys Orbit Determination Tool Kit (ODTK®) application to explicitly set attributes affecting coordinate transformations (EOP, nutation), as opposed to using internal defaults when no scenario exists. Some functions will only run when a scenario is loaded, while other functions do not make that check themselves.
The attribute names are not case sensitive, but their parameters are case sensitive. For example, you can use "extractstatehistory" for the attribute ExtractStateHistory, but you must spell the parameter "/coordSys" exactly as specified in the table, with lowercase "c" and the first "S" capitalized.
|
CAgAttr AccountID() Use this to see the account ID string, such as 26884. Return Value
|
Example VBS: Copy
|
|
CAgAttr AppVersion() Use this to see the ODTK application version number, such as "7.2.0". Return Value
|
Example VBS: Copy
|
|
bool CheckForCrossCorr(string runFile) This is a help function for the StateDiff html utility. It determines if a run file contains cross-correlations. Parameters
Return Value
|
Example VBS: Copy
|
|
bool CombineFilters(string outputCombinedFile, string outputDifferencedFile, string referenceFile, string targetFile, bool bLastMeasOnly, string startTime, string StopTime, bool bSaveCrossCorrelations) This function compares and combines two independent filter estimates, usually a "backward" Filter run with a "forward" Filter run. The outputCombinedFile is the resultant combined Filter file (.filrun), and other parameters are the same as for the "CreateDifference" function. |
|
|
CAgAttr ConcatenateSP3Files(string sInFile1, string sInFile2, string sOutFile) This concatenates two SP3 files together. It requires that the second file begin exactly one interval after the first file ends. If a PRN is not in both files, the function will expand the header to include it and set the "P" and "V" records to zeros over the file time span where it is not present. This function does not perform coordinate transformations, so whether you loaded a scenario or not is irrelevant. Parameters
Return ValueThe function returns a CAgAttr object containing the following members:
|
Example VBS: Copy
|
|
bool CopyObject(CAgAttr object) Use this to copy an object to the clipboard for use in later paste operations, such as IsPasteAvailable and PasteObject functions. Parameters
Return ValueThe function returns a CAgAttr object containing the following members:
|
Example VBS: Copy
|
|
bool CreateDifference(string outputFile, string referenceFile, string targetFile, bool bLastMeasOnly, string startTime, string stopTime, bool bSaveCrossCorrelations) This function is called by the StateDiffTool to difference states from two different processes and produces a .difrun file for reporting and graphing. The differences are defined as target - reference, where orbits are differenced in an RIC frame. Parameters
If the start and stop times are empty strings, the function will use the entire file span. Return Value
|
Example VBS: Copy
|
|
CAgAttr CreateNavSolFile(string ephemFile, string outputFile, string options) This function creates a GNSS Navigational Solution file from an ephemeris (*.e) file. Parameters
Return ValueThe function returns a CAgAttr object containing the following members:
|
Example VBS: Copy
|
|
CAgAttr CreateObj(CAgAttr parent, string className, string objectName) This function creates an object as a child of a specified object. Parameters
Return Value
|
Example VBS: Copy
|
|
CAgAttr CreateRestartFDRecord(string restartMetaFile, string time, string satName, string recordName) This function adds a new Flight Dynamics Record component to the Component Browser from a restart record. Parameters
Return ValueThe function returns a CAgAttr object containing the following members:
|
Example JavaScript: Copy
|
|
CAgAttr CreateRunFileFDRecord(string runFileName, string timeMode, string desiredTimeStr, string satName, string recordName) Use this to add a new Flight Dynamics Record to the Component Browser from a run file. Parameters
Return ValueA CAgAttr object containing the following members
|
Example JavaScript: Copy
|
|
bool CreateUpdatedAccelerationHistoryFile(string runFilename, string accelerationHistoryFilename, string updatedAccelerationHistoryFilename, string satelliteName, string maneuverName) Use this to create a new acceleration history file by updating an existing one using deltas simulated or estimated by ODTK processing. Parameters
Return Value
|
Example Python: Copy
|
|
bool CutObject(CAgAttr object) This copies an object to the clipboard for use in further paste operations while also deleting the object from the scenario. See also the function PasteObject. Parameters
Return Value
|
Example VBS: Copy
|
|
bool DeleteObject(CAgAttr object) This takes an ODTK object as the input and returns a Boolean indicating success or not. Parameters
Return Value
|
Example VBS: Copy
|
|
bool DumpFile(string inputSP3, string outputTxt) This function is called by FileDumperTool to list (i.e., print) contents of a GNSS SP3 ephemeris file to a text file. Parameters
Return Value
|
Example VBS: Copy
|
|
CAgAttr ExportObj(CAgAttr object, string filename, bool bSaveChildren) Use this to save an object by specifying the actual object and a flag indicating whether or not to save children of the object. When applied to scenarios, ExportObj will save the scenario and any restart records to a new location but will keep all internal paths pointing to the old location. Parameters
Return Value
|
Example VBS: Copy
|
|
CAgAttr ExportObservationIntervals(string outputFile, string satName, string trkName, double gap, double pad, string options) Use this to create interval files based on the scenario's loaded observation measurement files. It is a helper function for the SaveObservationIntervals tool. The simulator can then import or link to these interval files for use in the custom tracking schedule. If you enter both the satName and trkName as empty strings, the resulting interval file will identify both objects from within the file. This may not work for three-, four-, or five-legged measurements. Parameters
Return ValueThe function returns a CAgAttr object containing the following members:
|
Example VBS: Copy
|
|
bool ExtractEphemeris(string referenceFile, string primarySat, string outputFile, bool inclCov, string covType, string coordFrame, string sOptions) This is a helper function called by the CreateEphFileTool HTML page. It extracts satellite ephemeris from a run file to an ephemeris (*.e) file. Parameters
Return Value
|
Example VBS: This is an example of extracting filter ephemeris and output position/velocity and Position 3x3 covariance in the Fixed frame. Copy
Example VBS: This is an example of generating relative covariance. Copy
|
|
bool ExtractGlobalDensityCorrections(string referenceFile, string outputFile, bool inclCov, string startTime, string stopTime) This function extracts global atmospheric density corrections from a run file and puts them in an ASCII file (*.gdc) formatted to be compatible with input of the contained corrections for use in the filter estimation process. Parameters
Return Value
|
Example VBS: Extracts global atmospheric density corrections without covariance information from a smoother output for the full time span Copy
|
|
CAgAttr ExtractStateHistory(string inputs) Use this to dump the contents of a binary state history file — accessed as a .filrun, .simrun, .lsrun, or .smtrun file — to a readable text file. This function is typically called by the StateFileDumperTool html utility. The inputs string is a list of arguments that contains options of the function. You specify the options by including a keyword followed by text in quotes. For example, using backtick strings in JavaScript:
. /filename is the only required argument. All other parameters are optional. Note:
Parameters
Inputs options
Return ValueThe function returns a CAgAttr object containing the following members:
|
Example VBS: Copy
|
|
bool GenerateDeltaRADec(string outputMeasFile, double timeTolerance, bool modelTimeTagDifferences) Use this to generate a file containing relative optical measurements from the list of tracking data files assigned in the scenario Measurements.Files list. The function constructs relative optical measurements when optical measurements to multiple satellites exist at the same time, or within a time tolerance, from the same optical sensor. The function writes all measurements which it cannot difference, including all nonoptical measurements and optical measurements without matching pairings, to the output tracking data file along with the delta-optical measurements. Parameters
Return Value
|
Example VBS: Copy
|
|
bool GenerateDOWD(string outputDOWDFile, double timeTolerance) Use this to generate a file of Differenced One-Way Doppler (DOWD) or DSN Interferometric Narrowband Spacecraft (INS) measurements from the tracking data files currently assigned in the Scenario.Measurements.Files list. The specified output file should be of the *.gobs format. The function reflects all input measurements in the output file. The function constructs DOWD measurements by differencing two simultaneous one-way TDRS Doppler (3L Doppler) measurements. It simply copies all other measurements and single 3L Doppler measurements to the output file. The function constructs DSN INS measurements by differencing two simultaneous one-way DSN Doppler (DSN 1W Doppler) or TCP (DSN 1W TCP) measurements. It simply copies all other measurements and single DSN 1W Doppler and DSN 1W TCP measurements to the output file. The generated output file can replace all of the input files for subsequent processing. The method also takes a time tolerance, specified in seconds, as input, which allows for the differencing of measurements with slightly offset time tags. Parameters
Return Value
|
Example VBS: Copy
|
|
bool GenerateDOWDFromFiles(string File1, string File2, string outputDOWDFile, double timeTolerance) bool GenerateDOWDFromFiles(string File1, string File2, string outputDOWDFile, double timeTolerance, string aliasMapping1, string aliasMapping2) This function operates like the GenerateDOWD functional attribute except that observations to be used in the differencing operations are pulled from two specified input files. It performs the differences in the sense of (File2 – File1). The function needs the optional aliasMapping arguments, which function like the AliasMapping options in the Scenario Measurements.Files list, when the input files specify tracking IDs as strings. The CCSDS TDM format is a commonly used tracking data format that supplies tracking IDs as strings. Parameters
Return Value
|
Example VBS: Copy
|
|
bool GenerateICRFXYSFile(string startDateGregTDT, string stopDateGregTDT, string algorithm, string outputDirectory) Use this to generate a set of files containing tabulated X, Y, and S angles that support interpolation during the evaluation of ICRF-to-Earth-fixed coordinate transformations. The main use of this function is to generate support files that reach further into the future than the files contained in the standard ODTK application installation (end time of 2150). ODTK processing will generate the resulting output data tables with a frequency of one row per day (TDT). Parameters
Return Value
|
Example VBS: Copy
|
|
bool GenerateNavSolutions(string inputRinexFile, string outputNavSolFile, string GNSSConstellation) Use this to generate a file of GNSS navigation solutions from a RINEX file. You must load a scenario with a configured GNSS constellation. This function has a last argument that takes in a string with the name of GNSS Constellation ("GPS," "GALILEO," "GLONASS," "BeiDou") that limits the algorithm to use only observations originated from GNSS satellites that belong to said constellation. Parameters
Return Value
|
Example VBS: Copy
|
|
CAgAttr GeneratePAFFile(string inputFile, string outputFile, string options) The PAF file is the GNSS Performance Assessment File. This function takes a .difrun file as input and returns orbit and clocks errors for the GNSS satellites in the run file using data at requested intervals. The orbit errors are in the Earth Centered Earth Fixed frame in units of meters and meters/sec. The clock phase and frequency errors are also in units of meters and meters/sec. By default, it samples the data at 15-minute intervals. It processes only one data file per run. It can write data at any start time and for any length of time, as opposed to being limited to one day starting at midnight. The GeneratePAFFile html utility calls this function. To get GNSS orbit differences as compared to an SP3 file, first run the SP3_to_Simrun utility and difference the ODTK run of interest (filrun, simrun, or smtrun) against the SP3.simrun file. Use that as the input to generate the PAF file. The options string is a list of arguments that contains options of the function. You specify the options by including a keyword followed by text in quotes. For example, using backtick strings in JavaScript:
Parameters
options
Return ValueThis function returns a CAgAttr object containing the following members:
|
Example VBS: Copy
|
|
CAgAttr GeneratePSFFile(string inputFile, string outputFile, string options) The PSF file is a GNSS Prediction Support File. This function takes a .filrun or .smtrun file as input and calculates RMS for the values in the PSF file using data at requested intervals. By default, it samples data at 15-minute intervals. It does not do constellation averaging if there is less than 24 hours of data in the file. It only processes one data file per run, so for a seven-day average, the function requires a single run file containing seven days of data. The GeneratePSFFile html utility calls this function. The options string is a list of arguments that contains options of the function. You specify the options by including a keyword followed by text in quotes. For example, using backtick strings in JavaScript:
Parameters
options
Return ValueThis function returns a CAgAttr object containing the following members:
|
Example VBS: Copy
|
|
CAgAttr GenerateSP3FromStateHistory(string inputs) This is a helper function for the StateFile_To_SP3 utility. It returns the contents of a state history file to an SP3 file. The inputs string is a list of arguments that contains options of the function. You specify the options by including a keyword followed by text in quotes. For example, using backtick strings in JavaScript:
. /filename is the only required argument. All other parameters are optional. Note:
Parameters
Inputs Options
Return ValueThis function returns a CAgAttr containing the following members:
|
Example VBS: Copy
|
|
CAgAttr GenerateTLE(string ephemFile, string startTime, string stopEntry, double step, double convergence, int maxIterations, string idString, string TLEFile, string reportName, string SGP4ModuleName, bool UseSGP4XPOption) This is a helper function for the OD GenerateTLE utility. It generates a TLE file that results from a least squares fit to the ephemeris from the input file. Parameters
Return ValueThis function returns a CAgAttr containing the following members:
|
Example VBS: Copy
|
|
CAgAttr GetBoundaryRunFileTimes(string runFileName) This function returns the earliest and latest times that are present in a run file. Parameters
Return ValueThis function returns a CAgAttr containing the following members:
|
Example JavaScript: Copy
|
|
CAgAttr GetCBNames(string inputRunFile) This function analyzes an input run file and determines which central bodies are referenced within that run file. Parameters
Return ValueThis function returns a CAgAttr containing the following members:
|
Example VBS: Copy
|
|
CAgAttr GetCoordSysNames(string cbName) This provides the valid coordinate system names for a central body, which could be "Earth", "Moon", or "Sun". Parameters
Return ValueThis function returns a CAgAttr containing the following members:
|
Example VBS: Copy
|
|
CAgAttr GetEphemTimeSpan(string filename) This gets the start and stop time of the ephemeris (.e) file. Parameters
Return ValueThis function returns a CAgAttr containing the following members:
|
Example VBS: Copy
|
|
CAgAttr GetFDRecordEpoch(string recordName) This function returns the time of a flight dynamics record. Parameters
Return ValueThis function returns a CAgAttr containing the following members:
|
Example JavaScript: Copy
|
|
CAgAttr GetFDRecords() This function returns a list of all the available flight dynamics records in the Component Browser. Return ValueThis function returns a CAgAttr containing the following members:
|
Example JavaScript: Copy
|
|
CAgAttr GetRestartObjects(string restartMetaFile, string time) This function returns a list of the available satellites within a restart record at a given time. Parameters
Return ValueThis function returns a CAgAttr containing the following members:
|
Example JavaScript: Copy
|
|
CAgAttr GetRestartPath(string scenName, string objectName) This returns the path to the restart record metadata file for an object in a scenario. Parameters
Return ValueThis function returns a CAgAttr containing the following members:
|
Example JavaScript: Copy
|
|
CAgAttr GetRestartStateConfig(string restartMetaFile, string time, string satName) This returns a flight dynamics state configuration object for a satellite from a restart record at a particular time. Parameters
Return ValueThis function returns a CAgAttr containing one or six members depending on whether or not all inputs have values:
|
Example JavaScript: Copy
|
|
CAgAttr GetRestartTimes(string restartMetaFile) This returns the list of times available within a restart record when given the filename of the restart record metadata file. Parameters
Return ValueThis function returns a CAgAttr containing the following members:
|
Example JavaScript: Copy
|
|
CAgAttr GetRunFileObjects(string runFileName, string timeMode, string desiredTimeStr) This returns a list of satellites that have data in a run file at a given time. Parameters
Return ValueThis function returns a CAgAttr containing the following members:
|
Example JavaScript: Copy
|
|
CAgAttr GetRunFileStateConfig(string runFileName, string timeMode, string desiredTimeStr, string satName) This returns a flight dynamics state configuration object for a satellite from a run file at a particular time. Parameters
Return ValueThis function returns a CAgAttr containing one or six members depending on whether or not all inputs have values:
|
Example JavaScript: Copy
|
|
CAgAttr GetSatCoordFrameChoices(string referenceFile, string primarySat) This is a helper function called by the CreateEphFileTool html page. It identifies the coordinate frame choices for the satellite of interest. Parameters
Return ValueThis function returns a CAgAttr containing the following members:
|
Example VBS: Copy
|
|
CAgAttr GetStateHistoryFileContents(string filename) This function reads the contents of a state history file, identifying states within the file and returning a string with each state's name. The returned string is split into a number of sections, identifying whether covariance values are available, indicating satellites with position/velocity states, and listing all remaining state values. Parameters
Return ValueThis function returns a CAgAttr containing the following members:
|
Example VBS: Copy
|
|
bool GNSSDataSmoothing(string outputFile, int nPoints, double minSNR, double rng3DiffTest, double phase3DiffTest) Use this to generate a smoothing observation file from GNSS accumulated-delta-range-aided pseudorange measurements using the assigned tracking files in the Scenario object. The GenerateGNSSSPRObs html utility calls this function. Parameters
Return Value
|
Example VBS: Copy
|
|
CAgAttr HostID() Use this to get the host ID, such as 001fa435ab78. Return VAlue
|
Example VBS: Copy
|
|
bool ImportFDRecordToSat(string satName, string recordName) This function imports a chosen flight dynamics record into a specified satellite. Parameters
Return VAlue
|
Example JavaScript: Copy
|
|
CAgAttr InitialStateTool(string source, string filename, string command, string options) This is a helper function for the Initial State Tool HTML interface. This function does not modify the initial state of a satellite; it parses the input file and provides information about what updates are possible based on the input. To actually update the initial conditions, you need an STK ephemeris file to pass to the satellite's ReferenceTrajectory.UpdateInitialConditions function. This function provides another useful application by calling the GetEphemTimeSpan function, which in turn calls this function. Parameters
Return VAlue
|
Example VBS: Copy
|
|
bool IsPasteAvailable(CAgAttr parentObject) This returns a flag indicating whether or not contents of the clipboard can be pasted as a child of the specified parent object. It is used in conjunction with the CopyObject and PasteObject commands. Parameters
Return Value
|
Example VBS: Copy
|
|
CAgAttr LambertSolution(CAgAttr date1, CAgAttr pos1, CAgAttr date2, CAgAttr pos2) This computes the Lambert Solutions found, given a pair of radial positions separated in time. Two calls to the helper function NewPositionVector must precede this function. Parameters
Return ValueThe function returns a CAgAttr containing the following members:
All four (v11, v12, v21, v22) are (0, 0, 0) when no corresponding solution is found. |
Example VBS: Copy
|
|
CAgAttr LoadObj(CAgAttr objName, string filename) Use this to load an object from a file. The loaded object becomes a child of the input parent object. Parameters
Return Value
|
Example VBS: Copy
|
|
CAgAttr LoadStateAndCovarianceSelection(string filename) This loads a file containing a state and covariance selection and returns that selection string. You should use this with the (*.dmpsav) extension. This function is intended for use by the FlexibleStateFileDumperTool utility. It serves to complement the ExtractStateHistory attribute by loading a flexData string originally created and saved by the SaveStateAndCovarianceSelection attribute. Parameters
Return VAlueThe function returns a CAgAttr containing the following members:
|
Example VBS: Copy
|
|
CAgAttr NewDate(string date, string units) Creates a new date from a string. Valid Date FormatsParameters
Return Value
|
Example VBS: Copy
|
|
CAgAttr NewPositionVector(double x, double y, double z, string units) This is a helper function that creates a three-component input for use by the LambertSolution function. It requires an input of three numbers and a valid unit string of length. Parameters
Return Value
|
Example VBS: Copy
|
|
CAgAttr NewQuantity(double value, string units) Use this to create a new quantity object, which is a value with units. Parameters
Return VAlue
|
Example VBS: Copy
|
|
bool PasteObject(CAgAttr parentObject) This function pastes contents of the clipboard as a child of specified parent object. See also the IsPasteAvailable and CopyObject commands. Parameters
Return VAlue
|
Example VBS: Copy
|
|
CAgAttr RegistrationID() Use this to get the registration ID, such as "DISK_SERIAL_NUM=a4e217c5". Return VAlue
|
Example VBS: Copy
|
|
bool RunScript(string scriptName) This function allows control of the ODTK application to be passed to an external script. The function is passed a message and the personality object. This script then has complete control over the ODTK application, with the ability to create and delete objects, generate reports, etc. Parameters
The function name must match the filename less the extension, or else the script will not run. Return Value
|
Example VBS: Copy
|
|
CAgAttr SaveObj(CAgAttr object, string filename, bool bSaveChildren) Saves an object by specifying the actual object and a flag indicating whether or not to save children of the object. Parameters
When applied to scenarios, SaveObj will change all internal paths to point to the new location of the scenario. Return VAlue
|
Example VBS: Copy
|
|
CAgAttr SaveStateAndCovarianceSelection(string filename, string selectionString) This function creates or overwrites the file name specified with a new text file containing the selection string and with a file extension of *.dmpsav. You can load this file for future runs of the dumping utility to quickly select a desired set of states and covariances for dumping. This function is intended for use by the FlexibleStateFileDumperTool utility. It serves to complement the ExtractStateHistory attribute by saving a flexData string to a file for retrieval by the LoadStateAndCovarianceSelection attribute. Parameters
Return Value
|
Example VBS: Copy
|
|
CAgAttr SeparateSP3(const string& inputSP3FileName) This function supports the SeparateSP3 utility, which separates an SP3 file containing mixed constellations into multiple SP3 files, each containing data for an individual constellation. The output files are named <inputfile>_T.<ext> Where <inputfile> = input file name, excluding the extension.
Parameters
Return Value
|
Example VBS: Copy
|
|
CAgAttr SetAsDefault(CAgAttr object) This function sets a specified object as the default object to be used when creating another object of that type. Default objects are saved to the Defaults folder under the Config directory. Parameters
Return Value
|
Example VBS: Copy
|
|
bool SortUTDF(string inputFile, string outputFile) This function sorts a UTDF Measurement file into increasing time order. The output format will be in UTDF regardless of the extension provided. Parameters
Return Value
|
Example VBS: Copy
|
|
bool SP3ToSimrun(string SP3File, string constellationName, string outputFile) This is a helper function to the SP3_To_Simrun utility. It converts the GNSS orbit and clock states in the given SP3 file to a .simrun file (simulation state history file). This enables use of the ODTK State Differencing and Reporting/Graphing tools for analysis. See also the GNSSSourceToSimrun function. Parameters
Return Value
|
Example VBS: Copy
|
|
bool WriteMessage(string message, string status) This function writes text to the Message Viewer window, allowing scripts to write informational messages, warnings, etc. Each type of message (warning, error, informational, and debug) will have a unique icon next to it in the message viewer. Parameters
Return Value
|
Example VBS: Copy
|