Skip to content

TSTool / Command / SetConstant


Overview

The SetConstant command sets the values of a time series to a single or monthly constant values.

Command Editor

The command is available in the following TSTool menu:

  • Commands / Set Time Series Contents

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

SetConstant command editor

SetConstant Command Editor (see full-size image)

Command Syntax

The command syntax is as follows:

SetConstant(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
ConstantValue The constant value to use as the data value. None – must be specified, or specify monthly values.
MonthValues Monthly values to use as the data values. Twelve values for January – December must be specified, separated by commas. * indicates to keep the original value. Blank or NaN indicates to set the value to missing. If the time series data interval is less than monthly, each date/time will be set for a specific month. None – must be specified, or specify a constant value.
SetStart The starting date/time for the data set. Can set using processor ${Property}. Set data for the full period.
SetEnd The ending date/time for the data set. Can set using processor ${Property}. Set data for the full period.

Examples

See the automated tests.

A sample command file to process a time series from the State of Colorado’s HydroBase database is as follows (only the early period is set to zero):

# 08235700 - ALAMOSA RIVER BELOW CASTLEMAN GULCH NEAR JASPER
08235700.DWR.Streamflow.Month~HydroBase
SetConstant(TSList=AllMatchingTSID,TSID="08235700.DWR.Streamflow.Month",ConstantValue=0,SetEnd="1950-01")

Troubleshooting

See the main TSTool Troubleshooting documentation.

See Also