From 4ce5404f59b0075c47af32068857e041dcb57cfb Mon Sep 17 00:00:00 2001 From: KCN Date: Mon, 2 Sep 2024 12:09:17 +0300 Subject: [PATCH] added some more parameters --- converter.py | 15 +++++++++++++++ parse.py | 2 +- templates/index.html | 7 ++++--- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/converter.py b/converter.py index 5657eba..080096d 100644 --- a/converter.py +++ b/converter.py @@ -16,6 +16,11 @@ def capesfc(x): return x[0][0] +def cinsfc(x): + "surface convective inhibition [j/kg]" + return x[0][0] + + def dpt2m(x): "2 m above ground dew point temperature [k]" return x[0][0] - 273.15 @@ -61,11 +66,21 @@ def lcdcavelcll(x): return x[0][0] +def lftxsfc(x): + "surface surface lifted index [k]" + return x[0][0] + + def mcdcavemcll(x): "middle cloud layer medium cloud cover [%]" return x[0][0] +def no4lftxsfc(x): + "surface best (4 layer) lifted index [k]" + return x[0][0] + + def prateavesfc(x): "surface precipitation rate [kg/m^2/s]" return x[0][0] * 3600 * 3 diff --git a/parse.py b/parse.py index c0df1c2..e9cdcd4 100644 --- a/parse.py +++ b/parse.py @@ -141,7 +141,7 @@ def main(): longitude = 44 utc_offset = 3 - data_keys = ['prateavesfc', 'tmp80m', 'tmp2m', 'tmpprs', 'hpblsfc', 'lcdcavelcll', 'tcdcaveclm'] + data_keys = ['cinsfc', 'hgtprs'] levels = [950, 900] forecast_days = 14 diff --git a/templates/index.html b/templates/index.html index 9226656..26dd7d0 100644 --- a/templates/index.html +++ b/templates/index.html @@ -24,8 +24,8 @@ date - time - t [°C] / Grad [°C/100m] + time (GMT) + t [°C] / Δt (2m - 100m) wind clouds (low) precipitation @@ -36,7 +36,8 @@ {{dt.strftime('%a, %d.%m.%y')}} {{forecast.time.isoformat(timespec='minutes')}} - {{forecast.temperature}} / {{(2 * forecast.temperature - forecast.temperature_80m - forecast.temperature_120m) / 2}} + {{forecast.temperature}} / {{forecast.temperature - + (forecast.temperature_80m + forecast.temperature_120m) / 2}} {{forecast.wind_direction}}° {{forecast.wind_speed}}