fact-project / shifthelper

So we can sleep at night.
4 stars 0 forks source link

Identical windlimit as in ASR #268

Closed dneise closed 3 years ago

dneise commented 6 years ago

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:

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.