Description

This transformation can be used to determine the number of threshold crossings of a set of input time series at each time step separately and write that number to the output time series.

An attribute id must be configured which specifies the attribute of the input locations that contain the threshold value.

An attribute id must be configured which specifies the attribute that must have the same value to match input and output locations.

 

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

ID;THRESHOLD;MATCHING
Input1;1;Output1
Input2;2;Output2
Input2;2.4;Output2
Input3;3;Output1
Input3;3.6;Output1
Input3;3.8;Output2
Input4;4;Output1
Input4;4.1;Output1
Input4;4.4;Output2
Input4;4.5;Output2
InputX;5;X

 

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

<locationSet id="CountThresholdCrossingsInput">
   <csvFile>
      <file>CountThresholdCrossingsInput.csv</file>
      <id>%ID%</id>
      <x>%X%</x>
      <y>%Y%</y>
      <attributeFile>
         <csvFile>CountThresholdCrossingsInputMultivaluedAttributes.csv</csvFile>
         <id>%ID%</id>
         <attribute id="Matching">
            <text>%MATCHING%</text>
         </attribute>
         <attribute id="Threshold">
            <number>%THRESHOLD%</number>
         </attribute>
      </attributeFile>
   </csvFile>
</locationSet>
<locationSet id="CountThresholdCrossingsOutput">
   <csvFile>
      <file>CountThresholdCrossingsOutput.csv</file>
      <id>%ID%</id>
      <x>%X%</x>
      <y>%Y%</y>
      <attribute id="Matching">
         <text>%ID%</text>
      </attribute>
   </csvFile>
</locationSet>
  • No labels