fix: 修正雷电流密度计算条件并修复单位显示错误

修正雷暴日判断条件从等于改为小于等于,并添加中间范围判断
修复日志中电流单位显示错误(kV改为kA)
初始化时根据雷暴日自动计算地闪密度
This commit is contained in:
dmy
2026-03-03 10:39:53 +08:00
parent 2401b0b19a
commit 9557e18fd1
3 changed files with 8 additions and 3 deletions

View File

@@ -215,10 +215,10 @@ def thunder_density(i, td, ip_a, ip_b): # 雷电流幅值密度函数
)
return r
else:
if td == 20:
if td <= 20:
r = -(10 ** (-i / 44)) * math.log(10) * (-1 / 44) # 雷暴日20d
return r
if td == 40:
if td <= 40 and td>20:
r = -(10 ** (-i / 88)) * math.log(10) * (-1 / 88) # 雷暴日40d
return r
raise Exception("检查雷电参数!")