Description

This transformation can be used to determine the threshold level for a certain location by using location attributes.

The location attributes define for each output location which time series should be used to determine the threshold level. Also the range for each threshold can be defined here.

An example is shown below. To configure a multi variate threshold transformation you must configure:

1) the attribute values in a csv-file,

2) the attribute definitions in the locationSets.xml file,

3) the transformation itself in module config file.

Below an example is shown of all the three components. 

 

Below an example of csv-file which defines the values of the attributes

id,inputVariable,inputLocationId,ruleId,lowerBound,upperBound,ruleOutcome
H4301,input1,H-2001,ruleA,1,10,1
H4301,input2,H-2002,ruleA,2,4,1
H4301,input1,H-2001,ruleB,10,20,2
H4301,input2,H-2002,ruleB,4,10,2
H4301,input1,H-2001,ruleC,20,30,3

 

Below an example of a module config file which defines 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">
   <variable>
      <variableId>input1</variableId>
      <timeSeriesSet>
         <moduleInstanceId>InputVariableFunctionTest</moduleInstanceId>
         <valueType>scalar</valueType>
         <parameterId>Q.obs</parameterId>
         <locationId>H-2001</locationId>
         <timeSeriesType>external historical</timeSeriesType>
         <timeStep unit="day"/>
         <relativeViewPeriod unit="day" start="0" end="10"/>
         <readWriteMode>editing visible to all future task runs</readWriteMode>
      </timeSeriesSet>
   </variable>
   <variable>
      <variableId>input2</variableId>
      <timeSeriesSet>
         <moduleInstanceId>InputVariableFunctionTest</moduleInstanceId>
         <valueType>scalar</valueType>
         <parameterId>Q.obs</parameterId>
         <locationId>H-2002</locationId>
         <timeSeriesType>external historical</timeSeriesType>
         <timeStep unit="day"/>
         <relativeViewPeriod unit="day" start="0" end="10"/>
         <readWriteMode>editing visible to all future task runs</readWriteMode>
      </timeSeriesSet>
   </variable>
   <variable>
      <variableId>output</variableId>
      <timeSeriesSet>
         <moduleInstanceId>InputVariableFunctionTest</moduleInstanceId>
         <valueType>scalar</valueType>
         <parameterId>Q.obs</parameterId>
         <locationId>H4301</locationId>
         <timeSeriesType>simulated forecasting</timeSeriesType>
         <timeStep unit="day"/>
         <relativeViewPeriod unit="day" start="0" end="10"/>
         <readWriteMode>editing visible to all future task runs</readWriteMode>
      </timeSeriesSet>
   </variable>
   <transformation id="test">
      <multipleLocationAttributes>
         <multipleVariateThresholds>
            <ruleId>ruleId</ruleId>
            <variableAttributeId>variable</variableAttributeId>
            <inputLocationAttributeId>inputLocationId</inputLocationAttributeId>
            <lowerBoundAttributeId>lowerBound</lowerBoundAttributeId>
            <upperBoundAttributeId>upperBound</upperBoundAttributeId>
            <ruleOutcomeAttributeId>ruleOutcome</ruleOutcomeAttributeId>
            <outputVariable>
               <variableId>output</variableId>
            </outputVariable>
         </multipleVariateThresholds>
      </multipleLocationAttributes>
   </transformation>
</transformationModule>

 

Below an example of the definition of a locationSet with attributes.

<locationSet id="example">
   <csvFile>
      <file>multi_variate_thresholds.csv</file>
      <id>%id%</id>
      <x>%x%</x>
      <y>%y%</y>
      <attributeFile>
         <csvFile>multi_variate_thresholds_attribute.csv</csvFile>
         <id>%id%</id>
         <attribute id="inputLocationId">
            <text>%inputLocationId%</text>
         </attribute>
         <attribute id="inputVariable">
            <text>%inputVariable%</text>
         </attribute>
         <attribute id="ruleId">
            <text>%ruleId%</text>
         </attribute>
         <attribute id="lowerBound">
            <number>%lowerBound%</number>
         </attribute>
         <attribute id="upperBound">
            <number>%upperBound%</number>
         </attribute>
         <attribute id="ruleOutcome">
            <number>%ruleOutcome%</number>
         </attribute>
      </attributeFile>
   </csvFile>
</locationSet>

 

In the example above the thresholds are defined for output location H4301. The variable defines the id of a variable in the transformation module.

A single variable can define a set of time series with 1 parameter but 1 or more locations. To select a unique time series in this set the input location id is used.

The ruleId defines for which rule the range applies. The lowerBound and upperBound define the range in which the time series defined by the variable and inputLocationId should be so that the

rule applies. If all the conditions which are defined for a certain rule are met then the rule applies and the value which is defined in the ruleOutcome will be written to the output time series.

Note that is technically possible to define multiple ruleOutcomes. The transformation will however always use the first value which is defined in the csv-file.

 

By default the lowerBound of the range is exclusive and the upper bound is inclusive. It is however possible to overrule the default for each range defined in the csv-file.

 

An example is given below:

<transformation id="test">
   <multipleLocationAttributes>
      <multipleVariateThresholds>
         <ruleId>ruleId</ruleId>
         <variableAttributeId>inputVariable</variableAttributeId>
         <inputLocationAttributeId>inputLocationId</inputLocationAttributeId>
         <lowerBoundAttributeId>lowerBound</lowerBoundAttributeId>
         <lowerBoundInclusiveAttributeId>lowerBoundInclusive</lowerBoundInclusiveAttributeId>
         <upperBoundAttributeId>upperBound</upperBoundAttributeId>
         <upperBoundInclusiveAttributeId>upperBoundInclusive</upperBoundInclusiveAttributeId>
         <ruleOutcomeAttributeId>ruleOutcome</ruleOutcomeAttributeId>
         <outputVariable>
            <variableId>output</variableId>
         </outputVariable>
      </multipleVariateThresholds>
   </multipleLocationAttributes>
</transformation>

 

 

 

 

 

 

 

  • No labels