The automatic suspend and resume thing (ASR) applys a different wind-speed-alert-limit/strategy than the current version of the shifthelper(SH).
So it can (and will) happen, that the SH calls a shifter, since the SH-wind-speed-limit is exceeded, but the ASR thinks the weather is just perfect, since the ASR simply has a different understanding of what "just perfect" means.
In this PR, I add a wind speed check which should behave exactly as the strategy applied by the ASR.
It needs a history, so I do it similarly to the trigger rate check. Basically faking a static variable in a Python function, which is really ugly .. sorry for that.
Ah... maybe I should explain the strategy the ASR uses for completeness here:
look at the wind_gusts only not the wind_speed.
consider a "history" of the last 20 minutes.
if the number of wind_gusts > 50km/h is larger than 2, we want to stop observations.
So .. we do not want to be called, in the same moment, when the ASR is just about to suspend operation and park the telescope, we want to be called a bit later. So... Instead of looking at the last 20minutes, this condition is looking at a 20min long history, which is from 5min in the past. This way I hope to correctly delay the SH call by 5minutes.
Ah also, I decreased the interval to 30sec, so this check is executed as often as the ASR is running. Otherwise the definition of "two times above the threshold within (the last) 20min" would differ.
The automatic suspend and resume thing (ASR) applys a different wind-speed-alert-limit/strategy than the current version of the shifthelper(SH).
So it can (and will) happen, that the SH calls a shifter, since the SH-wind-speed-limit is exceeded, but the ASR thinks the weather is just perfect, since the ASR simply has a different understanding of what "just perfect" means.
In this PR, I add a wind speed check which should behave exactly as the strategy applied by the ASR. It needs a history, so I do it similarly to the trigger rate check. Basically faking a static variable in a Python function, which is really ugly .. sorry for that.
Ah... maybe I should explain the strategy the ASR uses for completeness here:
wind_gusts
only not thewind_speed
.wind_gusts
> 50km/h is larger than 2, we want to stop observations.So .. we do not want to be called, in the same moment, when the ASR is just about to suspend operation and park the telescope, we want to be called a bit later. So... Instead of looking at the last 20minutes, this condition is looking at a 20min long history, which is from 5min in the past. This way I hope to correctly delay the SH call by 5minutes.
Ah also, I decreased the interval to 30sec, so this check is executed as often as the ASR is running. Otherwise the definition of "two times above the threshold within (the last) 20min" would differ.