TSTool / Command / CreateFromList
See also the
ReadTimeSeriesList command, which may replace this command in the future.
CreateFromList command creates one or more time series using identifiers from a list file,
an example of which is shown below:
# Example list file. Comments start with the # character. # Column headings can be specified in the first non-comment row using quotes. “Structure ID”,”Structure Name” 500501,Ditch 501 500502,Ditch 502 # Invalid ID (see IfNotFound parameter) 509999,Ditch 9999
The command is typically used when reading time series from a database or binary file and can streamline processing in the following situations:
- A list of identifiers may have been generated from a database query and saved to a file.
- A list of identifiers may have been extracted from a model data set.
TSTool reads the list file and internally creates a list of time series identifiers. The time series are of the standard form:
where the brackets indicate optional information. TSTool then queries each time series, which can be processed further.
Although it is possible to specify an input type that reads from files by also using the
this is not generally recommended because the
CreateFromList command can only specify
one input file name and the file will be reopened for each read.
Instead, read commands for specific file formats should be used because these commands
are typically optimized to read multiple time series from the files.
In summary, the
CreateFromList command is useful with databases but performance may suffer when used with file input types.
The following dialog is used to edit the command and illustrates the syntax of the command.
CreateFromList Command Editor (see also the full-size image)
The command syntax is as follows:
|The name of the list file to read, surrounded by double quotes.||None – must be specified.|
||The column (1+) in the list file containing the location identifiers to use in time series identifiers.||
||The delimiter characters that separate columns in the list file. If a space is used as the delimiter, surround with another delimiter characters or a character that is unlikely to be found so that the space is not discarded as white space (e.g.,
||Indicate a pattern to filter the identifiers in the list file. For example, use
||Process all identifiers.|
||The data source in the time series identifier, appropriate for
||May or may not be required, depending on the input type. Refer to the input type appendices.|
||The data type in the time series identifier, as appropriate for
||Usually required for an input type. Refer to the input type appendices.|
|Data interval in the time series identifier, using standard values such as
||None – must be specified.|
||Scenario in the time series identifier.||Usually not required.|
|The input type in the time series identifier. For example, use
||None – must be specified.|
||The input name in the time series identifier.||Typically only required if the input type requires a file name.|
||Indicates how to handle missing time series, one of:
||Default units when
||Blank – no units.|
See the automated tests.
A sample command file to process diversion time series from the State of Colorado’s HydroBase database is as follows:
# Read monthly diversion total from HydroBase for the structures in the list # file. The data source is set to DWR because data source is saved in # HydroBase. CreateFromList(ListFile="Data\Diversions.txt",IDCol=1,DataSource=DWR, DataType=DivTotal,Interval=Month,InputType=HydroBase,IfNotFound=Default)