Rating curves / value transformations #2029
davetapley
started this conversation in
Ideas
Replies: 1 comment 7 replies
-
Hi Dave, |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm looking at QuestDB for applications in hydrology where rating curves are commonly used.
It would be very useful if they were 'built in', and I think such functionality could be broadly useful outside just hydrology.
I'll give some examples below, but foremost I'm wondering if this would be considered for inclusion?
(I'm willing to contribute if it makes sense).
Given some data:
I specify a rating curve as a relationship between
domain
andrange
as a series of fixed points, e.g:This is then applied by linearly interpolating between the closest
domain
for eachval
, e.g:2
is0.04
between0
and50
and soval'
is10 + ((20 - 10) * 0.04) = 10.4
.65
is0.125
between60
and100
and soval'
is20 + ((40 - 20) * 0.125) = 22.5
.Any
val
outside the limits given in the rating curve'sdomain
are undefined.Implementing this currently with
JOIN
would be awful,but I think if there were some special e.g.
TRANSFORM
function then it could be very elegant.One other fact:
These rating tables are updated intermittently, so there also needs to be logic to select the correct table.
ASOF JOIN
would be perfect for this 💫Here's what I envisage, I can select
data
, join arating
table, and use some newTRANSFORM
function to do the math:Beta Was this translation helpful? Give feedback.
All reactions