-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename file and remove filtering which was implemented to pot-plugin …
…(HIMAN-359)
- Loading branch information
Showing
2 changed files
with
29 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file was deleted.
Oops, something went wrong.