I use aggregateWindow to evaluate data but time of day seem different

Hi, I use a greehouse system and want calculate Daily light integral (DLI)
I must integrate the PPFD with different value during the day. All work well except the time I make my integral.

ON the left graph, I draw my PPFD with toronto time.

from(bucket: “borealis”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“_measurement”] == “borealis”)
|> filter(fn: (r) => r[“_field”] == “LIGHT”)
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: “mean”)

On the right, I calculate the DLI for each day.
THe problem is the 24h period is not the same. That causing the data is not good. I should do integral from 00:00 to 23:59. So it seem to be different and the 1day period is on different hour.

from(bucket: “borealis”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“_measurement”] == “borealis”)
|> filter(fn: (r) => r[“_field”] == “LIGHT”)
|> aggregateWindow(
every: 1d,
fn: integral ,
createEmpty: false
)
|> map(fn: (r) => ({r with _value: r._value / 1000000.0}))
|> yield(name: “DLI”)

Any hints? thx Very much

INfo: It’s a continuity of this post: Integral function in FLuxQL - #4 by fredericgag

Does it help if the left graph has this instead?
|> aggregateWindow(every: 1d, fn: mean, createEmpty: false)

Same thing except the left graph seem less precise.

I am wondering if your DLI calculation is getting fouled up because of the range being used (I cannot see from your screenshot what you have chosen in the Grafana time picker). Maybe try playing around with truncating the time to the nearest day.