Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is there a way to do a linear interpolation using a database feed and a lookup table? We receive continuous data from our onsite monitoring, and we need to lookup a reference table(see below) to get an output. The value of the continuous data references the first column and then interpolated output based on the second column is produced.
For example, if we receive a value of 590.10ft, we would like to get an answer of ~13.4cfs. We currently have excel spreadsheets and some old Python code that can produce this but is this possible using TOS?
[ft] | [cfs] |
0 | 0 |
590 | 0 |
590.02 | 7 |
590.09 | 65 |
590.13 | 112 |
590.18 | 183 |
590.2 | 215 |
590.25 | 300 |
590.28 | 356 |
Yes. Just translate your Python code into Java and apply it in a Job.
Unfortunately, re-purposing the old python code isn't an option for us.
OK, well this may work for you.....
http://www.java2s.com/Code/Java/Collections-Data-Structure/LinearInterpolation.htm
You can plug that code into a Talend routine and use to carry out your calculation