Skip to content

Commit 348b3a4

Browse files
committed
Rename file and remove filtering which was implemented to pot-plugin (HIMAN-359)
1 parent 60399ca commit 348b3a4

File tree

2 files changed

+29
-39
lines changed

2 files changed

+29
-39
lines changed

himan-scripts/pot-limit-values.lua

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--
2+
-- Limit the value of POT to max 29% during winter time.
3+
-- 30% is the threshold that will show lightning in the
4+
-- weather symbol and we don't want to predict
5+
-- lightning in the winter (in Scandinavia).
6+
--
7+
8+
local POT = luatool:Fetch(current_time, level(HPLevelType.kHeight, 0), param("POT-PRCNT"), current_forecast_type)
9+
10+
if not POT then
11+
return
12+
end
13+
14+
local m = tonumber(current_time:GetValidDateTime():String("%m"))
15+
16+
-- winter is november to march
17+
if m >= 11 or m <= 3 then
18+
for i=1, #POT do
19+
local pot = POT[i]
20+
21+
if pot == pot then
22+
POT[i] = math.min(29, pot)
23+
end
24+
end
25+
end
26+
27+
result:SetParam(param("POT-PRCNT"))
28+
result:SetValues(POT)
29+
luatool:WriteToFile(result)

himan-scripts/pot-postprocess.lua

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)