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(
        string sInFile1,
        string sInFile2,
        string sOutFile)

Where:

  • sInFile1 is the first input filename.
  • sInFile2 is the second input filename.
  • sOutFile is the output filename.

The returned object contains two members:

  • Messages is a status message string.
  • Succeed is a Boolean indicating success or not.

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:

  • parentName is the name of the parent object. Use an empty string when creating a scenario.
  • className is the type of object to add.
  • objectName is the desired name of the new object.

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,
        string referenceFile,
        string targetFile,
        bool bLastMeasOnly,
        string startTime, string stopTime,
        bool bSaveCrossCorrelations)

Where:

  • outputFile is the resultant difference file (.difrun).
  • referenceFile is one input filename (.filrun, etc).
  • targetFile is the other input filename (.filrun, etc).
  • bLastMeasOnly limits output to one point per measurement time, as opposed to multiple differences at duplicate measurement times.
  • startTime is a date/time string in UTCG; an empty string will use the file start time by default.
  • stopTime is a date/time string in UTCG; an empty string will use the file stop time by default.
  • bSaveCrossCorrelations will toggle the writing of the entire covariance matrix to the output file.Turning this off will reduce the size of the output file.

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:

  • ephemFile is the satellite ephemeris file.
  • outputFile will contain the NavSol data.
  • options is an optional string containing a receiver ID and the time precision specification:
    • /recID = GNSS Receiver ID (default = 800)
    • /prec = time precision (default = 0.001 sec)

The returned object has the following members:

  • StartTime is a string showing the start time of the file.
  • StopTime is a string showing the stop time of the file.
  • Succeed is a Boolean indicating success or not.

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:

  • parent is the parent object.
  • className is the type of object to add.
  • objectName is the name of the new object.

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:

  • inputSP3 is the SP3 file filename.
  • outputTxt is the desired output filename.

 

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,
        bool bSaveChildren)

Where:

  • object is the object to be saved.
  • filename is the output file to be saved.
  • bSaveChildren is a Boolean specifying whether or not to save the child objects as well.

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(
        string outputFile, string satName,
        string trkName, double gap, double pad,
        string options)

Where:

  • outputFile is the desired interval filename (*.int).
  • satName will cause the function to only write those intervals relating to that satellite, and as a result, the satellite names will not show up in the interval file. An empty string will cause intervals for any satellite to show up, and the associated satellite name will be appended as additional data for each interval.
  • trkName causes the same behavior as satName except regarding facilities.
  • gap (seconds) is the minimum gap that defines a pass of data, which defines when one interval starts and the next ends. If this value is less than the measurement granularity, there will be one interval written per measurement, so make sure this value is large enough to be realistic. For instance, if you have measurements every minute and then a data gap of 40 minutes before the next set of measurements, setting gap to be anywhere from 2-30 minutes will be sufficient.
  • pad (seconds) enables you to expand the interval start and stop times.
  • options is a string which is not used.

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,
        string primarySat, string outputFile,
        bool inclCov, string covType, string coordFrame, string sOptions)
        bool includeCorr, string targetName,
        string startTime, string stopTime)

Where:

  • referenceFile is the run file to extract ephemeris from.
  • primarySat is the name of the satellite or surface vehicle object in the file.
  • outputFile is the desired output ephemeris file name.
  • inclCov controls whether or not covariance is output.
  • covType controls whether the function saves the velocity covariance; the choices are:
    • "Position 3x3 Covariance"
    • "Position Velocity 6x6 Covariance"
  • coordFrame defines the output coordinate frame — "ICRF", "Fixed", etc. Choices depend on the central body. See Satellite.EphemerisGeneration.CoordFrame. If the selected output coordinate frame is not the run file default central body frame, then you must load a scenario object to define the central body orientation parameters necessary for the coordinate frame transformation.

Optional parameters are as follows and consist of a keyword followed by a value string:

  • includeCorr says whether to include correlations in the relative covariance, e.g., /includeCorr "TRUE".
  • targetName is the name of another satellite, surface vehicle, or central body (e.g., /targetName "Sat2") that causes the covariance to be calculated as relative to this satellite, surface vehicle, or central body.
  • startTime is the start time in UTCG units, e.g., /startTime "01 Jul 2012 00:00:00". For an empty string, the function will use the file start time.
  • stopTime is the stop time in UTCG units, e.g., /stopTime "02 Jul 2012 00:00:00". For an empty string, the function will use the file stop time.

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 (
        string referenceFile, string outputFile,
        bool inclCov, string startTime, string stopTime)

