Input

  • inputVariable
  • shiftValuesVariable

Output

  • outputVariable

Description

This transformation shifts input time series in time using shifts defined in another time series. For each entry in the input variable, it looks for a value in the shiftValues variable that shared the same time. This value represents the amount of seconds the input value will be shifted. Example: Let's say the 3 variables all have a 1 second timestep and the first value for each variable is at the same time. The values are as follows: input [5, 3, 12, 2], timeshift [0, 1, 0, -2], output [ , , , ]. This is what the output variable would look like after processing the first element from the input variable: [5, , , ], after 2nd [5, , 3, ] after 3rd [5, , 12, ] and after 4th [5, 2, 12, ]. Please note the values defined in shiftValuesVariable are the unit of "second".

Configuration example

<?xml version="1.0" encoding="UTF-8"?>
<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>shiftVariable</variableId>
		<timeSeriesSet>
			<moduleInstanceId>HuangChuan_Update_Pre</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>Q.obs</parameterId>
			<locationId>dummy</locationId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="hour" multiplier="1"/>
			<relativeViewPeriod unit="day" start="-16" 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="-16" end="0"/>
			<readWriteMode>add originals</readWriteMode>
		</timeSeriesSet>
	</variable>
	<variable>
		<variableId>Qout</variableId>
		<timeSeriesSet>
			<moduleInstanceId>HuangChuan_Update_Pre</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>Q.u</parameterId>
			<locationSetId>HydroGauges_HuangChuan</locationSetId>
			<timeSeriesType>simulated historical</timeSeriesType>
			<timeStep unit="hour" multiplier="1"/>
			<relativeViewPeriod unit="day" start="-16" end="0"/>
			<readWriteMode>add originals</readWriteMode>
		</timeSeriesSet>
	</variable>
	<!--Transformations-->
	<transformation id="user">
		<user>
			<simple>
				<expression>3600</expression>
				<outputVariable>
					<variableId>shiftVariable</variableId>
				</outputVariable>
			</simple>
		</user>
	</transformation>
	<transformation id="timeShift-variable">
		<timeShift>
			<variable>
				<inputVariable>
					<variableId>Q_out</variableId>
				</inputVariable>
				<shiftValuesVariable>
					<variableId>shiftVariable</variableId>
				</shiftValuesVariable>
				<outputVariable>
					<variableId>Qout</variableId>
				</outputVariable>
			</variable>
		</timeShift>
	</transformation>
</transformationModule>

(the output was shifted 1 step (3600 seconds) from the input)

  • No labels