External Data File Format (*.txt)

An External Data file is an ASCII text file formatted for compatibility with STK that ends in a .txt extension. External Data files contain time ordered object data computed outside of STK. External data is loaded using the ExternalData Connect command's ReadFile {DataOption}.

External Data files, like other external file formats, must contain a version stamp. A version stamp indicates the version of STK software for which the file is formatted to be used. Files can be created in, and imported to, STK software versions consistent with the file version stamp or higher. The version stamp must be the first line in the External Data file. For example, a file created in and stamped with stk 4.0 could be imported into STK software version 4.0 through the most recent version.

External Data files also contain data groups and data elements to ensure that the data contained in the file can be read by STK. A DataGroup identifies a group of related quantities that will be specified on the same time grid. Individual values are specified using DataElements. A properly formatted External Data file can contain the following data group keywords.

DataGroup Keywords

DataGroup Keyword Required Description
BEGIN DataGroup
END DataGroup
Yes Sets off the beginning and end of the data group. A data group identifies a group of related quantities that will be specified on the same time grid. Individual quantities are identified in Begin/End DataElement blocks.
GroupName Yes The name of the data grouping. Used to set data through Connect and becomes the folder name in the ExternData data provider for reporting and graphing.

Example:

    GroupName My Data
NumberOfPoints Yes The number of time ordered entries in the data table.

Example:

    NumberOfPoints 3
BlockFactor No Memory is allocated as a whole number of blocks. Used to optimize performance of sending in data through Connect.

Example:

If you enter:
    BlockFactor 50
50 blocks of memory would be allocated for reading data.
ReferenceEpoch Yes Reference epoch for times in data table. Times are given as seconds past the reference epoch.

Example:

    ReferenceEpoch 1 Jan 2001 00:00:00.000000000

DataElement Keywords

Individual quantities are identified in Begin/End DataElement blocks. A DataElement block provides the description of a particular variable in the DataGroup.

DataElement Keyword Required Description
BEGIN DataElement
END DataElement
Yes Sets off the beginning and end of individual data elements. A data element separates individual quantities that are part of a data group.
Name Yes Name of the data element. Will appear as the data element name in the ExternData data provider for reporting and graphing.

Example:

    Name bippy
Dimension No Name of dimension of data element. Controls allowed units conversions. Specification of the dimension must precede the specification of units.

For a string data element, set the Dimension to char. Character data must be enclosed in quotes.

For a unitless data element, set Dimension to custom and set FileUnitAbbr to nothing.

For unitless, numeric data element, set the Dimension to custom (FileUnitAbbr is not needed in this case).

Example:

    Dimension DistanceUnit
FileUnitAbbr No Abbreviation of unit designation specifying the unit in which data is input. If the input dimension is a compound dimension (such as Rate), abbreviations can be supplied for each sub-dimension.

Example:

    FileUnitAbbr Km
InterpOrder No Order of Lagrange interpolation to be used to provide values at times not in table.

Example:

    InterpOrder 1

Data Specification

Time ordered data is specified in a Begin/End Data block.

Example:

    Begin Data
    0.00000000000000e+00 5.03930000000000e+04 3.34321000000000e-01 1000
    1.20000000000000e+02 4.84840000000000e+04 1.12210000000000e-01 2000
    2.40000000000000e+02 3.23230000000000e+04 3.32330000000000e-03 000
    End Data
A properly formatted External Data file might look like this sample file.