Skip to content

TSTool / Command / Scale


Overview

The Scale command scales each non-missing value in the specified time series. The value to use for scaling can be specified as a constant, monthly values, or special values that indicate to scale by the number of days in the month.

Command Editor

The command is available in the following TSTool menu:

  • Commands / Manipulate Time Series

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

Scale command editor

Scale Command Editor (see full-size image)

Command Syntax

The command syntax is as follows:

Scale(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
ScaleValue One of the following:
  • The numerical value to scale to the time series.
  • DaysInMonth to indicate a scale of the number of days in the month.
  • DaysInMonthInverse to indicate a scale of the inverse of the number of days in the month.

Can be specified with processor ${Property}.
MonthValues Monthly scale values, the fist being for January. Can be specified using processor ${Property}. Use ScaleValue.
AnalysisStart The date/time to start analyzing data. Can be specified using processor ${Property}. Full period is analyzed.
AnalysisEnd The date/time to end analyzing data. Can be specified using processor ${Property}. Full period is analyzed.
NewUnits New data units for the resulting time series. Can be specified using processor ${Property}. Do not change the units.

Examples

See the automated tests.

The following example scales a precipitation time series from the State of Colorado’s HydroBase database by a factor of 3.5:

# 1458 - CENTER 4 SSW
1458.NOAA.Precip.Month~HydroBase
Scale(TSList=AllMatchingTSID,TSID="1458.NOAA.Precip.Month",ScaleValue=3.5)

The following example scales a monthly streamflow time series with units of ACFT (volume per month) in order to convert the data to average CFS flow values (note that two scale commands are required because the DaysInMonthInverse value cannot currently be combined with a numerical value in one command). See also the ConvertDataUnits command for simple units conversions.

# 06754000 - SOUTH PLATTE RIVER NEAR KERSEY
06754000.DWR.Streamflow.Month~HydroBase
Scale(TSList=AllMatchingTSID,TSID="06754000.DWR.Streamflow.Month",ScaleValue=.5042)
Scale(TSList=AllMatchingTSID,TSID="06754000.DWR.Streamflow.Month",ScaleValue=DaysInMonthInverse,NewUnits="CFS")
06754000.DWR.Streamflow.Month~HydroBase

Troubleshooting

See the main TSTool Troubleshooting documentation.

See Also