Description and usage

This transformation is used to convert a stage to a discharge with a Rating Curve.

The transformation performs the conversion based on the Rating Curve for the current location. The transformation assumes that the rating curve to use for the conversion has the same id as the locationId used in the transformation for the input time series. In case the id of the rating curve is not the same as the locationid then it is possible to configure a custom id for the rating curve.

The conversion will be done based on a table lookup. The details of the conversion are described below.

The rating curve can be defined in fews in two ways:

1. configure a rating curve in RegionConfigFiles/RatingCurve
2. import a rating curve. Currently two formats are supported:the nws-format and the pi-format.

Two types of interpolation/extrapolation are supported:

1. linear
2. logarithmic

linear interpolation/extrapolation

First the slope of the Rating Curve from the two points that bracket the given value in the case of interpolation or the two points closest to the given value in the case of extrapolation. The point with the largest vlaues is designated Hu, Qu, the one with the smallest values is Hl,Ql.

To convert a given stage H to a discharge Q

To convert a given discharge Q to a stage H

Logarithmic interpolation/extrapolation

First the slope of the Rating Curve from the two points that bracket the given value in the case of interpolation or the two points closest to the given value in the case of extrapolation.

To convert a given stage H to a discharge Q

To convert a given discharge to a stage H

If Ql is equal to zero then Ql is set to 0.0001 to allow for logarithmic calculations. In addition stages less than the specified minimum value (Hm) are not used in the computations or generated as result.

If the Rating Curve does not plot as a straight line on logarithmic paper then the interpolation and extrapolation results will not be correct. When this occurs, an offset value can be used to shift the Rating Curve so that it does plot as a straight line on logarithmic paper. The offset factor (Of) is subtracted from all the stage values in the previous equations. When an offset factor is used the equation to convert a discharge to a stage becomes:

In some cases different offset factors need to be applied to different ranges of stage in order to straighten out the logarithmic Rating Curve plot. The stages above which user specified offset factors apply must be defined points on the Rating Curve. Also a given offset factor must be less than the minimum stage to which it applies (Hf) so that the shifted stages will be greater than zero.

Offset factors can also be used to allow negative stages to be used in the logarithmic interpolation/extrapolation equations. In this case negative offset factors insure that positive stage values are used in the equations. If the user does not specify offset factors such that all stages used in the calculations are positive then the program automatically computes a shift factor (Sf) to produce the same results. Sf is used exactly like Of in the equations except Sf is added to all stage values (i.e. Sf=-Of). The rules used to determine Sf and the stage below which it is applied (Hs) are as follows:

1. If zero flow is a defined point (Ho, Qo) on the Rating Curve then:
   If specified Hm is less than Ho then set Hm=Ho
   If Ho>0.0 or Ho=min(Hf) then:
        Sf=0.0 and Hs=Ho

   If Ho <= 0.0 and min(Hf)>Ho then:
        Sf=0.01-Ho and Hs=min[min(Hf),Hp]
where Hp is the smallest positive stage value defined

2. If the zero discharge point is not included in the Rating Curve definition then:
a. If Hm and the stage at the first defined point on the Rating Curve (H1) are both greater than zero then:
    Sf=0.0 and Hs=Ho
where Ho is computed by using Qo=0.0001 CMS
b. If Hm or H1 <= 0.0 then:
    Sf=0.01-minHm,H1 and Hs=minmin(Hf),Hp
c. If Hm is less than the computed Ho then:
     Hm=Ho

The shift factor will never be applied to the same range of stages to which an offset is applied. The shift factor is also only applied to the portion of the Rating Curve that needs to be shifted to avoid zero or negative values in logarithmic calculations. The shifted portion of a Rating Curve most likely will not plot as a straight line on logarithmic paper. Therefore it is better off to specify offset factors to insure that reasonable results are obtained during
extrapolation at the low end of the Rating Curve rather than to rely on the automatic shift procedure.


Input/Output time series

In this function two time series must be identified.

  1. An input time series of instantaneous stage values.
  2. An output time series of instantaneous discharge values.
    Each time series is assigned a variable ID which is used in the actual expression. For definition of input and output time series see Transformation - Inputs and Outputs.

Configuration

A basic configuration of the function is described below. This describes the main elements and attributes required and provides an example configuration.

stage

required element defining the identifier of the input time series with stage values.

discharge

required element defining the identifier of the output time series with discharge values.

ratingCurve

optional element for configuring a custom rating curve.


Example
<transformation id="stagetodischarge">
		<stageDischarge>
			<ratingCurve>
				<stage>
					<variableId>stage</variableId>
				</stage>
				<ratingCurve>
					<locationId>rratingcurveid</locationId>
				</ratingCurve>
				<discharge>
					<variableId>discharge</variableId>
				</discharge>
			</ratingCurve>
		</stageDischarge>
	</transformation>

Advanced configuration topics

Additional advanced options are available and are briefly described. See schema for information on how to configure advanced options.

className

Optional element to define a Java class to override the default class used for the transformation. If used this class must be available and implement the required transformation interface. See transformation - user defined classes for details


Schema Definition


Common issues

Issues

Possible causes

log message "Can not convert stage to discharge, rating curve missing"

Default rating curve id (locationid of the input time series) is not correct. Specifiy a custom rating curve id.


Related items

  • No labels