Skip to content

Commit

Permalink
added some more parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
KCN1 committed Oct 31, 2024
1 parent 734c2b8 commit 4ce5404
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
15 changes: 15 additions & 0 deletions converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 4 additions & 3 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
<tbody>
<tr>
<th><small>date</small></th>
<th><small>time</small></th>
<th><small>t [°C] / Grad [°C/100m]</small></th>
<th><small>time (GMT)</small></th>
<th><small>t [°C] / Δt (2m - 100m)</small></th>
<th><small>wind</small></th>
<th><small>clouds (low)</small></th>
<th><small>precipitation</small></th>
Expand All @@ -36,7 +36,8 @@
<tr>
<th>{{dt.strftime('%a, %d.%m.%y')}}</th>
<td>{{forecast.time.isoformat(timespec='minutes')}}</td>
<td>{{forecast.temperature}} / {{(2 * forecast.temperature - forecast.temperature_80m - forecast.temperature_120m) / 2}}</td>
<td>{{forecast.temperature}} / {{forecast.temperature -
(forecast.temperature_80m + forecast.temperature_120m) / 2}}</td>
<td>
<span style="text-align: left; width: 5ch; display: inline-block">{{forecast.wind_direction}}°</span>
<span style="text-align: left; width: 4ch; display: inline-block">{{forecast.wind_speed}}</span>
Expand Down

0 comments on commit 4ce5404

Please sign in to comment.