Skip to content

Commit

Permalink
Fix more Dew Point instances
Browse files Browse the repository at this point in the history
  • Loading branch information
markcampanelli committed Jan 11, 2024
1 parent 79b8506 commit 236d805
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pvdeg/design.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def edge_seal_width(weather_df, meta, k=None, years=25, from_dew_point=False):
Parameters
----------
weather_df : pd.DataFrame
must be datetime indexed and contain at least temp_air, Dew Point
must be datetime indexed and contain at least temp_air, temp_dew
meta : dict
location meta-data (from weather file)
k: float
Expand All @@ -58,7 +58,7 @@ def edge_seal_width(weather_df, meta, k=None, years=25, from_dew_point=False):
years : integer, default = 25
Integer number of years under water ingress
from_dew_point : boolean, optional
If true, will compute the edge seal width from Dew Point instead of dry bulb air temp
If true, will compute the edge seal width from temp_dew instead of dry bulb air temp
Returns
----------
Expand Down
5 changes: 3 additions & 2 deletions pvdeg/humidity.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def _ambient(weather_df):
-----------
weather_df : pd.DataFrame
Datetime-indexed weather dataframe which contains (at minimum) Ambient temperature
('temp_air') and dew point ('Dew Point') in units [C]
('temp_air') and dew point ('temp_dew') in units [C]
Returns:
--------
Expand All @@ -39,7 +39,8 @@ def _ambient(weather_df):
ambient relative humidity [%]
"""
temp_air = weather_df["temp_air"]
dew_point = weather_df["Dew Point"]
# "Dew Point" fallback handles key-name bug in pvlib < v0.10.3.
dew_point = weather_df.get("temp_dew", weather_df.get("Dew Point"))

num = np.exp(17.625 * dew_point / (243.04 + dew_point))
den = np.exp(17.625 * temp_air / (243.04 + temp_air))
Expand Down

0 comments on commit 236d805

Please sign in to comment.