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 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

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>input</variableId>
      <timeSeriesSet>
         <moduleInstanceId>CountThresholdCrossingsTest</moduleInstanceId>
         <valueType>scalar</valueType>
         <parameterId>H.m</parameterId>
         <locationSetId>CountThresholdCrossingsInput</locationSetId>
         <timeSeriesType>external historical</timeSeriesType>
         <timeStep unit="hour"/>
         <relativeViewPeriod unit="hour" start="0" end="0"/>
         <readWriteMode>editing visible to all future task runs</readWriteMode>
      </timeSeriesSet>
   </variable>
   <variable>
      <variableId>output</variableId>
      <timeSeriesSet>
         <moduleInstanceId>CountThresholdCrossingsTest</moduleInstanceId>
         <valueType>scalar</valueType>
         <parameterId>H.m</parameterId>
         <locationSetId>CountThresholdCrossingsOutput</locationSetId>
         <timeSeriesType>external historical</timeSeriesType>
         <timeStep unit="hour"/>
         <relativeViewPeriod unit="day" start="0" end="0"/>
         <readWriteMode>editing visible to all future task runs</readWriteMode>
      </timeSeriesSet>
   </variable>
   <transformation id="InterpolationSpatialClosestDistanceIrregularGridToScalar">
      <statisticsSameAttributeValue>
         <countThresholdCrossings>
            <input>
               <variableId>input</variableId>
            </input>
            <matchingAttributeId>Matching</matchingAttributeId>
            <thresholdValueAttributeId>Threshold</thresholdValueAttributeId>
            <output>
               <variableId>output</variableId>
            </output>
         </countThresholdCrossings>
      </statisticsSameAttributeValue>
   </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>