What

nameofinstance.xml

Description

Configuration for the transformation module

schema location

https://fewsdocs.deltares.nl/schemas/version1.0/transformationSets.xsd

Entry in ModuleDescriptors

<moduleDescriptor id="Transformation"> 
  <description>General Transformation Component</description>
  <className>nl.wldelft.fews.system.plugin.transformation.TransformationController</className>
</moduleDescriptor>


This module has reached its end-of-life (EOL) status. This means that there will be no active development of this module. Configurators are urged to use the new transformation module instead, see Transformation Module (Improved schema).

Transformation Module Configuration

The Transformation module is a general-purpose module that allows for generic transformation and manipulation of time series data. The module may be configured to provide for simple arithmetic manipulation, time interval transformation, shifting the series in time etc, as well as for applying specific hydro-meteorological transformation such as stage discharge relationships etc.

The Transformation module allows for the manipulation and transformation of one or more time series. The utility may be configured to provide for;

When available as configuration on the file system, the name of the XML file for configuring an instance of the transformation module called for example TransformHBV_Inputs may be:

TransformHBV_Inputs 1.00 default.xml

TransformHBV_Inputs

File name for the TransformHBV_Inputs configuration.

1.00

Version number

default

Flag to indicate the version is the default configuration (otherwise omitted).



 Figure 57 Root element of the Transformation module.

transformationSet

Root element for the definition of a transformation (processing an input to an output). Multiple entries may exist.

Attributes;


Figure 58 Elements of the definition of an input variable.

inputVariable

Definition of the input variables to be used in transformation. This may either be a time series set, a typical profile or a set of (harmonic) components. The InputVariable is assigned an ID. This ID is used later in the transformation functions as a reference to the data.

Attributes;

Available harmonic components are listed in the attached file.

timeSerieSet

Definition of an input variable as a time series set (see TimeSeriesSet definition).

timeStep

Time step for typical profile if variable to be defined as typical profile.

Attributes;

Relative view period of the typical profile to create. If this is defined and the time span indicated is longer than the typical profile data provided, then the profile data will be repeated until the required time span is filled. If the optional element is not provided then the typical profile data will be used only once.

data

Data entered to define the typical profile. Data can be entered in different ways. The typical profile can be defined as a series of values at the requested time step, inserted at the start of the series, or it can be mapped to specific time values (e.g. setting a profile value to hold at 03:15 of every day). Which of these is used depends on the attributes defined.

Attributes;

Optional specification of the time zone for the data entered (see timeZone specification).

timeZone:timeZoneOffset

The offset of the time zone with reference to UTC (equivalent to GMT). Entries should define the number of hours (or fraction of hours) offset. (e.g. +01:00)

timeZone:timeZoneName

Enumeration of supported time zones. See appendix B for list of supported time zones.

arithmeticFunction

Root element for defining a transformation as an arithmetic function (see next section for details).

hydroMeteoFunction

Root element for defining one of the available hydro-meteorological transformations.

ruleBasedTransformation

Root element for defining a rule based transformation (see next section for details on rules).
Attributes;

aggregate

Root element for defining a time aggregation transformation (rules are discussed below)
Attributes;

disaggregate

Root element for defining a time dis-aggregation transformation (rules are discussed below)
Attributes;

nonequidistantToEquidistant

Root element for defining transformation of an non-equidistant time series to an equidistant time series. (rules are discussed below)
Attributes;

Statistics

Root element for defining statistical transformations. 

Season: the statistics transformation can also be carried out for a specific season which is defined by a start and end date. If multiple seasons are specified, then the statistics transformation will be carried out separately for each specified season. A warning will be given when seasons overlap in time.

Function:

ArithmeticFunction & hydroMeteoFunction

Through definition of an arithmetic function, a user defined equation can be applied in transforming a set of input data to a set of output data. Any number of inputs may be defined, and used in the user defined function. Each input variable is identified by its Id, as this is used configuring the function. The function is written using general mathematical operators. A function parser is used in evaluating the functions (per time step) and returning results. These are again assigned to variables which can be linked to output time series through the variableId.

Rather than use a usedDefinedFunction, a special function can also be selected from a list of predefined hydroMeteoFunctions. When selected this will pose requirements on other settings.

Transformations may be applied in segments, with different functions or different parameters used for each segment. A segment is defined as being valid for a range of values, identified in one of the input variables (see example below).


Figure 59 Example of applying segments to a time series


Figure 60 Elements of the Arithmetic section of the transformation module configuration

segments

Root element for defining segments. When used this must include the input variable Id used to determine segments as an attribute.
Attributes;

functionType

Element used only when defining a predefined hydroMeteoFunction. Depending on selected function, specific requirements will hold for defining input variables and parameters. If a special function is selected then the user defined function element is not defined; Enumeration of available options is (the most important are discussed below);

userDefinedFunction

Optional specification of a user defined function to be evaluated using the function parser. Only the function need be defined, without the equality sign. The function is defined as a string and may contain Id's of inputSeries, names of variables and constants defined, and mathematical operators
Operators offered

h54 constant
Allows definition of a constant to be used in the function.

coefficient

Optional element to allow coefficients for use in the function to be defined. These coefficients are allocated and Id for later use in the function defined. For user defined functions specific coefficients need to be defined. Multiple entries may be defined.
Attributes;

tableColumnData