Where:

  • referenceFile is the run file to extract global atmospheric density corrections from.
  • outputFile is the desired output filename (*.gdc).
  • inclCov controls whether or not covariance is included in the output.
  • startTime is the start time in UTCG units, e.g., /startTime "01 Jul 2012 00:00:00". For an empty string, the function will use the file start time.
  • stopTime is the stop time in UTCG units, e.g., /stopTime "02 Jul 2012 00:00:00". For an empty string, the function will use the file stop time.

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:

  • filename is the input file name: a .filrun, .smtrun, or .simrun file.

Optional parameters are as follows:

  • /output "filename" is the desired output file name, e.g., /output "c:\myFile.txt".
  • /startTime "startTime" is the start UTC time string, e.g., /startTime "03 Jan 2009 00:12:11.5".
  • /stopTime "stopTime" is the stop UTC time string, e.g., /stopTime "03 Jan 2009 11:15:21.00".
  • /step "timeStep" is the step size between outputs in seconds, e.g., /step "120".
  • /coordType "CoordType" defines the types of coordinates to report, either "Equinoctial", "Cartesian", "Keplerian", or "Spherical".
  • /coordSys "CoordSys" defines the coordinate system used to report orbital elements, either "ICRF", "J2000", "Fixed", "Inertial", "TrueOfDate", "MeanOfDate", "TEMEOfDate", or for multiple central bodies within one file, this has the form CBname:CoordSys; as in "Earth:J2000;Moon:Inertial;Sun:ICRF".
  • /covType "CovType" defines what form the output covariance will take, with choices of "Cartesian," "Gaussian," and "Frenet".
  • /covMethod "CovMethod" defines whether the output covariance is rotated or projected, with options "Rotated" or "Projected".
  • /covOutput "CovOutput" defines whether the output covariance is a full covariance or a sigma-correlation matrix, and is "Cov", "SigCor", or "Both".
  • /covReporting "CovReporting" defines the format of the output covariance structure, and can be "UpperTriangular", "LowerTriangular", or "FullMatrix".
  • /data "Data" defines which type of data to place in the output file.
    • This is a four-digit value determining which data is included. A value of 1 means "included," and a value of 0 means "not included."
      • The first (leftmost) digit determines if Satellite Orbits are included.
      • The second digit determines if Satellite Force Model parameters are included.
      • The third digit determines if Measurement Biases are included.
      • The fourth digit determines if Station Locations are included.
    • As an example, if you want Satellite Orbits and Force Model Parameters in the report, and only those values, set: /data "1100"
    • If you specify neither /data nor flexData, the function returns all data by default.
    • If you provide the flexData parameter, the function ignores the /data parameter.
  • flexData "FlexData" defines a list of states and covariances to place in the output file.
    • flexData must be a comma-separated list of states, followed by a semicolon and then a comma-separated list of covariances. If there are no covariances, you must still include the break.
    • An example is flexData "Satellite1.Orbit,Satellite2.Orbit;Satellite1.Orbit,Tracker1.TimeBias".
    • You can determine a list of possible states, and whether covariance data exists, by calling GetStateHistoryFileContents using the run file under consideration.

The returned object contains three members:

  • Succeedis a Boolean indicating success or not.
  • OutputFile is a string showing the output filename.
  • Messages is a string showing errors or other status.

Notes:

  • If you do not specify an output file, the function will create one using a .txt extension in the same directory as the input file.
  • If you do not specify a start or stop time, the function will dump the entire file contents.
  • If you specify a start time without the stop time, the function will only dump data at that single time.

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:

  • filename is the input file name: a *.filrun, *.smtrun, *.lstrun, or *.smtrun file.

The returned object contains three members:

  • ProcessMsg is a string showing errors or other status.
  • ResultMsg is a string showing the contents of the state history file.
  • Succeed is a Boolean indicating success or not.

The ResultsMsg has up to three different portions to its string, but they always appear in the same order:

  • \hasCov is at the beginning of the string if the state history file has covariance information. If it does not, this flag is absent from the string.
  • \satPosStates precedes a comma-delimited list of all satellites that have orbit position states.
  • \states precedes a comma-delimited list of all other states.

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:

  • filename is the input file name, including the file extension.
  • selectionString is the state and covariance selection, formatted as required for the flexData parameter of the ExtractStateHistory attribute.

