Hello all,
I’m attempting to store fft bin data with the following data structure:
point = {
"measurement" : "FrequencyDomain",
"time" : <current time stamp>,
"tags" " {
"SecondOfDay" : <second of the day>, # I might not need this
"DAQchannel" : <channel number>
},
"fields" : {
<freq> : <mag>, # Each key unique and represents a frequency bin. Orig data is float
<freq> : <mag>,
...
}
}
Data is storing fine and I can query it fine. I get very close to an fft representation when viewing the data as an X-axis series in grafana. BUT, the field key sort order is a string sort, not an integer sort. So I’ll get bin data going for example: 1, 10, 11, 2, 3, 4, 5, 6, 7, 8, 9. I see from the docs I can use toInt() on non _value columns but it must be with a function but I’m not quite understanding how to implement that. I’m on day 2 of learning influx/grafana… Below is the query I’m using to pull the fft data for a particular second of the day. Does anyone have any pointers or guidance?
from(bucket: "cm")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "FrequencyDomain")
|> filter(fn: (r) => r["DAQchannel"] == "Ch0")
|> filter(fn: (r) => r["SecondOfDay"] == "74700")
|> sort(columns: ["_field"])