fix: handle broken temp/hum values

This commit is contained in:
2024-03-05 21:27:04 +01:00
parent fa1a5abd04
commit c01239886b

View File

@@ -73,18 +73,18 @@ def generate(master_dir, from_time, to_time, cache_file, dtype):
# parse date # # parse date #
date = datetime.datetime.strptime(fulldate, "%Y%m%d%H") date = datetime.datetime.strptime(fulldate, "%Y%m%d%H")
# skip shit data #
if float(temp) < -100 or float(hum) < 0:
continue
# append data # # append data #
data.append((date, float(temp), float(hum))) data.append((date, float(temp), float(hum)))
# set start and end # # set start and end #
if "tu" in fname:
print(line, date)
if not start and date: if not start and date:
start = date start = date
elif date: elif date:
end = date end = date
if "tu" in fname:
print(end)
# save values # # save values #
timeframes.append((start, end, data)) timeframes.append((start, end, data))