Relations

Input
  • inputVariableDefinition ( 1 or more input time series)
Options
  • period
  • limitVariable
Relation
  • validPeriod
  • expression
  • outputComment
Coefficients
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.

To write a missing value (NaN) in the expression, "0/0" should be used. Also note that an expression of "1/0" results in positive infinity, which is later replaced with NaN by the transformation module framework. However, "1/0" cannot be used in all cases to get an NaN value, since e.g. the expression "1 / (1/0)" gives 0 as a result, as expected. Also, "1/0" is later on replaced by a missing value, so for intermediate values it will still be considered as positive infinity. 

Configuration example
Merge Relations configuration example
<transformation id="testMergeRelations">
	<merge>
		<relations>
			<relation>
				<validPeriod>
					<season>
						<!--winter period-->
						<startMonthDay>--10-01</startMonthDay>
						<endMonthDay>--04-01</endMonthDay>
					</season>
				</validPeriod>
				<expression>Q1+Q2</expression>
				<outputComment>measurements A and B combined (winter)</outputComment>
			</relation>
			<relation>
				<validPeriod>
					<season>
						<!--summer period-->
						<startMonthDay>--04-01</startMonthDay>
						<endMonthDay>--10-01</endMonthDay>
					</season>
				</validPeriod>
				<expression>Q1+0.5*Q2</expression>
				<outputComment>measurements A and B combined (summer)</outputComment>
			</relation>
			<relation>
				<expression>2*Q1</expression>
				<outputComment>measurements A</outputComment>
			</relation>
			<relation>
				<expression>2*Q2</expression>
				<outputComment>measurements B</outputComment>
			</relation>
			<outputVariable>
				<variableId>Q3</variableId>
			</outputVariable>
		</relations>
	</merge>
</transformation>
  • No labels