TARAGE — Function to apply rating curves and convert water levels or discharge data
OUT = TARAGE(CTAB,DATA,[TYPE,ExtrapolInf,ExtrapolSup,NbPtSup])
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 to convert (matrix [Nx1] where N is the number of data)
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
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
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
Number of points used to apply the linear regression (if Lin is selected as the ExtrapolSup method). Default = 3.
Converted data (matrix [Nx1] where N is the number of data)
This function is designed to convert discharges in water levels and vice versa with a tabulated rating curve.