rating_table demonstrates rating table to interpolate flow based on stage



Given stage reading, this script will find the closest stage/discharge pair in rating table that is less than the input stage reading, and then perform a linear interpolation on the discharge values on either side of the stage reading to determine the discharge value at the current stage. For example, a stage value of 4” would output 32.0 CFS discharge because 4 is between (3, 22) and (5, 42).

User will need to define the values for the rating table based on their application. The example below assumes an input stage value in inches and outputs discharge in cubic feet per second (CFS).

To configure this script, attach this function to a Stage measurement or second meta referring to stage and make sure your stage units match your rating table stage values.