Name

TARAGE — Function to apply rating curves and convert water levels or discharge data

Calling Sequence

OUT = TARAGE(CTAB,DATA,[TYPE,ExtrapolInf,ExtrapolSup,NbPtSup])

Parameters

CTAB

Conversion data table (matrix [Px2] where P is the number of correspondance points). Each correspondance point associates two values (for example water table and discharge).

DATA

Data to convert (matrix [Nx1] where N is the number of data)

TYPE

Way to utilise the conversion table (should be 'left2right' or 'right2left', default = 'left2right').

left2right : Data to convert is expressed in the same variable than the first column of the conversion table

right2left : Data to convert is expressed in the same variable than the second column of the conversion table

ExtrapolInf

Method to extrapolate data under the minimum of values available in the conversion table (should be Nul, Lin or Cst, default is Cst)

Nul : Data is set to %nan value

Lin : Data is extrapolated linearly based the 2 smallest value in the conversion table

Cst : Data is set to the smallest value in the conversion table

ExtrapolSup

Method to extrapolate data over the maximum of values available in the conversion table (should be Nul, Lin or Cst, default is Cst)

Nul : Data is set to %nan value

Lin : Data is extrapolated linearly based the 2 smallest value in the conversion table

Cst : Data is set to the smallest value in the conversion table

NbPtSup

Number of points used to apply the linear regression (if Lin is selected as the ExtrapolSup method). Default = 3.

OUT

Converted data (matrix [Nx1] where N is the number of data)

Description

  • This function is designed to convert discharges in water levels and vice versa with a tabulated rating curve.

Examples

    // Rating curve
   CT=[10,0.5;30,10;100,50;200,150];
   // Water level data
   WL=[6;10;14;25;65;170;150;120;100;85;80;70;70;60];
   // Conversion into discharge
   Q=TARAGE(CT,Wl);
   plot2d(WL,Q,style=-9);
   plot2d(CT(:,1),CT(:,2),style=-1);
  

Authors

Julien Lerat

CEMAGREF Antony, HBAN Unit, julien.lerat@cemagref.fr