Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions himan-scripts/icing-base-top.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Produce it in both flight level and hft coordinates
]]

logger:Info("Calculating base and top for icing")
local utils = require("utils")
local MISS = missing
local IceParam = param("ICING-N")

Expand Down Expand Up @@ -66,8 +67,8 @@ function AddScalar(arr, scalar)
return ret
end

local baseHPa = BaseHPa(3)
local topHPa = TopHPa(5,AddScalar(baseHPa,-1))
local baseHPa = BaseHPa(3) -- icing index >=4
local topHPa = TopHPa(4,AddScalar(baseHPa,-1)) -- icing index <4

-- Convert top [hPa] to FL
local topFL = {}
Expand All @@ -85,8 +86,8 @@ local topM = hitool:VerticalValueGrid(param("HL-M"), topHPa)
local topHFt = {}
local baseHFt = {}
for i=1, #baseM do
topHFt[i] = 5 * math.floor(topM[i] / 152.4)
baseHFt[i] = 5 * math.floor(baseM[i] / 152.4)
topHFt[i] = utils.round(topM[i] / 0.3048 / 100)
baseHFt[i] = utils.round(baseM[i] / 0.3048 / 100)
end

result:SetParam(param("ICING-TOP-FL"))
Expand Down