Input

  • inputVariable
  • lookupVariable
  • loopupDirection

Output

  • outputVariable

Description

For a given time in the outputVariable series and inputVariable series (inputVariable and outputVariable must have the same times), this function searches for the nearest time (in forward, backward or both of these directions) in the lookupVariable series. The result is the difference between the nearest time found in the lookupVariable series and the time in the inputVariable series, rounded to seconds.

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>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="-16" end="0" startOverrulable="true"/>
			<readWriteMode>add originals</readWriteMode>
		</timeSeriesSet>
	</variable>
	<!--Output time series after disaggregration-->
	<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="timeShift-length">
		<timeShift>
			<length>
				<inputVariable>
					<variableId>Q_out</variableId>
				</inputVariable>
				<lookupVariable>
					<variableId>Q_in</variableId>
				</lookupVariable>
				<lookupDirection>any</lookupDirection>
				<outputVariable>
					<variableId>Qout</variableId>
				</outputVariable>
			</length>
		</timeShift>
	</transformation>
</transformationModule>

(top figure: inputVariable; bottom figure: lookupVariable; middle figure: outputVariable)

  • No labels