Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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 lower bounds 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. 


This transformation differs from Multi variate threshold transformation by using a location set for each line in the csv where the rules are defined.

This way

- each line applies to multiple locations at once

- a minimum number of time series that need to apply to the rule can be configured 

- a specific attribute id for an attribute of the input locations containing the lower bound of the threshold can be configured

 

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

Code Block
languagexml
id;variable;inputLocationSetId;ruleId;numberOfTimeSeries;lowerBoundInputAttributeId;lowerBound;ruleOutcome
MultiVarHyFSOutput1;ForecastRain;MultiVarHyFSInput;rule0;1;thv0;-999;-1
MultiVarHyFSOutput1;ForecastRain;MultiVarHyFSInput;rule1;2;thv1;10;1
MultiVarHyFSOutput1;ObservedRain;MultiVarHyFSInput;rule2;2;thv2;10;2
MultiVarHyFSOutput1;ObservedFlooding;MultiVarHyFSInput;rule3;2;thv3;10;3
MultiVarHyFSOutput1;ForecastRain;MultiVarHyFSInput;rule4;2;thv4;20;4
MultiVarHyFSOutput1;ForecastRain;MultiVarHyFSInput;rule5;2;thv5a;20;5
MultiVarHyFSOutput1;ObservedRain;MultiVarHyFSInput;rule5;2;thv5b;10;5
MultiVarHyFSOutput1;ForecastRain;MultiVarHyFSInput;rule6;2;thv6a;20;6
MultiVarHyFSOutput1;ObservedFlooding;MultiVarHyFSInput;rule6;2;thv6b;10;6
MultiVarHyFSOutput1;ObservedRain;MultiVarHyFSInput;rule7;2;thv7;20;7
MultiVarHyFSOutput1;ObservedRain;MultiVarHyFSInput;rule8;2;thv8a;20;8
MultiVarHyFSOutput1;ObservedFlooding;MultiVarHyFSInput;rule8;2;thv8b;10;8
MultiVarHyFSOutput1;ObservedFlooding;MultiVarHyFSInput;rule9;2;thv9;20;9

 

Below an example of a module config file which defines the transformation

Code Block
languagexml
<?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>ForecastRain</variableId>
		<timeSeriesSet>
			<moduleInstanceId>ImportMultiVariateInput</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>P.radar.forecast</parameterId>
			<locationId>MultiVarHyFSInput1</locationId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="day"/>
			<relativeViewPeriod unit="day" start="-6" end="0"/>
			<readWriteMode>editing visible to all future task runs</readWriteMode>
		</timeSeriesSet>
	</variable>
	<variable>
		<variableId>ObservedRain</variableId>
		<timeSeriesSet>
			<moduleInstanceId>ImportMultiVariateInput</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>P.obs</parameterId>
			<locationId>MultiVarHyFSInput1</locationId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="day"/>
			<relativeViewPeriod unit="day" start="-6" end="0"/>
			<readWriteMode>editing visible to all future task runs</readWriteMode>
		</timeSeriesSet>
	</variable>
	<variable>
		<variableId>ObservedFlooding</variableId>
		<timeSeriesSet>
			<moduleInstanceId>ImportMultiVariateInput</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>H.obs</parameterId>
			<locationId>MultiVarHyFSInput1</locationId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="day"/>
			<relativeViewPeriod unit="day" start="-6" end="0"/>
			<readWriteMode>editing visible to all future task runs</readWriteMode>
		</timeSeriesSet>
	</variable>
	<variable>
		<variableId>output</variableId>
		<timeSeriesSet>
			<moduleInstanceId>MultiVariateThresholdsTransformation</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>H.sim</parameterId>
			<locationId>MultiVarHyFSOutput1</locationId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="day"/>
			<relativeViewPeriod unit="day" start="-6" end="0"/>
			<readWriteMode>editing visible to all future task runs</readWriteMode>
		</timeSeriesSet>
	</variable>
	<transformation id="MultiVariateHyFS">
		<multipleLocationAttributes>
			<inputLocationSetsBasedMultivariateThresholds>
				<ruleAttributeId>ruleId</ruleAttributeId>
				<inputVariableAttributeId>variable</inputVariableAttributeId>
				<inputLocationSetIdAttributeId>inputLocationSetId</inputLocationSetIdAttributeId>
				<inputLocationLowerBoundReferringAttributeId>lowerBoundInputAttributeId</inputLocationLowerBoundReferringAttributeId>
				<numberOfTimeSeriesWithinBoundariesAttributeId>numberOfTimeSeries</numberOfTimeSeriesWithinBoundariesAttributeId>
				<ruleOutcomeAttributeId>ruleOutcome</ruleOutcomeAttributeId>
				<outputVariable>
					<variableId>output</variableId>
				</outputVariable>
			</inputLocationSetsBasedMultivariateThresholds>
		</multipleLocationAttributes>
	</transformation>
</transformationModule>

 

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

Code Block
languagexml

	<locationSet id="MultiVariateThresholdsHyFS">
		<csvFile>
			<file>MultiVariateThresholdsHyFS.csv</file>
			<id>%id%</id>
			<x>%x%</x>
			<y>%y%</y>
			<attribute id="thv0">
				<number>%thv0%</number>
			</attribute>
			<attribute id="thv1">
				<number>%thv1%</number>
			</attribute>
			<attribute id="thv2">
				<number>%thv2%</number>
			</attribute>
			<attribute id="thv3">
				<number>%thv3%</number>
			</attribute>
			<attribute id="thv4">
				<number>%thv4%</number>
			</attribute>
			<attribute id="thv5a">
				<number>%thv5a%</number>
			</attribute>
			<attribute id="thv5b">
				<number>%thv5b%</number>
			</attribute>
			<attribute id="thv6a">
				<number>%thv6a%</number>
			</attribute>
			<attribute id="thv6b">
				<number>%thv6b%</number>
			</attribute>
			<attribute id="thv7">
				<number>%thv7%</number>
			</attribute>
			<attribute id="thv8a">
				<number>%thv8a%</number>
			</attribute>
			<attribute id="thv8b">
				<number>%thv8b%</number>
			</attribute>
			<attribute id="thv9">
				<number>%thv9%</number>
			</attribute>
			<attributeFile>
				<csvFile>MultiVariateThresholdsAttributesHyFS.csv</csvFile>
				<id>%id%</id>
				<attribute id="inputLocationSetId">
					<text>%inputLocationSetId%</text>
				</attribute>
				<attribute id="variable">
					<text>%variable%</text>
				</attribute>
				<attribute id="ruleId">
					<text>%ruleId%</text>
				</attribute>
				<attribute id="lowerBoundInputAttributeId">
					<text>%lowerBoundInputAttributeId%</text>
				</attribute>
				<attribute id="lowerBound">
					<number>%lowerBound%</number>
				</attribute>
				<attribute id="ruleOutcome">
					<number>%ruleOutcome%</number>
				</attribute>
				<attribute id="numberOfTimeSeries">
					<number>%numberOfTimeSeries%</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:

Code Block
languagexml
<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>