Open dotis opened 7 months ago
This one will be an interesting challenge. We might look into alternative visualization panels for display, but I don't see any built-in to deal with polar data.
To deal with the averaging issue at the database level we may be able to use functions in InfluxQL.
Step-by-step Process
PI/180 ~= 0.0174532925199
so step 1 will look something like:
SELECT 0.0174532925199 * "value" FROM "selector"
conceptual example of steps 2-4:
SELECT ATAN2(MEAN(SIN(radians)), MEAN(COS(radians))) AS mean_angle
FROM your_measurement
WHERE time >= 'start_time' AND time <= 'end_time'
GROUP BY time_group
This is going to take some fiddling around in the grafana interface to get right.
There is an issue with the display of data that goes from 0 to 360 degrees in grafana. An arithmetic mean does not work, as the mean of 1 degree and 360 degrees will be around 180 degrees. According to NDBC, the only thing that changed at this station is "We did a service visit in mid-June 2023 that converted the station from once per hour transmissions to every 10 minutes (twice per hour waves)."
Here is the wave direction from NDBC for the buoy at Gray's reef:
Here is the same data from grafana for roughly the same time period.