Description

This transformation creates cumulative curves from the input time series within several intervals. The intervals are defined by the specified intervalTimeStep. For a given interval the first output value equals the first input value within the interval and the other output values are equal to the sum of the corresponding input value and all previous input values within the interval. The startTime of an interval is exclusive and the endTime of an interval is inclusive. The output time series must have the same timeStep as the input time series. In case the transformation is from instantaneous/mean to accumulated, the result is multiplied by the timestep. The calculation starts at the first valid interval time step within the run period. Therefore the relative view period for the input and output variables must be large enough so that it contains at least one interval time step. The reset condition sets the curve during the calculation to zero when the cumulative value is positive or negative (depending on the condition selected)

Input

  • period (optional)
  • inputVariable
  • intervalTimeStep
  • resetCondition
  • ignoreMissing (optional)

period option can be used to configure the run period of the transformation

intervalTimeStep defines the intervals that are used for the accumulation. Each time in this time step is the boundary between two intervals. The calculation starts at the first valid interval time step within the run period. Therefore the relative view period for the input and output variables must be large enough so that it contains at least one interval time step.

resetCondition; during the calculation, if the cumulative value is either positive or negative (depending on condition chosen), it is set to zero. This zero value will then be used to base the next cumulative value on. i.e. If resetCondition is set to negative, the serie 4,-3,-3,1,2 would result in 4,1,0,1,3 and NOT 4,1,0,0,1

If ignoreMissing is true, then missing values are ignored and treated as 0. If false, then output values will be set to missing values starting from the first missing input value in an interval until the end of that interval. Default is true.

Output

  • outputVariable

Configuration example

<transformationModule version="1.0" xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/transformationModule.xsd">
	<!--Input time series-->
	<variable>
		<variableId>Q_in</variableId>
		<timeSeriesSet>
			<moduleInstanceId>ImportDatabase</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>Q.obs</parameterId>
			<locationSetId>HydroGauges_HuangChuan</locationSetId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="nonequidistant"/>
			<relativeViewPeriod unit="day" start="-5" end="0"/>
			<readWriteMode>add originals</readWriteMode>
		</timeSeriesSet>
	</variable>
	<!--Output time series-->
	<variable>
		<variableId>Q_temp</variableId>
		<timeSeriesSet>
			<moduleInstanceId>HuangChuan_Update_Pre</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>Q.obs</parameterId>
			<qualifierId>temp</qualifierId>
			<locationSetId>HydroGauges_HuangChuan</locationSetId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="hour" multiplier="1"/>
			<relativeViewPeriod unit="day" start="-5" end="0"/>
			<readWriteMode>add originals</readWriteMode>
		</timeSeriesSet>
	</variable>
	<variable>
		<variableId>Q_out</variableId>
		<timeSeriesSet>
			<moduleInstanceId>HuangChuan_Update_Pre</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>Q.obs</parameterId>
			<locationSetId>HydroGauges_HuangChuan</locationSetId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="hour" multiplier="1"/>
			<relativeViewPeriod unit="day" start="-5" end="0"/>
			<readWriteMode>add originals</readWriteMode>
		</timeSeriesSet>
	</variable>
	<!--Transformations-->
	<transformation id="nonequidistance to hourly: discharge">
		<sample>
			<nonEquidistant>
				<nonEquidistantInputVariable>
					<variableId>Q_in</variableId>
				</nonEquidistantInputVariable>
				<interpolationType>linear</interpolationType>
				<outputVariable>
					<variableId>Q_temp</variableId>
				</outputVariable>
			</nonEquidistant>
		</sample>
	</transformation>
	<transformation id="accumulation - sumIntervalWithResetCondition">
		<accumulation>
			<sumIntervalWithResetCondition>
				<inputVariable>
					<variableId>Q_temp</variableId>
				</inputVariable>
				<intervalTimeStep unit="hour" multiplier="6"/>
				<resetCondition>negative</resetCondition>
				<outputVariable>
					<variableId>Q_out</variableId>
				</outputVariable>
			</sumIntervalWithResetCondition>
		</accumulation>
	</transformation>
</transformationModule>

  • No labels