The returned object contains two members:

  • ProcessMsgis a string showing errors or other status.
  • Succeed is a Boolean indicating success.

 

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:

  • filename is the input filename, including the file extension.

The returned object contains three members:

  • SelectionString is a string contained by the file, representing selected states and covariances.
  • ProcessMsg is a string showing errors or other status.
  • Succeed is a Boolean indicating success or not.

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:

  • outputMeasFile is the name of the output file (type: gobs).
  • timeTolerance is the allowed time difference, in seconds, between time tags for obs to be considered simultaneous.
  • modelTimeTagDifferences controls whether or not the function models the time tag differences during measurement processing.

The returned Boolean indicates success or not.

 

Example VBS

outputFile = "C\od_6.0\TrackingData\DeltaOptical.gobs"
timeTol = 0.01

ODTK.GenerateDeltaRADec outputFile, timeTol, true
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:

  • startDateGregTDT is the desired start of the output file expressed in Gregorian format and interpreted as being in the TDT (TT) time scale. It should be at zero hours of the start day.
  • stopDateGregTDT is the desired end of the output file expressed in Gregorian format and interpreted as being in the TDT (TT) time scale. It should be at zero hours of the final day.
  • algorithm indicates the version of the ICRF theory you want to use. The options are “IAU2006” and “IAU2000A”.
  • outputDirectory is the directory where ODTK will write the output files. An execution of this method will generate two files (binary and ASCII) and name them appropriately to be recognized by STK and ODTK.

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:

  • inputFile is a .difrun file.
  • outputFile is the desired PAF file.
  • options is a string of options, described below.

Optional parameters are as follows:

  • /startTime "startTime" is the start GNSSG time string, e.g., /startTime "03 Jan 2009 00:12:11.5".
  • /stopTime "stopTime" is the stop GNSSG time string, e.g., /stopTime "03 Jan 2009 11:15:21.00".
  • /step "timeStep" is the step size between outputs in seconds, e.g., /step "900".
  • /source "source" is the source string for the header, e.g., /source "GOCGIS".
  • /class "className" tells the function to get Satellite objects, rather than GNSSSatellite objects, in ODTK. An example is /class "Satellite".

The returned object contains three members:

  • Succeedis a Boolean indicating success or not.
  • OutputFilename is a string showing the output filename.
  • Messages is a string showing errors or other status.

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,
        string outputFile, string options)

Where:

  • inputFile is a .filrun or .simrun file.
  • outputFile is the desired PSF file.
  • options is a string of options, described below.

Optional parameters are as follows:

  • /startTime "startTime" is the start GNSSG time string, e.g., /startTime "03 Jan 2009 00:12:11.5".
  • /stopTime "stopTime" is the stop GNSSG time string, e.g., /stopTime "03 Jan 2009 11:15:21.00".
  • /step "timeStep" is the sampling interval in seconds, e.g., /step "900".
  • /source "source" is the source string for the header, e.g., /source "GOCGIS".

The returned object contains three members:

  • Succeed is a Boolean indicating success or not.
  • OutputFilename is a string showing the output filename.
  • Messages is a string showing errors or other status.

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(
        string inputs)

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:

  • filename is the input file name: .filrun, .smtrun, or .simrun file.

Optional parameters are as follows:

  • /output "filename" is the desired output file name, e.g., /output "c:\myFile.sp3".
  • /startTime "startTime" is the start GNSSG time string, e.g., /startTime "03 Jan 2009 00:00:00".
  • /stopTime "stopTime" is the stop GNSSG time string, e.g., /stopTime "03 Jan 2009 11:15:00.00".
  • /step "timeStep" is the step size between outputs in seconds, e.g., /step "120".

The returned object contains three members:

  • Succeed is a Boolean indicating success or not.
  • OutputFilename is a string showing the output filename.
  • Messages is a string showing errors or other status.

Notes:

  • If you do not specify an output file, the function will create one using an .sp3 extension in the same directory as the input file.
  • If you do not specify a start or stop time, the function will dump the entire file contents.
  • If you specify a start time without the stop time, the function will only dump data at that single time.
  • The output file will follow the SP3a format only if it includes GPS satellites. If it includes satellites from another GNSS system, the output file will follow the SP3c format.

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,
        string startTime, string stopEntry,
        double step, double convergence,
        int maxIterations, string idString,
        string TLEFile, string reportName, string SGP4ModuleName, bool UseSGP4XPOption)

