Skip to content

TSTool / Command / SetDataValue


Overview

The SetDataValue command sets a single data value in a time series. Consequently, it can be used to condition a value for subsequent filling (e.g., with FillRepeat) or to "hard-code" data that may not be available in files or databases. It is good practice to insert comments when editing data to explain the edits. See also the SetConstant command.

Command Editor

The following dialog is used to edit the command and illustrates the syntax of the command.

SetDataValue

SetDataValue Command Editor (see also the full-size image)

Command Syntax

The command syntax is as follows:

SetDataValue(Parameter="Value",...)

Command Parameters

Parameter            Description Default                           
TSList Indicates the list of time series to be processed, one of:
  • AllMatchingTSID – all time series that match the TSID (single TSID or TSID with wildcards) will be processed.
  • AllTS – all time series before the command.
  • EnsembleID – all time series in the ensemble will be processed (see the EnsembleID parameter).
  • FirstMatchingTSID – the first time series that matches the TSID (single TSID or TSID with wildcards) will be processed.
  • LastMatchingTSID – the last time series that matches the TSID (single TSID or TSID with wildcards) will be processed.
  • SelectedTS – the time series are those selected with the SelectTimeSeries command.
AllTS
TSID The time series identifier or alias for the time series to be processed, using the * wildcard character to match multiple time series. Can be specified using ${Property}. Required if TSList=*TSID
EnsembleID The ensemble to be processed, if processing an ensemble. Can be specified using ${Property}. Required if TSList=*EnsembleID
SetDateTime
required
The date/time at which the data value should be set. Specify the date/time precision according to the time series that is being manipulated. None – must be specified.
NewValue
required
The new data value. None – must be specified.

Examples

See the automated tests.

A sample command file to process data from the State of Colorado’s HydroBase database is as follows:

# 08235700 - ALAMOSA RIVER BELOW CASTLEMAN GULCH NEAR JASPER
08235700.DWR.Streamflow.Month~HydroBase
SetDataValue(TSList=AllMatchingTSID,TSID=”08235700.DWR.Streamflow.Month”,SetDateTime=”1950-01”,NewValue=550)

Troubleshooting

See Also