From 2d840a6e492b682a4717696227ab4082b9003ec2 Mon Sep 17 00:00:00 2001 From: p_monsalvete Date: Fri, 24 Mar 2023 10:33:59 -0400 Subject: [PATCH] added yearly value to ground temperature variable --- hub/imports/weather/epw_weather_parameters.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hub/imports/weather/epw_weather_parameters.py b/hub/imports/weather/epw_weather_parameters.py index 2c7de4e2..ba046eea 100644 --- a/hub/imports/weather/epw_weather_parameters.py +++ b/hub/imports/weather/epw_weather_parameters.py @@ -37,7 +37,7 @@ class EpwWeatherParameters: depth_measurement_ground_temperature = line[i*16+2] temperatures = [] for j in range(0, 12): - temperatures.append(line[i*16+j+6]) + temperatures.append(float(line[i*16+j+6])) ground_temperature[depth_measurement_ground_temperature] = temperatures file.close() except SystemExit: @@ -74,6 +74,15 @@ class EpwWeatherParameters: for building in self._city.buildings: building.ground_temperature[cte.MONTH] = ground_temperature + print(ground_temperature) + ground_temperature = {} + for set in building.ground_temperature[cte.MONTH]: + temperature = 0 + for value in building.ground_temperature[cte.MONTH][set]: + temperature += value / 12 + ground_temperature[set] = [temperature] + print(ground_temperature) + building.ground_temperature[cte.YEAR] = ground_temperature if cte.HOUR in building.external_temperature: del building.external_temperature[cte.HOUR] new_value = pd.DataFrame(self._weather_values[['dry_bulb_temperature_c']].to_numpy(), columns=['epw'])