Skip to content

Commit

Permalink
degradation temperature K -> C
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobin Ford committed Jan 17, 2025
1 parent 4f9e116 commit 56e4479
Show file tree
Hide file tree
Showing 2 changed files with 323 additions and 60 deletions.
15 changes: 9 additions & 6 deletions pvdeg/degradation.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,7 @@ def _gJtoMJ(gJ):

# new version of degradation
# we can make this work with varying timedelta sizes
# take C rather than K
def degradation(
spectra_df: pd.DataFrame,
conditions_df: pd.DataFrame = None,
Expand Down Expand Up @@ -908,19 +909,19 @@ def degradation(
- `index`: pd.DateTimeIndex identical to spectra_df.index
- `columns`: (required)
- "temperature" [°K]
- "temperature" [°C]
- "relative_humidity" [%]
Example::
timestamp temperature relative_humidity
2021-03-09 10:00:00 298.0 45.0
2021-03-09 11:00:00 301.0 50.0
2021-03-09 12:00:00 315.0 55.0
2021-03-09 13:00:00 150.0 60.0
2021-03-09 10:00:00 98.0 45.0
2021-03-09 11:00:00 31.0 50.0
2021-03-09 12:00:00 35.0 55.0
2021-03-09 13:00:00 50.0 60.0
temp_module : pd.Series, optional
Module temperatures [°K]. Required if `conditions_df` is not provided. Time indexed same as spectra_df
Module temperatures [°C]. Required if `conditions_df` is not provided. Time indexed same as spectra_df
rh_module : pd.Series, optional
Relative humidity values [%]. Required if `conditions_df` is not provided. Time indexed same as spectra_df
Expand Down Expand Up @@ -961,6 +962,8 @@ def degradation(
rh = rh_module.values
temps = temp_module.values

temps += 273.15

wavelengths = spectra_df.columns.values.astype(float)
irr = spectra_df.values # irradiance as array
dt = (spectra_df.index[1] - spectra_df.index[0]).total_seconds() / 3600.0
Expand Down
Loading

0 comments on commit 56e4479

Please sign in to comment.