Where:

  • ephemFile is the input ephemeris (*.e) file name.
  • startTime is the TLE epoch in UTCG.
  • stopEntry combines the stop method and value using the formula "Method+Value".
  • step defines how often to sample the ephemeris; a value of 0 tells the function to use all the available points in the file.
  • convergence is used when iterating for a solution.
  • maxIterations is the maximum number of iterations.
  • idString combines different identifier strings in the formula "revNum+elemNum+SSCNum+classification+internationalDesignation".
  • TLEFile is the output file containing the TLE.
  • reportName is an output file containing a summary report with residual information for each iteration.
  • SGP4ModuleName is an optional argument specifying the name of the SGP4 implementation to use. The default is "SGP4," and it is the only option unless you install SGP4 plugin modules.

  • UseSGP4XPOption is an optional argument that is only valid if you install the Air Force version 8 (or later) SGP4 plugin. The flag indicates whether or not to use the XP form of the SGP4 algorithm when generating TLEs.

The parameter stopEntry, which is a string of the form "Method+Value", has three choices for Method:

  • SPAN: Its value is the time span in minutes, e.g., "SPAN+120" will fit a 2-hour section of ephemeris.
  • REVS: Its value is an integer number of orbits, e.g., "REVS+3" will fit over three orbit periods.
  • TIME: Its value is the stop time string in UTCG.

The idString combines four values that are defined within a TLE:

  • revNum defines the pass number at the TLE epoch.
  • elemNum is an integer value set in the file.
  • SSCNum is the 5-digit identifier string.
  • classification is a string with "U" meaning unclassified.
  • intlDesig is the international designation string.

The returned object contains the following:

  • FitStartTime is a UTCG string.
  • FitStopTime is a UTCG string.
  • FinalRMS is a double showing final residual RMS.
  • ErrorMsg is a string showing final status or errors.
  • Succeed is a Boolean indicating success or not.

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:

  • Succeed is a Boolean indicating if file was read.
  • CBNames is a set of strings containing the central body names.

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:

  • Succeed is a Boolean indicating if file was read.
  • CoordSystems is a set of strings containing the coordinate system names.

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:

  • StartTime is a string containing the start time in UTCG.
  • StopTime is a string containing the stop time in UTCG.
  • Cov6x6 is a Boolean indicating if the file contains 6x6 (position/velocity) covariance.
  • Succeed is a Boolean indicating if file was read or not.

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:

  • referenceFile is the run file to extract ephemeris from.
  • primarySat is the name of the satellite object in the file.

The returned object contains five members:

  • Succeed is a Boolean indicating success or not.
  • CB is a string identifying the satellite central body.
  • DefaultCoordFrame is a string identifying the default coordinate frame for this satellite central body.
  • CoordFrameChoices is a list of strings identifiying the choices for coordinate frame selection.
  • Messages is a string showing errors or other status.

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:

  • outputFile will contain the new measurements. The file extension must support the output measurement type.
  • nPoints is the number of phase measurements to smooth.
  • minSNR is the signal to noise ratio threshold.
  • rng3DiffTest is the pseudo-range third-difference test value, where 0 implies there is no test.
  • phase3DiffTest is the phase third-difference test value, where 0 implies there is no test.

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:

  • source is "EPH", "TLE" "CCSDS" or "VCM".
  • filename is an ephemeris file (*.e | *.oem), TLE file, CCSDS OPM file, or VCM file.
  • options is used when source = "TLE" or "VCM".

When source = "TLE", the command may be:

  • an empty string ("") that will be used to provide a list of choices
  • "GEN" that will generate ephemeris in the *.e format

When source = "TLE", the options string may contain:

  • /ssc - This is the SSC number of the desired TLE, required for ephemeris generation.
  • /epoch - This is the epoch of the desired TLE in YYDDD.DDDDDDDD format. If omitted, the function uses the first TLE with a correct SSC number.
  • /start - This is the start time for ephemeris generation in Gregorian format. If omitted, the function uses the TLE epoch.
  • /duration - This is the time span for ephemeris generation, in minutes.
  • /step - This is the step size for ephemeris generation, in minutes.

