added yearly value to ground temperature variable

This commit is contained in:
Pilar Monsalvete 2023-03-24 10:33:59 -04:00
parent 4082a20638
commit 2d840a6e49

View File

@ -37,7 +37,7 @@ class EpwWeatherParameters:
depth_measurement_ground_temperature = line[i*16+2] depth_measurement_ground_temperature = line[i*16+2]
temperatures = [] temperatures = []
for j in range(0, 12): 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 ground_temperature[depth_measurement_ground_temperature] = temperatures
file.close() file.close()
except SystemExit: except SystemExit:
@ -74,6 +74,15 @@ class EpwWeatherParameters:
for building in self._city.buildings: for building in self._city.buildings:
building.ground_temperature[cte.MONTH] = ground_temperature 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: if cte.HOUR in building.external_temperature:
del building.external_temperature[cte.HOUR] del building.external_temperature[cte.HOUR]
new_value = pd.DataFrame(self._weather_values[['dry_bulb_temperature_c']].to_numpy(), columns=['epw']) new_value = pd.DataFrame(self._weather_values[['dry_bulb_temperature_c']].to_numpy(), columns=['epw'])