using elmhurst roof area methodology

This commit is contained in:
Khalim Conn-Kowlessar 2024-10-07 10:38:38 +01:00
parent 5bceee1acb
commit aa97c77747
3 changed files with 9 additions and 40 deletions

View file

@ -623,9 +623,7 @@ class Property:
self.find_energy_sources()
self.set_current_energy(kwh_client, kwh_predictions)
def set_solar_panel_configuration(
self, solar_panel_configuration, roof_area
):
def set_solar_panel_configuration(self, solar_panel_configuration):
"""
This funtion inserts the solar panel configuration into the property object
"""
@ -634,22 +632,11 @@ class Property:
if not self.roof["is_flat"]:
default_roof_area = estimate_pitched_roof_area(
floor_area=self.insulation_floor_area,
floor_height=self.floor_height
)
else:
default_roof_area = self.insulation_floor_area
# Keep a record
self.roof_area_comparison = {
"api": roof_area,
"estimated": default_roof_area
}
# We also set the roof area
if roof_area is None:
self.roof_area = default_roof_area
else:
self.roof_area = roof_area
self.roof_area = default_roof_area
def set_current_energy(self, kwh_client, kwh_predictions):
"""

View file

@ -766,7 +766,6 @@ class GoogleSolarApi:
"panel_performance": cls.default_panel_performance(property_instance=property_instance),
"unit_share_of_energy": 1
},
roof_area=None
)
continue

View file

@ -205,7 +205,7 @@ def get_wall_u_value(
mapped_value = wall_uvalues_df[
wall_uvalues_df["Wall_type"] == mapped_description
][age_band].values[0]
][age_band].values[0]
if pd.isnull(mapped_value) and "Park home" in mapped_description:
# We don't know enough in this case so we default to 0
@ -505,7 +505,7 @@ def get_floor_u_value(
insulation_lookup = s11[
s11["Age_band"].str.contains(age_band) & s11["Floor_construction"]
== floor_type
]
]
if insulation_lookup.empty:
insulation_thickness = 0
else:
@ -700,34 +700,17 @@ def convert_thickness_to_numeric(string_thickness, is_pitched, is_flat):
return int(string_thickness)
def estimate_pitched_roof_area(floor_area: float, floor_height: float) -> float:
def estimate_pitched_roof_area(floor_area: float) -> float:
"""
This function will estimate the area of a pitched roof, given the floor area below the roof and the floor
height of the property.
Given limited information about the home, this is a very rough method to estimate the roof area and we
assume the the room is a gable roof.
We assume a roughly average pitch of 45 degrees
Note that both floor area and height should be in the same units. E.g. if floor area is meters squared,
floor height should be in meters
This function mimics the methodology for calculating floor area in Elmhurst, so that we can simulate the outcomes
in a way that is consistent with the Elmhurst methodology.
:param floor_area: area of the home's floor
:param floor_height: height of the home's floors
:return: Numerical estimate of the surface area of the top of the pitched roof
"""
# We estimate the length of the wall by just modelling the house as a square
wall_width = np.sqrt(floor_area)
# We're modelling the roof as two triangles where we know two of the three sides.
# The floor height makes up one side and half of the wall width makes up the other side
slope = np.sqrt(np.square(wall_width / 2) + np.square(floor_height))
area = 2 * (slope * wall_width)
return area
scalar = 1.0571283428862048
return scalar * (floor_area / np.cos(np.radians(30)))
def estimate_windows(