When source = "VCM," the options string may contain:

  • /ssc - SSC number of desired VCM, required for ephemeris generation
  • /epoch - Epoch of desired VCM in UTCG, required for ephemeris generation

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:

  • DragCoeff is a double containing the Drag coefficient.
  • SRPCoeff is a double containing the SRP coefficient.
  • STKFile is an STK ephemeris file containing the VCM initial vector.
  • Succeed is a Boolean indicating success or failure of the operation.

If source is "EPH", the function returns an object with these members:

  • StartTime is a string containing the start time in UTCG.
  • StopTime is a string containing the stop time in UTCG.
  • Cov6x6 is a Boolean indicating the availability of a full 6x6 covariance in the ephemeris file.
  • CentralBody is a string containing the name of the central body in the file.
  • Succeed is a Boolean indicating success or failure of the operation.

If source is "TLE", the function returns an object with these members:

  • TLEOutput is a string containing the name of the file containing either the TLE choices or the ephemeris generated for a specific SSC.
  • Succeed is a Boolean indicating success or failure of the operation.

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:

  • StartTime is a string containing the start time in UTCG.
  • StopTime is a string containing the stop time in UTCG.
  • Cov6x6 is a Boolean indicating availability of a full 6x6 covariance in ephemeris file.
  • CentralBody is a string containing the name of the central body in the file.
  • Massis a double containing the mass of the satellite in kilograms.
  • DragCoeff is a double containing the drag coefficient.
  • DragArea is a double containing the drag area in square meters.
  • SRPCoeff is a double containing the SRP coefficient.
  • SRPArea is a double containing the SRP area in square meters.
  • STKFile is an STK ephemeris file containing the OPM initial vector.
  • Succeed is a Boolean indicating success or failure of the operation.

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:

  • date1 is a date object that is the time of the first position.
  • pos1 is the NewPositionVector object for the first position.
  • date2 is a date object for the second position.
  • pos2 is the NewPositionVector object for the second position.

It returns an object with these members:

  • nSol is the integer number of solutions found (0, 1, or 2).
  • Succeed is a Boolean that is false if there are no solutions.
  • ErrorMsg is a string containing an error message, or blank.
  • v11 contains the velocity components at time 1 for the first solution:
    • X: X velocity component (quantity)
    • Y: Y velocity component (quantity)
    • Z: Z velocity component (quantity)
  • v12 has the velocity components at time 2 for the first solution:
    • X: X velocity component (quantity)
    • Y: Y velocity component (quantity)
    • Z: Z velocity component (quantity)
  • v21 has the velocity components at time 1 for the second solution:
    • X: X velocity component (quantity)
    • Y: Y velocity component (quantity)
    • Z: Z velocity component (quantity)v
  • v22 has the velocity components at time 2 for the second solution:
    • X: X velocity component (quantity)
    • Y: Y velocity component (quantity)
    • Z: Z velocity component (quantity)

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:

  • objName is the parent of the object being loaded.
  • filename is the file containing the object being loaded.

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:

  • objName is the name of the parent object.
  • filename is the file containing the object being loaded.

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"
                    
Valid Date Formats
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,
        double z, string units)

The returned object has three members, which are quantities that are supposed to be position but have velocity units (so ignore the resulting units):

  • x: X position component
  • y: Y position component
  • z: Z position component

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,
        bool bSaveChildren)

Where:

  • object is the object to be saved.
  • filename is the output file to be saved.
  • bSaveChildren is a Boolean specifying whether or not to save the child objects as well.

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,
        string filename)

Where:

  • objectName is the attributed name of the object.
  • filename is the output file to be saved.

Example VBS:

bSuccess = ODTK.SaveObject("Scen1.Sat1", "C:\tmp\Sat1.sao")
                
SeparateSP3

Supports SeparateSP3 Utility.

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
<ext> is the input file extension (sp3)

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:

  • inputFile is the source of the UTDF data.
  • outputFile is the new UTDF file.

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:

  • SP3File is the input SP3 file to be converted.
  • constellationName is the name used to label objects in the simrun file, which should match whatever you intend to compare against.
  • outputFile is the file name for the new simrun file.

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:

  • message is the string to be written.
  • status is the category of the message and must be one of the following strings:
    • "debug" - a debug message
    • "forceinfo" or just "force" - an informational message
    • "warning" - a warning message
    • "error" or "alarm" - an error message

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"