Skip to content

Commit

Permalink
Rename file and remove filtering which was implemented to pot-plugin …
Browse files Browse the repository at this point in the history
…(HIMAN-359)
  • Loading branch information
mpartio committed May 7, 2024
1 parent 60399ca commit 348b3a4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 39 deletions.
29 changes: 29 additions & 0 deletions himan-scripts/pot-limit-values.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
--
-- Limit the value of POT to max 29% during winter time.
-- 30% is the threshold that will show lightning in the
-- weather symbol and we don't want to predict
-- lightning in the winter (in Scandinavia).
--

local POT = luatool:Fetch(current_time, level(HPLevelType.kHeight, 0), param("POT-PRCNT"), current_forecast_type)

if not POT then
return
end

local m = tonumber(current_time:GetValidDateTime():String("%m"))

-- winter is november to march
if m >= 11 or m <= 3 then
for i=1, #POT do
local pot = POT[i]

if pot == pot then
POT[i] = math.min(29, pot)
end
end
end

result:SetParam(param("POT-PRCNT"))
result:SetValues(POT)
luatool:WriteToFile(result)
39 changes: 0 additions & 39 deletions himan-scripts/pot-postprocess.lua

This file was deleted.

0 comments on commit 348b3a4

Please sign in to comment.