Overwrites the flag of the output timeseries with one of the flags of the input variables according to the following rules: Input flag 'missing' or 'unreliable' turns  output flag 'doubtful' and 'reliable' into unreliable. Input flag 'doubtful' turns output flag 'reliable' into 'doubtful'. The comparison can be for different parameters at one location or per location of a locationSet, or for one parameter at two locations or at one location and the locations of a location set, or between multiple equal location sets.

Contents of check for flagsComparisonCheck
  • id: identifier of the check.
  • variableDefinition: embedded variable definition (see above).
  • inputVariableId: One or more identifiers for variables of which the flags have to be used.
  • outputVariableId: One or more identifiers for variables for which the flags have to be modified.
  • outputMode: When this option is set to logs_only, the flags will not be updated but the log events will be generated.
  • logLevel: Log level for the log message that is logged if a time series does not pass the check. Can be DEBUG, INFO, WARN, ERROR or FATAL. If level is error or fatal, then the module will stop running after logging the first log message. Fatal should never be used actually.
  • logEventCode: Event code for the log message that is logged if a time series does not pass the check. This event code has to contain a dot, e.g. "TimeSeries.Check", because the log message is only visible to the master controller if the event code contains a dot.
  • logMessage: Log message that is logged if a time series does not pass the check. Some more options are available than in the other checks.
  • onErrorResumeNext When true, makes the secondary validation continue when an error logging is applied.

Tag

Replacement

%AMOUNT_CHANGED_FLAGS%

The number of flags that has been altered.

%CHECK_ID%

The id of the check that caused the flags to be altered.

%HEADER%

The header names of the timeseries for which the flags were altered.

%LOCATION_ID%

The locationId where the alterations took place.

%LOCATION_NAME%

The name of the locations where the alterations took place.

%OUTPUT_FLAG%

The flag that has been set.

%PARAMETER_ID%

The parameterId where the alterations took place.

%PARAMETER_NAME%

The name of the parameter where the alterations took place.

%PERIOD%

The period in which flags were changed.

%NONE%

Hide the autogenerated location and period in the log message.

It is not possible to compare two different location sets both containing more than one location id, but the following comparisons can be configured:

  • one location with a scalar
  • all the locations in a location set with a scalar
  • two different locations
  • one location with all the locations in a location set
  • two similar locationSets, containing exactly the same location ids

Rules for updating the flags

For each timestep, the most unreliable flag in the inputVariables is determined, e.g. unreliable > doubtful > reliable.
If the most unreliable flag in the inputVariables is unreliable, and the corresponding flag in the outputVariable is reliable or doubtful, it is made unreliable as well.
If the most unreliable flag in the inputVariables is doubtful, and the corresponding flag in the outputVariable is reliable, it is made doubtful as well.

Configuration examples for flagsComparisonCheck

A configuration example for the flagsComparisonCheck is given below:

<secondaryValidation xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/secondaryValidation.xsd">

	<!-- comparison of variables with similar location sets, different parameters, does comparison per location  -->
	<flagsComparisonCheck id="FlagsComparisonCheck_similarLocationSet">
		<!-- referred to by locationset5 and locationset6-->
		<variableDefinition>
			<variableId>locationLocationTestLocation12_H_obs_init1</variableId>
			<timeSeriesSet>
				<moduleInstanceId>FlagsComparisonCheckTest</moduleInstanceId>
				<valueType>scalar</valueType>
				<parameterId>H.obs1</parameterId>
				<locationId>location12</locationId>
				<timeSeriesType>external historical</timeSeriesType>
				<timeStep unit="minute" multiplier="15"/>
				<readWriteMode>read complete forecast</readWriteMode>
			</timeSeriesSet>
		</variableDefinition>
		<!-- referred to by locationset5 and locationset6-->
		<variableDefinition>
			<variableId>locationLocationTestLocation13_H_obs_init2</variableId>
			<timeSeriesSet>
				<moduleInstanceId>FlagsComparisonCheckTest</moduleInstanceId>
				<valueType>scalar</valueType>
				<parameterId>H.obs1</parameterId>
				<locationId>location13</locationId>
				<timeSeriesType>external historical</timeSeriesType>
				<timeStep unit="minute" multiplier="15"/>
				<readWriteMode>read complete forecast</readWriteMode>
			</timeSeriesSet>
		</variableDefinition>
		<!-- referred to by locationset5 and locationset6-->
		<variableDefinition>
			<variableId>locationLocationTestLocation12_H_obs2_init3</variableId>
			<timeSeriesSet>
				<moduleInstanceId>FlagsComparisonCheckTest</moduleInstanceId>
				<valueType>scalar</valueType>
				<parameterId>H.obs2</parameterId>
				<locationId>location12</locationId>
				<timeSeriesType>external historical</timeSeriesType>
				<timeStep unit="minute" multiplier="15"/>
				<readWriteMode>read complete forecast</readWriteMode>
			</timeSeriesSet>
		</variableDefinition>
		<!-- referred to by locationset5 and locationset6-->
		<variableDefinition>
			<variableId>locationLocationTestLocation13_H_obs2_init4</variableId>
			<timeSeriesSet>
				<moduleInstanceId>FlagsComparisonCheckTest</moduleInstanceId>
				<valueType>scalar</valueType>
				<parameterId>H.obs2</parameterId>
				<locationId>location13</locationId>
				<timeSeriesType>external historical</timeSeriesType>
				<timeStep unit="minute" multiplier="15"/>
				<readWriteMode>read complete forecast</readWriteMode>
			</timeSeriesSet>
		</variableDefinition>

		<variableDefinition>
			<variableId>similarLocationSetTest1_H_obs_initSet</variableId>
			<timeSeriesSet>
				<moduleInstanceId>FlagsComparisonCheckTest</moduleInstanceId>
				<valueType>scalar</valueType>
				<parameterId>H.obs1</parameterId>
				<locationSetId>locations5</locationSetId>
				<timeSeriesType>external historical</timeSeriesType>
				<timeStep unit="minute" multiplier="15"/>
				<readWriteMode>read complete forecast</readWriteMode>
			</timeSeriesSet>
		</variableDefinition>

		<variableDefinition>
			<variableId>similarLocationSetTest2_H_obs_initSet</variableId>
			<timeSeriesSet>
				<moduleInstanceId>FlagsComparisonCheckTest</moduleInstanceId>
				<valueType>scalar</valueType>
				<parameterId>H.obs2</parameterId>
				<locationSetId>locations6</locationSetId>
				<timeSeriesType>external historical</timeSeriesType>
				<timeStep unit="minute" multiplier="15"/>
				<readWriteMode>read complete forecast</readWriteMode>
			</timeSeriesSet>
		</variableDefinition>

		<inputVariableId>similarLocationSetTest1_H_obs_initSet</inputVariableId>
		<inputVariableId>similarLocationSetTest2_H_obs_initSet</inputVariableId>
		<outputVariableId>similarLocationSetTest1_H_obs_initSet</outputVariableId>
		<outputVariableId>similarLocationSetTest2_H_obs_initSet</outputVariableId>
		<logLevel>INFO</logLevel>
		<logEventCode>SecondaryValidation.similarLocationSetTest2_H_obs_initSet</logEventCode>
		<logMessage>%AMOUNT_CHANGED_FLAGS% flags set to %OUTPUT_FLAG% by [%CHECK_ID%, %EXPRESSION%], header=%HEADER%, location(s)=%LOCATION_NAME%</logMessage>
	</flagsComparisonCheck>

</secondaryValidation>

  • No labels