Interpolate Time
Series Data at Regular Intervals
interpolateDataAtRegularInterval(string
timeIntervalString,
string timeOffsetString)
Derive a regular interval time series data set by interpolation of the current regular or irregular interval time series data set.
The new time interval is set by timeIntervalString which must be a valid HEC time interval string (e.g. “1MIN”, “15MIN”, “1HOUR”, “6HOUR”, “1DAY”, “1MONTH”).
Times in the resultant time series may be shifted (offset) from the regular interval
time by the increment specified by
timeOffsetString. As an example, the offset could be used to shift
times from the top of the hour to 6 minutes past the hour. If no offset is used
timeOffsetString should be an blank or empty string.
Whether the time series data type is “INST-VAL”, “INST-CUM”, “PER-AVE”, or “PER-CUM” controls how the interpolation is performed. Interpolated values are derived from “INST-VAL” or “INST-CUM” data using linear interpolation. Values are derived from “PER-AVE” data by computing the period average value over the time interval. Values are derived from “PER-CUM” data by computing the period cumulative value over the new time interval.
For example, if the original data set is hourly data and the new regular interval data set is to have a six hour time interval:
§ The value for “INST-VAL” or “INST-CUM” type data is computed from the linear interpolation of the hourly points bracketing the new six hour time point.
§ The value for “PER-AVE” type data is computed from the period average value over the six hour interval.
§ The value for “PER-CUM” type data is computed from the accumulated value over the six hour interval.
The treatment of missing value data is also dependent upon data type. Interpolated “INST-VAL” or “INST-CUM” points must be bracketed or coincident with valid (not missing) values in the original time series; otherwise the interpolated values are set as missing. Interpolated “PER-AVE” or “PER-CUM” data must contain all valid values over the interpolation interval; otherwise the interpolated value is set as missing.
Parameters:
timeIntervalString – A string specifying the regular time interval for the
resultant time series.
timeOffsetString – A string specifying the offset of the new time points
from the regular interval time. This variable may be an empty string (“ ”).
Example:
newTsData =
tsData.interpolateDataAtRegularInterval(
“15MIN”,
“ ”)