From 9d883a5cf81cfac14dfb3a9e809875a9aed33ecc Mon Sep 17 00:00:00 2001 From: Andreas Tack Date: Thu, 2 Jul 2026 15:14:40 +0300 Subject: [PATCH] Adjust icing index and height conversion logic Updated icing index thresholds and conversion calculations for height. --- himan-scripts/icing-base-top.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/himan-scripts/icing-base-top.lua b/himan-scripts/icing-base-top.lua index cdcebcc2..d4489e05 100644 --- a/himan-scripts/icing-base-top.lua +++ b/himan-scripts/icing-base-top.lua @@ -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") @@ -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 = {} @@ -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"))