Skip to content

TSTool / Command / FillConstant


Overview

The FillConstant command fills the missing data in a time series with the specified value. This fill technique is useful for filling missing data with zeros, perhaps as the last step in a sequence of filling commands.

Command Editor

The command is available in the following TSTool menu:

  • Commands / Fill Time Series Missing Data

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

FillConstant command editor

FillConstant Command Editor (see full-size image)

Command Syntax

The command syntax is as follows:

FillConstant(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 Constant value to use when filling missing data. Can be specified with a processor ${Property}. None – must be specified.
FillStart Date/time indicating the start of filling, using a precision appropriate for the time series, or OutputStart. Can be specified with a processor ${Property}. Fill the entire time series.
FillEnd Date/time indicating the end of filling, using a precision appropriate for the time series, or OutputEnd. Can be specified with a processor ${Property}. Fill the entire time series.
FillFlag If specified, data flags will be enabled for the time series and each filled value will be tagged with the specified string. The flag can then be used later to label graphs, etc. The flag will be appended to existing flags if necessary. Can be specified with a processor ${Property}. No flag is assigned.
FillFlagDesc Description to use for the fill flag. The description is used in visual products such as reports and graphs. Can be specified with a processor ${Property}. No description is assigned to the fill flag.

Examples

See the automated tests.

A sample command file to fill a time series from the State of Colorado’s HydroBase database is as follows:

# 08236500 - ALAMOSA RIVER BELOW TERRACE RESERVOIR
08236500.DWR.Streamflow.Month~HydroBase
FillConstant(TSList=AllMatchingTSID,TSID="08236500.DWR.Streamflow.Month",
ConstantValue=500,FillStart="1970-02",FillEnd="1970-10",FillFlag="C")

Troubleshooting

See the main TSTool Troubleshooting documentation.

See Also