Application Scope Functions
You should load a scenario prior to running these functions from a script. This allows ODTK 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.
Attribute | Description/Example |
---|---|
AccountID |
This returns the account ID string, such as 26884. Prototype: CAgAttr AccountID() The returned object is a string containing the account ID. Example VBS: accountIDStr = ODTK.AccountID |
AppVersion |
This returns the ODTK version number — e.g., "7.2.0" — as a string. Prototype: CAgAttr AppVersion The returned object is a string containing the ODTK version.
Example VBS: version = ODTK.AppVersion |
CheckForCrossCorr |
This is a help function for the StateDiff html utility. It determines if a run file contains cross-correlations. Prototype: bool CheckForCrossCorr() The returned flag is true if the file contains cross-correlations. Example VBS: runFile = "C:\tmp\Scenario1.filrun" ODTK.writemessage ODTK.CheckForCrossCorr(runFile), "force" |
Combine Filters |
Use this to compare and combine two independent filter estimates, usually a "backward" Filter run with a "forward" Filter run. Prototype: bool CombineFilters(string outputCombinedFile, string outputDifferencedFile, string referenceFile, string targetFile, bool bLastMeasOnly, string startTime, string StopTime, bool bSaveCrossCorrelations) The outputCombinedFile is the resultant combined Filter file (.filrun), and other parameters are the same as "CreateDifference". |
ConcatenateSP3Files |
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. Prototype: CAgAttr ConcatenateSP3Files( Where:
The returned object contains two members:
Example VBS: set retVal = ODTK.ConcatenateSP3Files(inputFile1,inputFile2,outputfile) ODTK.WriteMessage retVal.Messages, "debug" ODTK.WriteMessage "Success? " & retVal.Succeed, "debug" |
CopyObject |
This copies an object to the clipboard for use in later paste operations. See also the IsPasteAvailable and PasteObject functions. Prototype: bool CopyObject(CAgAttrVariable object) The returned Boolean indicates success or not. Example VBS: bSuccess = ODTK.CopyObject(sc.Satellite(0)) |
Create |
This function is deprecated. Use CreateObj() instead. Prototype: bool Create(string parentName, string className, string objectName) Where:
It returns a Boolean indicating success or not. Example VBS: bSuccess = ODTK.Create("", "Scenario", "Scen1") bSuccess = ODTK.Create("Scen1", "Satellite", "Sat1") |
CreateDifference |
This is called by the StateDiffTool to difference states from two different processes and produce a .difrun file for reporting and graphing. The differences are defined as target - reference, where orbits are differenced in an RIC frame. Prototype: bool CreateDifference(string outputFile, Where:
If the start and stop times are empty strings, the function will use the entire file span. It returns a Boolean indicating success or not. Example VBS: ref = "c:\tmp\Scenario1.filrun" tgt = "c:\tmp\Scenario1.simrun" output = "c:\tmp\Scenario1.difrun" t1 = "11 Jul 2010 00:30:00"< t2 = "11 Jul 2010 01:25:00" set retv = ODTK.CreateDifference(output, ref, tgt, true, t1, t2, false) |
CreateNavSolFile |
This creates a GNSS Navigational Solution file from an ephemeris (*.e) file. Prototype: CAgAttr CreateNavSolFile(string ephemFile, string outputFile, string options) Where:
The returned object has the following members:
Example VBS: eFile = "C:\tmp\mysat.e" nFile = "c:\tmp\MySat.navsol options = "/recID 133" set result = odtk.createNavSolFile(eFile, nFile, options) odtk.writemessage result.Succeed, "force" odtk.writemessage result.startTime, "force" odtk.writemessage result.stopTime, "force" |
CreateObj |
This creates an object as a child of a specified object. Prototype: CAgAttr CreateObj(CAgAttr parent, string className, string objectName)Where:
It returns handle to the newly created object. Example VBS: Set scenObj = ODTK.CreateObj(ODTK, "Scenario", "Scen1") Set satObj1 = ODTK.CreateObj(scenObj, "Satellite", "Sat1") |
CutObject |
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. Prototype: bool CutObject(CAgAttr object) The input is an ODTK object; it returns true if the object was cut. Example VBS: bSuccess = ODTK.CutObject(sc.Sat1.ToGround) |
DeleteObject |
This deletes an object from the scenario. Prototype: bool DeleteObject(CAgAttr object) The function takes an ODTK object as the input and returns a Boolean indicating success or not.
DeleteObject() returns handle to the object parent scope. Example VBS: bSuccess = ODTK.DeleteObject(sc.Satellite1) |
DumpFile |
This function called by FileDumperTool to list (i.e., print) contents of a GNSS SP3 ephemeris file to a text file. Prototype: bool DumpFile(string inputSP3, string outputTxt) Where:
This function always returns true.
Example VBS: input = "c:\tmp\input.sp3" output = "c:\tmp\sp3dump.txt" bSuccess = ODTK.dumpFile(input, output) |
ExportObj |
This saves an object by specifying the actual object and a flag indicating whether or not to save children of the object. Prototype: CAgAttr ExportObj(CAgAttr object, string filename, Where:
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. Example VBS: ODTK.ExportObj(scen, "C:\tmp\Scenario1copy1.sco", true) Also see: SaveObj |
ExportObservationIntervals |
This creates interval files based on scenario's loaded observation measurement files, and 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. Note that 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. Prototype: CAgAttr ExportObservationIntervals( Where:
It returns an object containing one member, Succeed, which is a Boolean indicating success or not. Example VBS: outFile = "C:\tmp\Meas.int" sat = "" trk = "" gap = 1200.0 pad = 0.0 options = "" set result = ODTK.ExportObservationIntervals(outFile, sat, trk, gap, pad, options) odtk.WriteMessage result.Succeed, "debug" |
ExtractEphemeris |
This is a helper function called by the CreateEphFileTool HTML page. It extracts satellite ephemeris from a run file to an ephemeris (*.e) file. Prototype: bool ExtractEphemeris(string referenceFile, Where:
Optional parameters are as follows and consist of a keyword followed by a value string:
It returns a Boolean indicating success or not. Example VBS to Extract filter ephemeris and output position/velocity and Position 3x3 covariance in the Fixed frame refFile = "C:\tmp\Scenario1.filrun" sat = "Satellite3" eFile = "c:\tmp\sat3.e" covType = "Position 3x3 Covariance" coordFrame = "Fixed" bRes = odtk.ExtractEphemeris(refFile, sat, eFile, true, covType, coordFrame, "") odtk.WriteMessage bRes, "debug" Example VBS to output relative covariance refFile = "C:\tmp\Scenario1.filrun" sat = "Satellite3" eFile = "c:\tmp\sat3.e" covType = "Position 3x3 Covariance" coordFrame = "ICRF" quote = """" sInclCorr = "/inclCorr " & quote & "TRUE" & quote sTargetName = "/targetName " & quote & "Satellite1" & quote sOptions = sInclCorr & sTargetName bRes = odtk.ExtractEphemeris(refFile, sat, eFile, true, covType, coordFrame, sOptions) odtk.WriteMessage bRes, "debug" |
ExtractGlobalDensityCorrections |
This function extracts global atmospheric density corrections from a run file and puts it in an ASCII file (*.gdc) formatted to be compatible with input of the contained corrections for use in the filter estimation process. Prototype: bool ExtractGlobalDensityCorrections ( Where:
It returns a Boolean indicating success or not. Example VBS to extract global atmospheric density corrections without covariance information from a smoother output for the full time span refFile = "C:\tmp\Scenario1.smtrun" outputFile = "c:\tmp\DensityCorr.gdc" odtk.ExtractGlobalDensityCorrections( refFile, outputFile, false, "", "") |
ExtractStateHistory |
This dumps 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. Prototype: CAgAttr ExtractStateHistory(string inputs) 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. The only required argument is the input file name:
Optional parameters are as follows:
The returned object contains three members:
Notes:
Example VBS: The tricky part here is assembling a string with embedded quotes, which you can do using three sequential quotes ("""). input = "/filename " & """C:\tmp\Scenario1.filrun""" & " /output " & """c:\tmp\filrun.txt""" & " /startTime " & """11 Jul 2010 00:00:00.000""" & " /coordSys " & """Fixed""" set retv = ODTK.ExtractStateHistory(input) odtk.writemessage retv.Succeed,"force" odtk.writemessage retv.OutputFile,"force" odtk.writemessage retv.Messages,"force" |
GetStateHistoryFileContents |
This 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. Protoype: CAgAttr GetStateHistoryFileContents(string filename) The only required argument is the input file name:
The returned object contains three members:
The ResultsMsg has up to three different portions to its string, but they always appear in the same order:
Example VBS: filename = "C\od_7.0\TrackingData\scenario.filrun" ODTK.GetStateHistoryFileContents filename |
SaveStateAndCovarianceSelection |
This 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.
Protoype: CAgAttr SaveStateAndCovarianceSelection(string filename, string selectionString) 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. You must supply both arguments:
The returned object contains two members:
Example VBS: filename = "C\od_7.0\TrackingData\selection.dmpsav" selectionString = "Satellite1.Orbit,Satellite1.AtmosphericDensity;Satellite1.Orbit" ODTK.SaveStateAndCovarianceSelection filename, selectionString |
LoadStateAndCovarianceSelection |
This loads a file containing a state and covariance selection and returns that selection string. You should use this with the (*.dmpsav) extension.
Protoype: CAgAttr LoadStateAndCovarianceSelection(string filename) 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. You must supply one argument:
The returned object contains three members:
Example VBS: filename = "C\od_7.0\TrackingData\selection.dmpsav" ODTK.LoadStateAndCovarianceSelection filename |
GenerateDeltaRaDec |
This generates 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 non-optical measurements and optical measurements without matching pairings, to the output tracking data file along with the delta-optical measurements. Protoype: bool GenerateDeltaRADec (string outputMeasFile, double timeTolerance, bool modelTimeTagDifferences) where:
The returned Boolean indicates success or not.
Example VBS outputFile = "C\od_6.0\TrackingData\DeltaOptical.gobs" |
GenerateDOWD |
This generates 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. Prototype: bool GenerateDOWD (string outputDOWDFile, double timeTolerance) The returned Boolean indicates success or not.
Example VBS: timeTolerance = 0.0 dowdFile = "C:\tmp\MySatDOWD.gobs" bSuccess = ODTK.GenerateDOWD(dowdFile, timeTolerance) |
GenerateDOWDFromFiles |
This 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). Prototype can be either of the following: bool GenerateDOWDFromFiles (string File1, string File2, string outputDOWDFile, double timeTolerance) bool GenerateDOWDFromFiles (string File1, string File2, string outputDOWDFile, double timeTolerance, string aliasMapping1, string aliasMapping2) 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. The returned Boolean indicates whether or not the function was successful. Example VBS:
timeTolerance = 0.0 oneWayFile1 = "C:\tmp\MyOneWayObs1.gobs" oneWayFile2 = "C:\tmp\MyOneWayObs2.gobs" dowdFile = "C:\tmp\MySatDOWD.gobs" bSuccess = ODTK.GenerateDOWD(oneWayFile1, oneWayFile2, dowdFile, timeTolerance) oneWayFile1 = "C:\tmp\MyOneWayObs1.tdm" oneWayFile2 = "C:\tmp\MyOneWayObs2.tdm" aliasMapping = “CCSDS” dowdFile = "C:\tmp\MySatDOWD.gobs" bSuccess = ODTK.GenerateDOWD(oneWayFile1, oneWayFile2, dowdFile, timeTolerance, aliasMapping, aliasMapping) |
GenerateICRFXYSFile |
This generates 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 installation (end time of 2150). ODTK will generate the resulting output data tables with a frequency of one row per day (TDT).
Prototype: bool GenerateICRFXYSFile (string startDateGregTDT, string stopDateGregTDT, string algorithm, string outputDirectory)
Where:
The returned Boolean indicates success or not.
Example VBS: startDateTDT = "1 Jan 1980 00:00:00.00" stopDateTDT = "1 Jan 2200 00:00:00.00" algorithm = “IAU2006” outputDirectory = "C:\Users\ODTKMaster\Documents\ODTK 7\New ICRF Files" bSuccess = ODTK.GenerateICRFXYSFile(startDateTDT, stopDateTDT, algorithm, outputDirectory) |
GenerateNavSolutions |
This generates 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 ("GNSS," "GALILEO," "GLONASS," "BeiDou") that limits the algorithm to use only observations originated from GNSS satellites that belong to said constellation.
Prototype: bool GenerateNavSolutions(string inputRinexFile, string outputNavSolFile, string GNSSConstellation)
The returned Boolean indicates success or not.
Example VBS: rinexFile = "C:\odtk\od_7.0\TrackingData\GpsConstTest.rnx" navFile = "C:\tmp\Rcvr800.navsol" bSuccess = ODTK.GenerateNavSolutions(rinexFile, navFile, "GPS") |
GeneratePAFFile |
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. Prototype: CAgAttr GeneratePAFFile(string inputFile, string outputFile, string options)Where:
Optional parameters are as follows:
The returned object contains three members:
Example VBS: ifile = "C:\tmp\GNSSFinManSimpleTest.difrun" ofile = "c:\tmp\test.paf" Input = " /step " & """900""" & " /source " & """GOCGIS""" & " /class " & """GNSSSatellite""" set retv = ODTK.GeneratePAFFile(ifile, ofile, input) odtk.writemessage retv.Succeed,"force" odtk.writemessage retv.OutputFile,"force" odtk.writemessage retv.Messages,"force" |
GeneratePSFFile |
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. Prototype: CAgAttr GeneratePSFFile(string inputFile, Where:
Optional parameters are as follows:
The returned object contains three members:
Example VBS: ifile = "C:\tmp\GNSSFinManSimpleTest.filrun" ofile = "c:\tmp\test.psf" Input = " /step " & """900""" set retv = ODTK.GeneratePSFFile(ifile, ofile, input) odtk.writemessage retv.Succeed,"force" odtk.writemessage retv.OutputFile,"force" odtk.writemessage retv.Messages,"force" |
GenerateSP3fromStateHistory |
This is a helper function for the StateFile_To_SP3 utility. It returns the contents of a state history file to an SP3 file. Prototype: CAgAttr GenerateSP3FromStateHistory( The inputs string is a list of arguments that contains options of the function. Specify options by including a keyword followed by text in quotes. The only required argument is the input filename:
Optional parameters are as follows:
The returned object contains three members:
Notes:
Example VBS: input = "/filename " & """C:\tmp\GNSSFinManTest.filrun""" set retv = ODTK.GenerateSP3FromStateHistory(input) odtk.writemessage retv.Succeed,"force" odtk.writemessage retv.OutputFile,"force" odtk.writemessage retv.Messages,"force" |
GenerateTLE |
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. Prototype: CAgAttr GenerateTLE(string ephemFile, Where:
The parameter stopEntry, which is a string of the form "Method+Value", has three choices for Method:
The idString combines four values that are defined within a TLE:
The returned object contains the following:
Example VBS: eFile = "c:\tmp\s3.e" t1 = "11 Jul 2010 00:10:00.000" t2s = "TIME+11 Jul 2010 06:00:00.000" dt = 0 conv = .001 maxIt = 5 idString = "33+1+55432+U+ " tleFile = "c:\tmp\s37.tle" rptFile = "c:\tmp\s3_tle7.txt" moduleName = "SGP4" useXPOption = "false" set retv = odtk.GenerateTLE(eFile, t1, t2s, dt, conv, maxIt, idString, tleFile, rptFile, moduleName, useXPOption) odtk.WriteMessage retv.Succeed, "force" odtk.writeMessage retv.errorMsg, "force" odtk.writeMessage retv.fitstarttime, "force" odtk.writeMessage retv.fitstoptime, "force" odtk.writeMessage retv.finalRMS, "force" |
GetCBNames |
This analyzes an input run file and determines which central bodies are referenced within that run file. Prototype: CAgAttr GetCBNames(string inputRunFile) The input run file is a .filrun, .smtrun, .simrun, or .lsrun file. The returned object has two members:
Example VBS: eFile = "c:\tmp\scenario1.filrun" set retv = odtk.GetCBNames(eFile)> odtk.WriteMessage retv.Succeed, "force" odtk.writeMessage retv.CBNames.size, "force" for each thing in retv.CBNames odtk.writeMessage thing, "force" next |
GetCoordSysNames |
This provides the valid coordinate system names for a central body, which is 'Earth", "Moon", or "Sun". Prototype: CAgAttr GetCoordSysNames(string cbName) The returned object has two members:
Example VBS: set retv = odtk.GetCoordSysNames("Sun") odtk.WriteMessage retv.Succeed, "force" odtk.writeMessage retv.CoordSystems.size, "force" for each thing in retv.CoordSystems odtk.writeMessage thing, "force" next |
GetEphemTimeSpan |
This gets the start and stop time of the ephemeris (.e) file. Prototype: CAgAttr GetEphemTimeSpan(string filename) The file name is the input ephemeris (.e) file. The function returns an object with four members:
Example VBS: set result = ODTK.GetEphemTimeSpan("c:\tmp\s3.e") odtk.writeMessage result.Succeed, "debug" odtk.writeMessage result.StartTime, "debug" odtk.writeMessage result.StopTime, "debug" odtk.writeMessage result.Cov6x6, "debug" |
GetSatCoordFrameChoices |
This is a helper function called by the CreateEphFileTool html page. It identifies the coordinate frame choices for the satellite of interest. Prototype: CAgAttr GetSatCoordFrameChoice (string referenceFile, string primarySat) Where:
The returned object contains five members:
Example VBS: refFile = "C:\tmp\Scenario1.filrun" sat = "Sat3" set retv = ODTK. GetSatCoordFrameChoices (refFile, sat) odtk.writemessage retv.Succeed,"force" odtk.writemessage retv.CB,"force" odtk.writemessage retv.DefaultCoordFrame,"force" odtk.writemessage retv.Messages,"force" set frameChoices = retv.CoordFrameChoices for each frame in frameChoices odtk.writemessage frame,"force" Next |
GNSSDataSmoothing |
This generates 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. Prototype: bool GNSSDataSmoothing(string outputFile, int nPoints, double minSNR, double rng3DiffTest,double phase3DiffTest) Where:
The function returns a Boolean of false if it cannot create the output file. It writes all status and error messages to the message viewer. Example VBS: outFile = "C:\Tmp\GNSSSPRObs.gobs" bRes = ODTK.GNSSDataSmoothing(outFile, 5, 0, 0, 0) odtk.WriteMessage bRes, "force" |
HostID |
This returns the host ID, such as 001fa435ab78. Prototype: CAgAttr HostID() The returned object contains a string with the host ID. Example VBS: ODTK.WriteMessage ODTK.HostID, "force" |
InitialStateTool |
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.UpdateInitial-Conditions function. This function provides another useful application by calling the GetEphemTimeSpan function, which in turn calls this function. Prototype: CAgAttr InitialStateTool(string source, string filename, string command,string options) Where:
When source = "TLE", the command may be:
When source = "TLE", the options string may contain:
When source = "VCM," the options string may contain:
If source is "VCM," this function reads the physical data from the VCM file and converts the initial state in the VCM file to an STK ephemeris file containing a single ephemeris point. This function then returns an object with these members:
If source is "EPH", the function returns an object with these members:
If source is "TLE", the function returns an object with these members:
If source is "CCSDS", this function reads the physical data from the OPM file and converts the initial state in the OPM file to an STK ephemeris file containing a single ephemeris point. This function then returns an object with these members:
Example VBS: efile = "c:\tmp\MySat.e" set retv = ODTK.InitialStateTool("EPH", efile,"","") odtk.writemessage retv.starttime, "debug" odtk.writemessage retv.stoptime, "debug" odtk.writemessage retv.cov6x6, "debug" odtk.writemessage retv.succeed, "debug" odtk.writemessage retv.CentralBody, "debug" |
IsPasteAvailable |
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. Prototpye: bool IsPasteAvailable(CAgAttr parentObject) Example VBS: bCanPaste = ODTK.IsPasteAvailable(sc) |
LambertSolution |
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. Prototype: CAgAttr LambertSolution(CAgAttr date1, CAgAttr pos1, CAgAttr date2, CAgAttr pos2)Where:
It returns an object with these members:
All four (v11, v12, v21, v22) are (0, 0, 0) when no corresponding solution is found. Example VBS: t1 = "01 Jan 2005 00:00:00.000 UTCG" t2 = "01 Jan 2005 00:00:10.000 UTCG" x1 = -6078486.439 x2 = 4652611.666 x3 = -987009.666 a1 = -6102754.834 a2 = 4634162.069 a3 = -921914.919 set pos1 = ODTK.NewPositionVector(x1, x2, x3, "m") set pos2 = ODTK.NewPositionVector(a1, a2, a3, "m") set retv = ODTK.LambertSolution(t1, pos1, t2, pos2) odtk.writeMessage retv.Succeed, "force" odtk.writeMessage retv.nSol, "force" odtk.writeMessage retv.v11.X.GetIn("km*sec^-1"), "force" odtk.writeMessage retv.v11.Y.GetIn("km*sec^-1"), "force" odtk.writeMessage retv.v11.Z.GetIn("km*sec^-1"), "force" |
LoadLeapSecondAndEOPFiles |
This is a deprecated function; use the function of the same name in the Scenario scope. |
LoadObj |
This loads an object from a file. The loaded object becomes a child of the input parent object. Prototype: CAgAttr LoadObject(CAgAttr objName, string filename) Where:
It returns handle to the newly loaded object. Example VBS (add a transponder onto a satellite): set newObj = ODTK.LoadObj(sc.Sat1,"C:\tmp\ToGround.tpd") |
LoadObject |
This is obsolete. It loads an object from a file using object names. The loaded object becomes a child of the input named object. Prototype: bool LoadObject(string objName, string filename)v Where:
It returns true if the object was loaded. Example VBS: Add a transponder onto a satellite:ODTK.LoadObject "Scen1.Sat1","C:\tmp\ToGround.tpd" |
NewDate |
This creates a new date from a string. Prototype: CAgAttr NewDate(string date, string units) Example VBS: sc.Filter(0).ProcessControl.StartTime = ODTK.NewDate("1 Aug 2009 08:05:30.00", "UTCG") set nd = ODTK.NewDate("08183.5", "YYDDD") ODTK.WriteMessage nd.Format("GNSSG"), "debug" |
NewPositionVector |
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. Prototype: CAgAttr NewPositionVector(double x, double y, The returned object has three members, which are quantities that are supposed to be position but have velocity units (so ignore the resulting units):
Example VBS: unitstring = "m" x1 = -6078486.439 y1 = 4652611.666 z1 = -987009.666 set pos1 = ODTK.NewPositionVector(x1, y1, z1, unitstring) ODTK.WriteMessage pos1.X, "debug" |
NewQuantity |
This creates a new quantity object, which is a value with units. Prototype: CAgAttr NewQuantity(double value, string units) The returned object is a quantity object. Example VBS: sc.Satellite(0).PhysicalProperties.Mass = ODTK.NewQuantity(3567.15, "lb") set newMass = odtk.NewQuantity("1000", "kg") odtk.WriteMessage newMass.GetIn("lb"), "force" |
PasteObject |
This pastes contents of the clipboard as a child of specified parent object. See also the IsPasteAvailable and CopyObject commands. Prototype: bool PasteObject(CAgAttr parentObject) It returns a flag indicating success or failure. Example VBS: bSuccess = ODTK.PasteObject(sc) |
RegistrationID |
This returns the registration ID, such as "DISK_SERIAL_NUM=a4e217c5". Prototype: CAgAttr RegistrationID() The returned object is a string. Example VBS: registrationIDStr = ODTK.RegistrationID |
RunScript |
This allows control of ODTK to be passed to an external script. The function is passed a message and the personality object. This script then has complete control over ODTK, with the ability to create and delete objects, generate reports, etc. Prototype: bool RunScript(string scriptName) Where scriptName (such as filename.vbs) is a file containing a function with the signature: Function filename(msg, ODTK) End Function Note that the function name must match the filename less the extension, or else the script will not run. The RunScript function always returns a value of true. Example VBS: scriptName = "C:\tmp\MyScript.vbs" ODTK.RunScript scriptName Where MyScript.vbs contains the following code: Function MyScript(msg, od) regID = od.RegistrationID od.writeMessage "RegID: " & regID, "force" End Function |
SaveObj |
This saves an object by specifying the actual object and a flag indicating whether or not to save children of the object. Prototype: CAgAttr SaveObj(CAgAttr object, string filename, Where:
When applied to scenarios, SaveObj will change all internal paths to point to the new location of the scenario.
SaveObj() returns handle to the saved object. Example VBS: Dim sat sat = ODTK.SaveObj(scen.Sat1, "C:\tmp\Sat1.sao", true) Also see ExportObj. |
SaveObject |
This is deprecated. Use the SaveObj function instead. Prototype: bool SaveObject(string objectName, Where:
Example VBS: bSuccess = ODTK.SaveObject("Scen1.Sat1", "C:\tmp\Sat1.sao") |
SeparateSP3 |
This utility 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. T = G for GNSS, R for GLONASS, E for Galileo, J for QZSS, C for BeiDou Prototype: CAgAttr SeparateSP3(const string& inputSP3FileName) Inputs are: inputSP3FileName is the input SP3 filename. The returned object contains three properties: "Succeed" (CAgAttrBool) is true/false if successful or not. "Messages" (CAgAttrString) contains "Informational or Error messages" to be displayed in the status line. "FileNames" (CAgAttrList of CAgAttrStrings) identifies the output filenames. Example VBS: dim inputSP3FileName inputSP3FileName = "C:\Test\test.sp3" set ret = mach10.Application.SeparateSP3(inputSP3FileName) if ret.Succeed then set listFileNames = rec.FileNames else MsgBox restartRecord.Messages end if |
SetAsDefault |
This 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. Prototype: CAgAttr SetAsDefault(CAgAttr object) It returns the default object if successful or an error message if not. Example VBS: set result = ODTK.SetAsDefault (sc.Satellite(0)) |
SortUTDF |
This sorts a UTDF Measurement file into increasing time order. The output format will be in UTDF regardless of the extension provided. Prototype: bool SortUTDF(string inputFile, string outputFile) Where:
Example VBS: bResult = ODTK.SortUTDF("c:\trkData.trk","c:\trkData_sorted.trk") |
SP3ToSimrun |
This is a helper function to 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. Prototype: bool SP3ToSimrun(string SP3File, string constellationName, string outputFile)Where:
It returns a Boolean indicating success or failure. Example VBS: sp3Input = "C:\tmp\input.sp3" outputFile = "c:\tmp\gpsSource.simrun" bResult = ODTK.SP3toSimRun(sp3Input, "GNSS", outputFile) |
WriteMessage |
This 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. Prototype: bool WriteMessage(string message, string status) Where:
It returns a Boolean that is true if a message is written. Example VBS: ODTK.WriteMessage "Hello World", "error" odtk.writeMessage sc.Satellite(0).Name, "force" |