Scripting > Math Functions


Sum Values in Time Series

sum(list of HecMath tsMathArray)

 

Add each of the time series in the parameter, tsMathArray, to the current time series. A new time series will be created which duplicates the time points of the current time series.  Where time points match for the current time series and each time series in tsMathArray, the values will be summed provided values for all time series are valid values (not missing).  Points in the current time series which cannot be matched to valid points in tsMathArray are set to missing.  Values in the current time series which are missing remain missing in the new time series.

 

The new time series will always have quality defined.  For a specific time, if any of the quality values in the current or parameter time series is questionable or rejected, the quality value for that time in the new time series will be set to the most severe quality for that time (e.g. if questionable and rejected are both encountered, the new quality will be set to rejected.)

 

Parameters: 

tsMathArray - the array of time series to be added to the current time series.

Example: tsData.sum(list of HecMath tsMathArray)

Returns:  a new time series representing the sum of the two time series