-
What Grafana version and what operating system are you using?
Grafana 10.3.3 in a Container on a Synology NAS -
What are you trying to achieve?
I have a time series plot with the power of the photovoltaic system and also the altitude of the sun (from Sun and Moon plugin). As I live in the mountains, sunrise is a couple of hours later than when the sun altitude gets >0. Therfore I would like to “cut” the orange curve of the sun, to show only the part, when the sun is really above the mountain.
-
How are you trying to achieve it?
I noted down a lookup table with azimuth and altitude (in degrees) of the mountains (=horizon) around me. Before plotting the sun altitude against the time, I would like to filter out / don’t display the sun altitude when the sun is lower than the mountain. For this I need to somehow take the sun-azimuth at a given time, get the altitude of the mountain at the same azimuth and then compare the mountain altitude with the sun altitude . If sun altitude > moutain altitude → plot it.As I’m still rather new to Grafana, I have no clue how to achieve that. Any suggestions or ideas how the above could potentially be realized are very welcome. I think I should somehow get my horizon loopup table into the sysystem and compare against it.
What is your datasource?
Maybe what you need can be accomplished by the new sql expression future
Please share some sample of your data and identify key columns to be used for the calculation you need?
the datasource is on one hand the SunAndMoon Plugin for the sun altitude and azimuth. The table representing my horizon is currently just an excel with a couple of dozens of points (azimuth vs altitude). That’s exactly my problem: I don’t know where to store this data and how to combine it with the SunAndMoon Plugin data. Since it is a very limited amount of point, these excel data can go anywhere, even hardcoded into an SQL query for example.
so my question was not so much about how to store things but it was about you providing it here in this thread and then we can go from there.
“Please share some sample of your data and identify key columns to be used for the calculation you need?”
Currently it looks like this:
| Azimuth [deg] | Altitude [deg] |
|---|---|
| 60 | 8.6 |
| 70 | 7.6 |
| 80 | 9.5 |
| 90 | 11.3 |
| 100 | 17.2 |
| 110 | 21.3 |
| 120 | 22.8 |
| 130 | 21.8 |
| 140 | 20.6 |
| 150 | 20.1 |
| 160 | 16.9 |
| 170 | 14.2 |
| 180 | 11.8 |
| 190 | 7.8 |
| 200 | 4.6 |
| 210 | 3.8 |
| 220 | 5.4 |
| 230 | 7.4 |
| 240 | 11.6 |
| 250 | 14.5 |
| 260 | 15.8 |
| 270 | 15.1 |
| 280 | 14.9 |
| 290 | 15.5 |
Which means, when I look south (180deg) then I see the mountain altitude at 11.8deg.
The other data is altitude and azimuth of the sun as a function of time from the SunAndMoon Plugin. When plotting the altitude of the sun, I would like to do something like this (pseudo mathematical):
for the time t, get the azimuth of the sun → azimuth_sun(t)
get altitude of the mountain at the azimuth_sun(t) → alitutde_mount(azimuth_sun(t))
if altitude_mount(azimuth_sun(t)) < altitude_sun(t) then plot altitude_sun(t)
what have you chosen here.
where are these functions coming from?
azimuth_sun(t)
alitutde_mount(azimuth_sun(t))
altitude_sun(t)
altitude_mountain(azimuth_sun(t))
is alitutde_mount different than altitude_mountain
if
I selected this:
The pseudo functions I made up to illustrate what I want to achieve. But looks like I produced more confusion. They are not existing. That’s the point. I don’t know how to achieve that.
And sorry, is alitutde_mount and altitude_mountain are the same. I corrected my post above accordingly.


