mirror of
https://github.com/FAUSheppy/ths-reference-data-collector
synced 2025-12-06 23:11:35 +01:00
implement kelvin col
This commit is contained in:
6
main.py
6
main.py
@@ -21,6 +21,7 @@ OUTSIDE_DATA_URL = "http://umweltdaten.nuernberg.de/csv/wetterdaten/messstat
|
|||||||
headerMappings = {
|
headerMappings = {
|
||||||
"time" : "Datum/Zeit",
|
"time" : "Datum/Zeit",
|
||||||
"lufttemperatur-aussen" : "Temperatur [°C]",
|
"lufttemperatur-aussen" : "Temperatur [°C]",
|
||||||
|
"kelvin" : "Temperatur [K]" ,
|
||||||
"luftfeuchte" : "rel. Luftfeuchte [%]",
|
"luftfeuchte" : "rel. Luftfeuchte [%]",
|
||||||
"luftdruck" : "Luftdruck [mbar]",
|
"luftdruck" : "Luftdruck [mbar]",
|
||||||
"windgeschwindigkeit" : "Windgeschwindigkeit [m/s]",
|
"windgeschwindigkeit" : "Windgeschwindigkeit [m/s]",
|
||||||
@@ -100,6 +101,11 @@ def checkLastMonths(backwardsMonths=6):
|
|||||||
rowdict = { headerMappings["time"] : key }
|
rowdict = { headerMappings["time"] : key }
|
||||||
for data in fullContentDict[key]:
|
for data in fullContentDict[key]:
|
||||||
rowdict.update({ headerMappings[data.dtype] : data.value })
|
rowdict.update({ headerMappings[data.dtype] : data.value })
|
||||||
|
|
||||||
|
# calc kelvin if temp #
|
||||||
|
if data.dtype == "lufttemperatur-aussen":
|
||||||
|
rowdict.update({ headerMappings["kelvin"] : data.value + 273 })
|
||||||
|
|
||||||
writer.writerow(rowdict)
|
writer.writerow(rowdict)
|
||||||
|
|
||||||
def parse(content, dtype):
|
def parse(content, dtype):
|
||||||
|
|||||||
Reference in New Issue
Block a user