Summary

Input: Ensemble timeseries, Input: Scalar timeseries
Output: Scalar timeseries
Returns the rank of the scalar timeseries values relative to the ensemble timeseries per timestep. The rank is a value between 1 and the size of ensemble. It will return the index of where the value would be when ordered together with the ensemble member values.

Description

Per timestep calculate the rank of a time series relative to the ensemble timeseries and written to the output value, resulting in a scalar timeseries.

The rank is calculated as follows:

First all the values of the different ensemble members are ordered ascending. Then the value of the <value> variable is compared to those and then the first index that contains a higher or equal number will be the rank.

When the value is higher than the 4th ensemble mmber value but smaller than the 5th it will get rank 5.

When the value is lower than all ensemble member values it will get rank 1.

If it is equal to the lowest ensemble member value it will also get rank 1.

If it is higher than the highest ensemble member value it will the get rank of number of ensemble members + 1.

When the value is missing the rank will also be set to missing.

When there are no values for the ensemble members the rank will be set to missing.


Configuration

<transformation id="mean_monthly_flows_past">
		<aggregation>
			<meanToMean>
				<inputVariable>
					<variableId>flows_past_day</variableId>
				</inputVariable>
				<ignoreMissings>true</ignoreMissings>
				<outputVariable>
					<variableId>flows_past_monthly</variableId>
				</outputVariable>
			</meanToMean>
		</aggregation>
	</transformation>
    <transformation id="mean_monthly_flows_current">
		<aggregation>
			<meanToMean>
				<inputVariable>
					<variableId>flows_current_day</variableId>
				</inputVariable>
				<ignoreMissings>true</ignoreMissings>
				<outputVariable>
					<variableId>flows_current_monthly</variableId>
				</outputVariable>
			</meanToMean>
		</aggregation>
	</transformation>
	<transformation id="Sample_Ensembles_For_rank">
		<sample>
			<historical>
				<inputVariable>
					<variableId>flows_past_monthly</variableId>
				</inputVariable>
				<moduleParameterFile>Sample_ESP_Forecast</moduleParameterFile>
				<outputVariable>
					<variableId>flows_past_monthly_ens</variableId>
				</outputVariable>
			</historical>
		</sample>
	</transformation>
	<transformation id="Calculate_rank">
		<statisticsEnsemble>
			<rank>
				<value>
					<variableId>flows_current_monthly</variableId>
				</value>
				<inputVariable>
					<variableId>flows_past_monthly_ens</variableId>
				</inputVariable>
				<outputVariable>
					<variableId>rank_current_monthly</variableId>
				</outputVariable>
			</rank>
		</statisticsEnsemble>
	</transformation>
  • No labels