Definition of a table to use for transforming input variable to output variables.
Attributes;

tableColumnData:data

Element containing data for each row in the table
Attributes;

outputVariable

Id of the output variable from the function. This may be saved to the database by associating the Id to an outputVariable.

flag

Optional element to force saving the result data for the segment with a given flag. This may be used for example to force data from a segment as doubtful. Enumeration is either "unreliable" or "doubtful". if data is reliable the element should not be included.

Stage-Discharge and Discharge-Stage transformation

Stage discharge transformations can be defined using the simpleratingcurve option of the hydroMeteoFunctions. To apply this certain properties must be defined in each segment.

For stage-discharge transformation the requirements are;

Example:

For stage-discharge transformation the requirements are;

Example:

Establishing catchment average precipitation

Catchment average rainfall can be determined by weighting input precipitation time series. The weightedaverage option of the hydroMeteoFunctions can be applied to include the option of recalculation of weights if one of the input locations is missing. To apply this certain properties must be defined in each segment.

For establishing catchment average precipitation the requirements are;

Example:

Aggregation, disaggregation and non-equidistant to equidistant

This set of transformations allows temporal aggregation and disaggregation of time series. The time step defined in the input variable and the output variable determine the howthe time steps are migrated. The configuration need only define the rule followed in aggregation/disaggregation. Aggregation and disaggregation can only be used to transform between equidistant time steps. A nonequidistant series can be transformed to an equidistant series using the appropriate element (see above).

Aggregation rules;

Disaggregation rules;


Rule based transformations

The set of rule based transformations is a library of specific data transformation functions. Configuration of the rule based transformation is the same as in the Arithmetic transformation. However, each rule may have specific requirements on the elements that need to be defined. Many parameters that affect the transformation will need to be defined as a coefficient, using the appropriate coefficientType definition.

The rule based transformations can be grouped into four main sections;

Selection of peak or low flow values

Selection of peaks and lows

Set of rules to allow selection of peaks and lows from an input time series.

Enumerations in the rule attribute of the ruleBasedTransformation element;

Requirements for definitions of peak selections using gaps to define independence are;

The following two coefficients are optional:

They default to 0.

Example:

<ruleBasedTransformation rule="selectpeakvalueswithincertaingap">
    <segments limitVariableId="X1">
        <segment>
            <coefficient coefficientId="a" coefficientType="gaplengthinsec" value="2700"/>
            <coefficient coefficientId="b" coefficientType="peaksbeforetimezero" value="3"/>
            <coefficient coefficientId="c" coefficientType="peaksaftertimezero" value="4"/>
            <coefficient coefficientId="d" coefficientType="totalnumberofpeaks" value="0"/>
            <coefficient coefficientId="e" coefficientType="skipjustbeforetimezero" value="2"/>
            <coefficient coefficientId="f" coefficientType="skipjustaftertimezero" value="2"/>
            <outputVariableId>Y1</outputVariableId>
        </segment>
    </segments>
</ruleBasedTransformation>

In this example:


Sampling values from equidistant time series

This section of the rule based transformation can be applied to sample items from an equidistant time series at the time values in a non-equidistant time series. This may be required when applying transformations to a non-equidistant time series. The values to add will first need to be resampled to the right time value. An example is when wind and wave information is required at the time of the tidal peaks for entry in a lookup table.

Enumerations in the rule attribute of the ruleBasedTransformation element;

Requirements for definitions of resampling equidistant time series are;


Data Hierarchy

This is a simple method to merge overlapping equidistant time series in a single equidistant series. Gaps in foremost (first) series will be filled with data of second series if a valid value is available at the current time step, otherwise the gap is filled with data from the third series and so on until no more time series are available. Only missing data values and unreliable values are filled. Doubtful values remain in the result series as doubtful.

Figure 61 Schematic example of merging series using data hierarchy.

In example above Series 1 is the most important time series, Series 2 has a lower hierarchy and series 3 has the lowest hierarchy. The resulting time series has values from all 3 series as shown in figure above.

Data hierarchy poses no specific requirements to variables defined. Only the Id of the output variable is of importance.

Creating time series from typical profiles

Typical profiles can be defined in the inputVariable as described above. To use a typical profile it must first be mapped to a dynamic time series. This can then be retrieved in a later configuration of a module for use.

Enumerations in the rule attribute of the ruleBasedTransformation element;

The first type of mapping is used when the typical profile has a concept of date/time (e.g. must be mapped to specific dates or time values). The second is used when only a series of data is given. The time series is then filled with the first data element given as the first time step of the relative view period to be created.

Typical profile mapping poses no specific requirements to variables defined. Only the Id of the output variable is of importance.

Max Gap Length

For linear tranformations, the maxGapLength rule can be used. This way, interpolation will only occur if values are apart by no more then the defined gap length.

When a time is defined for which a value should be interpolated, the TimeSpan between the two surrounding values (the one before and the one after) is compared to the defined maxGapLength TimeSpan. If the maxGapLength TimeSpan is equal or larger, a value for that time will be interpolated. In the other case, the value will not be calculated or set to missing.

outputVariable

Definition of the output variables to be written following transformation. See the inputVariable for the attributes and structure. The output variable can only be a TimeSeriesSet (typical profiles are only used as inputs). The OutputVariable is assigned an ID. This ID must be defined as the result of the transformation.