diff --git a/pvdeg/degradation.py b/pvdeg/degradation.py
index 848fed9..5fce625 100644
--- a/pvdeg/degradation.py
+++ b/pvdeg/degradation.py
@@ -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,
@@ -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
@@ -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
diff --git a/testing-setpoints/standards_testing.ipynb b/testing-setpoints/standards_testing.ipynb
index 25527ec..87255f8 100644
--- a/testing-setpoints/standards_testing.ipynb
+++ b/testing-setpoints/standards_testing.ipynb
@@ -50,9 +50,142 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 3,
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "
\n",
+ "
Chamber Simulation
\n",
+ "\n",
+ "
\n",
+ "
\n",
+ " ►\n",
+ " Setpoints Dataframe\n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " setpoint_temperature | \n",
+ " setpoint_irradiance_280-400 | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 0 days 00:00:00 | \n",
+ " 60.0 | \n",
+ " 250.0 | \n",
+ "
\n",
+ " \n",
+ " 0 days 00:01:00 | \n",
+ " 60.0 | \n",
+ " 250.0 | \n",
+ "
\n",
+ " \n",
+ " 0 days 00:02:00 | \n",
+ " 60.0 | \n",
+ " 250.0 | \n",
+ "
\n",
+ " \n",
+ " 0 days 00:03:00 | \n",
+ " 60.0 | \n",
+ " 250.0 | \n",
+ "
\n",
+ " \n",
+ " 0 days 00:04:00 | \n",
+ " 60.0 | \n",
+ " 250.0 | \n",
+ "
\n",
+ " \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " 2 days 11:55:00 | \n",
+ " 60.0 | \n",
+ " 250.0 | \n",
+ "
\n",
+ " \n",
+ " 2 days 11:56:00 | \n",
+ " 60.0 | \n",
+ " 250.0 | \n",
+ "
\n",
+ " \n",
+ " 2 days 11:57:00 | \n",
+ " 60.0 | \n",
+ " 250.0 | \n",
+ "
\n",
+ " \n",
+ " 2 days 11:58:00 | \n",
+ " 60.0 | \n",
+ " 250.0 | \n",
+ "
\n",
+ " \n",
+ " 2 days 11:59:00 | \n",
+ " 60.0 | \n",
+ " 250.0 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
3600 rows × 2 columns
\n",
+ "
\n",
+ "
\n",
+ "\n",
+ "
\n",
+ "
\n",
+ " ►\n",
+ " Setpoints Plot\n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
Setpoints Plot
\n",
+ "
\n",
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ " "
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
"source": [
"mqt_10"
]
@@ -337,9 +470,142 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 13,
"metadata": {},
- "outputs": [],
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ " \n",
+ "
Chamber Simulation
\n",
+ "\n",
+ "
\n",
+ "
\n",
+ " ►\n",
+ " Setpoints Dataframe\n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " setpoint_temperature | \n",
+ " setpoint_irradiance_full | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 0 days 00:00:00 | \n",
+ " 25.0 | \n",
+ " 1600 | \n",
+ "
\n",
+ " \n",
+ " 0 days 00:01:00 | \n",
+ " 25.0 | \n",
+ " 1600 | \n",
+ "
\n",
+ " \n",
+ " 0 days 00:02:00 | \n",
+ " 23.898305 | \n",
+ " 1600 | \n",
+ "
\n",
+ " \n",
+ " 0 days 00:03:00 | \n",
+ " 22.79661 | \n",
+ " 1600 | \n",
+ "
\n",
+ " \n",
+ " 0 days 00:04:00 | \n",
+ " 21.694915 | \n",
+ " 1600 | \n",
+ "
\n",
+ " \n",
+ " ... | \n",
+ " ... | \n",
+ " ... | \n",
+ "
\n",
+ " \n",
+ " 0 days 05:26:00 | \n",
+ " 27.105263 | \n",
+ " 1600 | \n",
+ "
\n",
+ " \n",
+ " 0 days 05:27:00 | \n",
+ " 26.052632 | \n",
+ " 1600 | \n",
+ "
\n",
+ " \n",
+ " 0 days 05:28:00 | \n",
+ " 25.0 | \n",
+ " 1600 | \n",
+ "
\n",
+ " \n",
+ " 0 days 05:29:00 | \n",
+ " 25.0 | \n",
+ " 1600 | \n",
+ "
\n",
+ " \n",
+ " 0 days 05:30:00 | \n",
+ " 25.0 | \n",
+ " 1600 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
331 rows × 2 columns
\n",
+ "
\n",
+ "
\n",
+ "\n",
+ "
\n",
+ "
\n",
+ " ►\n",
+ " Setpoints Plot\n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
Setpoints Plot
\n",
+ "
\n",
+ "
\n",
+ "\n",
+ "
\n",
+ " \n",
+ " "
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
"source": [
"tc_uv"
]
@@ -352,7 +618,7 @@
{
"data": {
"text/plain": [
- ""
+ ""
]
},
"execution_count": 14,
@@ -1192,7 +1458,7 @@
},
{
"cell_type": "code",
- "execution_count": 34,
+ "execution_count": 29,
"metadata": {},
"outputs": [],
"source": [
@@ -1226,7 +1492,7 @@
},
{
"cell_type": "code",
- "execution_count": 36,
+ "execution_count": 30,
"metadata": {},
"outputs": [
{
@@ -1257,27 +1523,27 @@
" \n",
" \n",
" 0 days 00:00:00 | \n",
- " 358.150000 | \n",
+ " 85.000000 | \n",
" 85.000000 | \n",
"
\n",
" \n",
" 0 days 00:01:00 | \n",
- " 359.195333 | \n",
+ " 86.045333 | \n",
" 82.493425 | \n",
"
\n",
" \n",
" 0 days 00:02:00 | \n",
- " 360.173250 | \n",
+ " 87.023250 | \n",
" 79.730607 | \n",
"
\n",
" \n",
" 0 days 00:03:00 | \n",
- " 361.088098 | \n",
+ " 87.938098 | \n",
" 77.033270 | \n",
"
\n",
" \n",
" 0 days 00:04:00 | \n",
- " 361.943944 | \n",
+ " 88.793944 | \n",
" 74.522821 | \n",
"
\n",
" \n",
@@ -1287,27 +1553,27 @@
"
\n",
" \n",
" 50 days 06:55:00 | \n",
- " 245.926548 | \n",
+ " -27.223452 | \n",
" 36.336043 | \n",
"
\n",
" \n",
" 50 days 06:56:00 | \n",
- " 245.984215 | \n",
+ " -27.165785 | \n",
" 36.261838 | \n",
"
\n",
" \n",
" 50 days 06:57:00 | \n",
- " 247.245000 | \n",
+ " -25.905000 | \n",
" 34.783481 | \n",
"
\n",
" \n",
" 50 days 06:58:00 | \n",
- " 248.601559 | \n",
+ " -24.548441 | \n",
" 33.286602 | \n",
"
\n",
" \n",
" 50 days 06:59:00 | \n",
- " 250.062289 | \n",
+ " -23.087711 | \n",
" 31.778878 | \n",
"
\n",
" \n",
@@ -1317,22 +1583,22 @@
],
"text/plain": [
" temperature relative_humidity\n",
- "0 days 00:00:00 358.150000 85.000000\n",
- "0 days 00:01:00 359.195333 82.493425\n",
- "0 days 00:02:00 360.173250 79.730607\n",
- "0 days 00:03:00 361.088098 77.033270\n",
- "0 days 00:04:00 361.943944 74.522821\n",
+ "0 days 00:00:00 85.000000 85.000000\n",
+ "0 days 00:01:00 86.045333 82.493425\n",
+ "0 days 00:02:00 87.023250 79.730607\n",
+ "0 days 00:03:00 87.938098 77.033270\n",
+ "0 days 00:04:00 88.793944 74.522821\n",
"... ... ...\n",
- "50 days 06:55:00 245.926548 36.336043\n",
- "50 days 06:56:00 245.984215 36.261838\n",
- "50 days 06:57:00 247.245000 34.783481\n",
- "50 days 06:58:00 248.601559 33.286602\n",
- "50 days 06:59:00 250.062289 31.778878\n",
+ "50 days 06:55:00 -27.223452 36.336043\n",
+ "50 days 06:56:00 -27.165785 36.261838\n",
+ "50 days 06:57:00 -25.905000 34.783481\n",
+ "50 days 06:58:00 -24.548441 33.286602\n",
+ "50 days 06:59:00 -23.087711 31.778878\n",
"\n",
"[72420 rows x 2 columns]"
]
},
- "execution_count": 36,
+ "execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
@@ -1345,7 +1611,7 @@
"conditions_df.columns = [\"temperature\", \"relative_humidity\"]\n",
"\n",
"# convert to kelvin\n",
- "conditions_df[\"temperature\"] += 273.15\n",
+ "# conditions_df[\"temperature\"] += 273.15\n",
"\n",
"# uncomment to view dataframe\n",
"conditions_df"
@@ -1353,7 +1619,7 @@
},
{
"cell_type": "code",
- "execution_count": 37,
+ "execution_count": 31,
"metadata": {},
"outputs": [
{
@@ -1362,7 +1628,7 @@
"3.1961485899633e-06"
]
},
- "execution_count": 37,
+ "execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
@@ -1395,7 +1661,7 @@
},
{
"cell_type": "code",
- "execution_count": 38,
+ "execution_count": 32,
"metadata": {},
"outputs": [
{
@@ -1431,7 +1697,7 @@
},
{
"cell_type": "code",
- "execution_count": 39,
+ "execution_count": 33,
"metadata": {},
"outputs": [
{
@@ -1459,7 +1725,7 @@
"Freq: h, Length: 8760, dtype: float64"
]
},
- "execution_count": 39,
+ "execution_count": 33,
"metadata": {},
"output_type": "execute_result"
}
@@ -1469,7 +1735,8 @@
"temp_module = pvdeg.temperature.temperature(\n",
" weather_df=weather_df,\n",
" meta=meta,\n",
- " cell_or_mod=\"module\"\n",
+ " cell_or_mod=\"module\",\n",
+ " conf = \"open_rack_glass_polymer\",\n",
")\n",
"\n",
"# fix index, tmy data has non-uniform timeseries data as a part of the way it is sampled, we want a consistently increasing index\n",
@@ -1481,7 +1748,7 @@
},
{
"cell_type": "code",
- "execution_count": 40,
+ "execution_count": 34,
"metadata": {},
"outputs": [
{
@@ -1631,7 +1898,7 @@
"[8760 rows x 4 columns]"
]
},
- "execution_count": 40,
+ "execution_count": 34,
"metadata": {},
"output_type": "execute_result"
}
@@ -1660,7 +1927,7 @@
},
{
"cell_type": "code",
- "execution_count": 41,
+ "execution_count": 35,
"metadata": {},
"outputs": [],
"source": [
@@ -1715,7 +1982,7 @@
},
{
"cell_type": "code",
- "execution_count": 42,
+ "execution_count": 36,
"metadata": {},
"outputs": [
{
@@ -2072,7 +2339,7 @@
"[10 rows x 122 columns]"
]
},
- "execution_count": 42,
+ "execution_count": 36,
"metadata": {},
"output_type": "execute_result"
}
@@ -2092,7 +2359,7 @@
},
{
"cell_type": "code",
- "execution_count": 43,
+ "execution_count": 40,
"metadata": {},
"outputs": [
{
@@ -2101,7 +2368,7 @@
"1.5815590853333936e-06"
]
},
- "execution_count": 43,
+ "execution_count": 40,
"metadata": {},
"output_type": "execute_result"
}
@@ -2111,7 +2378,7 @@
"miami_res = pvdeg.degradation.degradation(\n",
" spectra_df=miami_irr,\n",
" # we calculated these above the irradiance calculation and they are representative of the conditions on the module\n",
- " temp_module=temp_module + 273.15, # convert to K\n",
+ " temp_module=temp_module, # open rack termperature [C]\n",
" rh_module=rh_module[\"RH_back_encap\"]\n",
")\n",
"\n",
@@ -2120,7 +2387,7 @@
},
{
"cell_type": "code",
- "execution_count": 44,
+ "execution_count": 41,
"metadata": {},
"outputs": [
{
@@ -2129,7 +2396,7 @@
"(3.1961485899633e-06, 1.5815590853333936e-06)"
]
},
- "execution_count": 44,
+ "execution_count": 41,
"metadata": {},
"output_type": "execute_result"
}
@@ -2140,7 +2407,7 @@
},
{
"cell_type": "code",
- "execution_count": 45,
+ "execution_count": 42,
"metadata": {},
"outputs": [
{
@@ -2149,7 +2416,7 @@
"2.020884720402052"
]
},
- "execution_count": 45,
+ "execution_count": 42,
"metadata": {},
"output_type": "execute_result"
}
@@ -2159,13 +2426,6 @@
"\n",
"af"
]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
}
],
"metadata": {