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 (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:
|
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. |
DescriptionSuffix |
Suffix to append to the time series description if any values were filled. Can be specified with a processor ${Property}. Specify as Auto to append the default suffix. |
No suffix is appended to the description. |
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.
Description Does Not Indicate Filling Information
Prior to TSTool 15.2.0, the time series description was automatically updated to indicate that the time series was filled with a constant. Although this was useful information, it caused descriptions to contain extra information that did not look nice in visual products like graph legends.
TSTool 15.2.0 changed the behavior of how the time series description is modified to use the DescriptionSuffix command parameter,
with the default being no suffix.
Specify the parameter as Auto to match the previous behavior.
The time series history continues to contain information about how the time series was filled. Use the time series properties view in TSTool to review the history.
See Also
SelectTimeSeriescommandSetConstantcommand