Generate a Regular Interval Time Series
generateRegularIntervalTimeSeries(string startTimeString,
string endTimeString,
string timeIntervalString,
string timeOffsetString,
floating-point initialValue )
Generate a new regular interval time series data set from scratch with times and values specified by the parameters. This is a function provided by the TimeSeriesMath module, and not an object method.
The parameters startTimeString and endTimeString are strings used to specify the beginning and ending time of the generated data set. These two parameters have the form of the standard HEC time string (e.g. "01JAN2001 0100").
The regular time interval is specified by timeIntervalString, and is a valid HEC time increment string (e.g. “1MIN”, “15MIN”, “1HOUR”, “6HOUR”, “1DAY”, “1MONTH”).
timeOffsetString is used to
shift times in the resultant time series from the standard interval time. As an
example, the offset could be used to shift times in regular hourly interval data from the
top of the hour to 6 minutes past the hour. The parameter has the form "nT”, where
"n" is an integer number and "T" is one of the time increments: "M(INUTES)”, "D(AYS)”,
"H(OUR)”, "W(EEKS)”, "MON(THS)" or "Y(EARS)" ( characters in the parenthesis are optional
). For example, a time offset of 9 minutes would be expressed as "9M" or "9MIN.”
Values in the time series data set are initialized to initialValue.
Parameters:
startTimeString - a string specifying a standard HEC time defining the time
series data start date/time.
endTimeString - a string specifying a standard HEC time defining the time
series data end date/time.
timeIntervalString - a string specifying a valid DSS regular time interval
which defines the time interval of the new time series.
timeOffsetString – a string specifying the offset of the new time points
from the regular interval time. This string may be an empty string or None.
initialValue –a floating-point number set to the initial value for all time
series points. Set to HecMath.UNDEFINED to set all values to missing.
Example:
newTsData =
TimeSeriesMath.generateRegularIntervalTimeSeries(
“01FEB2002 0100”,
“28FEB2002 2400”,
“1HOUR”,
“0M”,
100.)
Returns: A new regular interval TimeSeriesMath object initialized to initialValue. Data units and type are
unset.
Generated Exceptions: Throws a
hec.hecmath.HecMathException if time parameters cannot be successfully interpreted.