Skip to content

TSTool / Command / ShiftTimeByInterval


Overview

The ShiftTimeByInterval command shifts a time series in time. This command can be used to perform a simple shift (e.g., to shift hourly data because the Disaggregate command did not result in data being set at the desired hours) and to perform simple routing.

Command Editor

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

ShiftTimeByInterval

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

Command Syntax

The command syntax is as follows:

ShiftTimeByInterval(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
ShiftData Interval,multiplier tuples to apply to the data to perform the shift. All values should be separated by commas. An interval of -1 indicates that the previous time step should be shifted to the current time step. If the interval is –1 and the multiplier is 1, the previous time step is shifted to the current and multiplied by 1, effectively shifting the time series by one interval. None – at least 1 value,multiplier tuple must be specified.}

Examples

See the automated tests.

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

# 08213500 - RIO GRANDE RIVER AT THIRTY MILE BRIDGE NEAR CREEDE
08213500.DWR.Streamflow.Day~HydroBase
ShiftTimeByInterval(TSList=AllMatchingTSID,TSID="08213500.DWR.Streamflow.Day",ShiftData="-1,1")
08213500.DWR.Streamflow.Day~HydroBase

The following is the result.

ShiftTimeByInterval Graph

Results from ShiftTimeByInterval Command (see also the full-size image)

Troubleshooting

See Also