Skip to content

TSTool / Command / FillPattern


Overview

The FillPattern command fills missing data in a time series using historical averages based on a pattern file. For example, if May 1910 is missing and the pattern indicates that May 1910 is a WET month, then the average of all WET Mays is used to fill the time series. The pattern file indicates the WET/DRY/AVG patterns and the time series to be filled supplies data to compute averages, for use in filling. This feature is enabled for monthly data only. Averages are computed as described for the FillHistMonthAverage command. There is currently no way to limit the fill operation to a period (the entire time series is filled). The pattern file is created with the AnalyzePattern command and a saved file must be read with a ReadPatternFile command. See below for an example of a fill pattern file. One or more patterns can be included in each pattern file, similar to StateMod time series files (see the StateMod Input Type appendix). Multiple pattern files can be used, if appropriate.

#  Years Shown = Water Years
#  Missing monthly data filled by the Mixed Station Method, USGS 1989
#  Time series identifier         = 09034500.CRDSS_USGS.QME.MONTH.1
#  Description                    = COLORADO RIVER AT HOT SULPHUR SPRINGS, CO.
# -e-b----------eb------eb------eb------eb------eb------eb------eb------eb------eb------eb------eb------eb------eb--------e
   10/1908  -      9/1996 ACFT  WYR
1909 09034500         AVG     AVG     AVG     WET     WET     AVG     AVG     AVG     WET     WET     WET     WET
1910 09034500         WET     WET     WET     WET     WET     WET     AVG     AVG     AVG     AVG     AVG     AVG
1911 09034500         AVG     AVG     WET     AVG     AVG     AVG     AVG     WET     WET     WET     AVG     WET
1912 09034500         WET     WET     WET     WET     WET     AVG     AVG     WET     WET     WET     WET     WET
...ommitted...

Command Editor

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

FillPattern

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

Command Syntax

The command syntax is as follows:

FillPattern(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
PatternID
required
The pattern identifier, matching a pattern read with ReadPatternFile commands. None – must be specified

Examples

See the automated tests.

A sample command file to process data from the State of Colorado’s StateMod model is as follows. The example fills all diversion time series with identifier starting with 30, using the pattern 09034500 (a stream gage for the region that was analyzed to determine patterns).

# Read StateMod time series to fill
ReadStateMod(InputFile="..\StateMod\sjm_prelim.ddh")
# Read the file containing the patterns
ReadPatternFile(PatternFile="fill.pat")
# Fill time series having identifiers that start with "30"
FillPattern(TSList=AllMatchingTSID,TSID="30*",PatternID="09034500")
# Write the results
WriteStateMod(TSList=AllTS,OutputFile="..\StateMod\sjm.ddh")

The above example fills all diversion time series with identifier starting with 30, using the pattern 09034500 (a stream gage for the region).

Troubleshooting

See Also