Greetings to everyone.
I have two queries: one for temperature and one for millivolts:
Query A:
from(bucket: "mydata")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "IBQFurnaceZoneData")
|> filter(fn: (r) => r["_field"] == "temperature")
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: "mean")
Query B:
from(bucket: "mydata")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "IBQFurnaceZoneData")
|> filter(fn: (r) => r["_field"] == "millivolts")
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: "mean")
Let’s say query A results in 1450 and query B results in 1012
The matrix shown below references temperature vs %C to get the millivolts, but in my case, I have the temperature and the millivolts, and I need %C. Can I use the values returned by Query A and B to be “paired” / matched against the matrix, and the %C value of 0.15 would be returned?
Could I do something like the array shown below? If yes, what would be the function to use this array as a sort of lookup table to find percent_carbon (if the other two values are known)?
import "experimental/array"
a = [
{temperature: 1400, percent_carbon: 0.05, millivolts: 957},
{temperature: 1400, percent_carbon: 0.10, millivolts: 989},
{temperature: 1400, percent_carbon: 0.15, millivolts: 1007},
{temperature: 1400, percent_carbon: 0.20, millivolts: 1021},
{temperature: 1425, percent_carbon: 0.05, millivolts: 959},
{temperature: 1425, percent_carbon: 0.10, millivolts: 991},
{temperature: 1425, percent_carbon: 0.15, millivolts: 1010},
{temperature: 1425, percent_carbon: 0.20, millivolts: 1024},
{temperature: 1450, percent_carbon: 0.05, millivolts: 961},
{temperature: 1450, percent_carbon: 0.10, millivolts: 993},
{temperature: 1450, percent_carbon: 0.15, millivolts: 1012},
{temperature: 1450, percent_carbon: 0.20, millivolts: 1026},
{temperature: 1475, percent_carbon: 0.05, millivolts: 963},
{temperature: 1475, percent_carbon: 0.10, millivolts: 996},
{temperature: 1475, percent_carbon: 0.15, millivolts: 1015},
{temperature: 1475, percent_carbon: 0.20, millivolts: 1029},
]