Description and usage
This transformation function is used to calculate an output value based on a lookup table. This function uses 3 input variables to perform the lookup.
The output will be calculated by performing a lookup in a 3 data cube. The transformation supports interpolation, but not extrapolation. If a point in the data cube is missing, the transformation will attempt to calculate it from surrounding data points. If there are too many surrounding points missing, a missing value will be returned.
Input 1 | Input 2 | Input 3 | output |
---|---|---|---|
25 | 100 | 0.1 | 10 |
25 | 100 | 0.2 | 20 |
25 | 200 | 0.1 | 20 |
25 | 200 | 0.2 | 40 |
25 | 300 | 0.1 | 30 |
25 | 300 | 0.2 | 30 |
50 | 100 | 0.1 | 20 |
50 | 100 | 0.2 | 40 |
50 | 200 | 0.1 | 40 |
50 | 200 | 0.2 | 80 |
50 | 300 | 0.1 | 80 |
50 | 300 | 0.2 | 160 |
For a value of 25 for Input1, 200 for Input2 and 0.2 for Input3, it will return 40. For input values which are not exactly equal to the input values listed in the table the output has to be calculated. This function can determine the output linear interpolation. For a value of 25 for Input1, 150 for Input2 and 0.2 for Input3, it will return 30.
Each time series is assigned a variable ID which is used in the actual expression. For definition of input and output time series see transformation – inputs & outputs.
Only supports linear interpolation.
Configuration
A basic configuration of the function is described below. This describes the main elements and attributes required and provides an example configuration.
Input1
required element defining the identifier of the first input time series.
Input2
Required element defining the identifier of the second input time series.
Input23
Required element defining the identifier of the second input time series.
InterpolationType
Required element. Has to be linear.
extrapolationType
Required element , needs to be notAllowed .
output
Required element defining the identifier of the output time series. If more than one output is needed, a separate transformation needs to be set up for each output.
input1Unit, input2Unit, input3Unit, outputUnit,
Required element. Needs to contain the unit. The transformation supports unit conversion. If no conversion is configured, the input/out of the time series headers needs to be in the same unit as it is configured in the coefficientSet (see bellow).If they are not the same, and no conversion is configured, a warning will be logged, but unit conversion will not take place.
csvFile
Required element. File name of the data source. The decimal separator has to be a "." (like 91.7) , as "," (like 63,2) is not recognized. The CSV file needs to be placed in the MapLayerFiles folder.
input1Column, input2Column, input3Column, outputColumn
Required elements. These are the names of the columns in CSV file, which should be used for the transformation.
<?xml version="1.0" encoding="UTF-8"?> <!-- edited with XMLSpy v2007 sp2 (http://www.altova.com) by WL | Delft Hydraulics (WL | Delft Hydraulics) --> <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"> <!--4 variables (with any name) need to be configured to be used as inputs and output.--> <variable> <variableId>input1</variableId> <timeSeriesSet> <moduleInstanceId>ThreeDimensionalLookupFromCsvTest</moduleInstanceId> <valueType>scalar</valueType> <parameterId>H.m</parameterId> <locationId>H-2001</locationId> <timeSeriesType>external historical</timeSeriesType> <timeStep unit="nonequidistant"/> <relativeViewPeriod unit="day" start="-1" end="10"/> <readWriteMode>add originals</readWriteMode> </timeSeriesSet> </variable> <variable> <variableId>input2</variableId> <timeSeriesSet> <moduleInstanceId>ThreeDimensionalLookupFromCsvTest</moduleInstanceId> <valueType>scalar</valueType> <parameterId>H.obs</parameterId> <locationId>H-2001</locationId> <timeSeriesType>external historical</timeSeriesType> <timeStep unit="nonequidistant"/> <relativeViewPeriod unit="day" start="-1" end="10"/> <readWriteMode>add originals</readWriteMode> </timeSeriesSet> </variable> <variable> <variableId>input3</variableId> <timeSeriesSet> <moduleInstanceId>ThreeDimensionalLookupFromCsvTest</moduleInstanceId> <valueType>scalar</valueType> <parameterId>H.sim</parameterId> <locationId>H-2001</locationId> <timeSeriesType>external historical</timeSeriesType> <timeStep unit="nonequidistant"/> <relativeViewPeriod unit="day" start="-1" end="10"/> <readWriteMode>add originals</readWriteMode> </timeSeriesSet> </variable> <variable> <variableId>output</variableId> <timeSeriesSet> <moduleInstanceId>ThreeDimensionalLookupFromCsvTest</moduleInstanceId> <valueType>scalar</valueType> <parameterId>H.updated</parameterId> <locationId>H-2001</locationId> <timeSeriesType>external historical</timeSeriesType> <timeStep unit="nonequidistant"/> <relativeViewPeriod unit="day" start="-1" end="10"/> <readWriteMode>add originals</readWriteMode> </timeSeriesSet> </variable> <transformation id="3dLookupTest"> <lookup> <threeDimensionalLookup> <input1> <variableId>input1</variableId> </input1> <input2> <variableId>input2</variableId> </input2> <input3> <variableId>input3</variableId> </input3> <coefficientSet> <!--Only linear interpolation is supported--> <interpolationType>linear</interpolationType> <!--extrapolation is not supported--> <extrapolationType>notAllowed</extrapolationType> <input1Unit>m</input1Unit> <input2Unit>m</input2Unit> <input3Unit>m</input3Unit> <outputUnit>m</outputUnit> <!--Name of datafile, needs to be in MapLarFiles folder.--> <csvFile>lookup3d.csv</csvFile> <!--These are the names of the coluumns in CSV file, which should be used for the transformation--> <input1Column>Sea level</input1Column> <input2Column>Water height</input2Column> <input3Column>River water level</input3Column> <outputColumn>Simulated data</outputColumn> </coefficientSet> <output> <variableId>output</variableId> </output> </threeDimensionalLookup> </lookup> </transformation> </transformationModule>