Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin


scrollbar

...

SelectDataSource

Input
  • inputVariableDefinition ( 1 or more input time series)
Options
  • period
  • limitVariable
Relation
  • validPeriod
  • expression
  • outputComment
Coefficients
  • attributeFunctionId
Output
  • outputVariable
Description

The MergeRelations transformation merges input data that is defined using one or more configured relations. Each relation contains a period for which it is valid and a free format expression that is used to determine the output value for that relation. If for a given time step the first relation produces a missing value, then the next relation is used. If that also produces a missing value, then the next relation is used, and so on, until a non-missing output value is found. The output time series contains for each time step the configured output comment of the relation that was used to determine the value for that time step. If all relations produce a missing value for a given time step, then the output for that time step is a missing value.

Configuration example

This transformation can be used to select an input time series from a set of input time series and copy that to the output time series. The selection will be done by using the attributeFunctionId.

The attributeFunctionId will reference the value of the attribute for the current output location. The value of this attribute will be matched against the variableId of the input timeseries. 

The following example will explain this in more detail. Lets say we are running this transformation for outputLocation outputA and attributeFunctionId is set to attributeA. In addition there are 2 input time series configured:inputA and inputB. InputA is referenced by variableId inputA and inputB is referenced by the variableId inputB. To determine which of two input time series will be copied to the output time series the transformation will first determine the value of attribute attributeA of outputLocation outputA. Lets assume that in our example the value is inputB. The transformation will then try to match the variable ids of the input time series against the value of the attribute attributeA. The value of the attribute is inputB which matches against the variable id of input time series B. The result will be in this case that input time series B will be copied to the output time series.

Configuration example
Code Block

<?xml version="1.0" encoding="UTF-8"?>
<transformationModule version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
					  xmlns="http://www.wldelft.nl/fews"
					  xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/transformationModule.xsd">
	<variable>
		<variableId>inputA</variableId>
		<timeSeriesSet>
			<moduleInstanceId>SelectLocationFunctionTest</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>H.m</parameterId>
			<locationSetId>MergeTest1</locationSetId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="day"/>
			<relativeViewPeriod unit="day" start="0" end="30"/>
			<readWriteMode>editing visible to all future task runs</readWriteMode>
		</timeSeriesSet>
	</variable>
	<variable>
		<variableId>inputB</variableId>
		<timeSeriesSet>
			<moduleInstanceId>SelectLocationFunctionTest</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>H.m</parameterId>
			<locationSetId>MergeTest2</locationSetId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="day"/>
			<relativeViewPeriod unit="day" start="0" end="30"/>
			<readWriteMode>editing visible to all future task runs</readWriteMode>
		</timeSeriesSet>
	</variable>
	<transformation id="example">
		<merge>
			<selectDataSource>
				<input>
					<variableId>inputA</variableId>
				</input>
				<input>
					<variableId>inputB</variableId>
				</input>
				<attributeFunctionId>@attributeA@</attributeFunctionId>
				<output>
					<timeSeriesSet>
						<moduleInstanceId>SelectLocationFunctionTest</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>Q.m</parameterId>
						<locationSetId>MergeTest2</locationSetId>
						<timeSeriesType>external historical</timeSeriesType>
						<timeStep unit="day"/>
						<relativeViewPeriod unit="day" start="0" end="30"/>
						<readWriteMode>add originals</readWriteMode>
					</timeSeriesSet>
				</output>
			</selectDataSource>
		</merge>
	</transformation>
</transformationModule>

...