3 - Spectral Degradation#
Requirements:
spectral irradiance (measured or simulated)
wavelengths of spectral irradiance data
module RH
module temperature
Objectives:
Read in spectral irradiance
Calculate spectral degradation
# if running on google colab, uncomment the next line and execute this cell to install the dependencies and prevent "ModuleNotFoundError" in later cells:
# !pip install pvdeg==0.3.2
import os
import pandas as pd
import numpy as np
import pvdeg
from pvdeg import DATA_DIR
C:\Users\mspringe\AppData\Local\Temp\1\ipykernel_28892\2650314182.py:2: DeprecationWarning:
Pyarrow will become a required dependency of pandas in the next major release of pandas (pandas 3.0),
(to allow more performant data types, such as the Arrow string type, and better interoperability with other libraries)
but was not found to be installed on your system.
If this would cause problems for you,
please provide us feedback at https://github.com/pandas-dev/pandas/issues/54466
import pandas as pd
# This information helps with debugging and getting support :)
import sys, platform
print("Working on a ", platform.system(), platform.release())
print("Python version ", sys.version)
print("Pandas version ", pd.__version__)
print("pvdeg version ", pvdeg.__version__)
Working on a Windows 10
Python version 3.11.7 | packaged by Anaconda, Inc. | (main, Dec 15 2023, 18:05:47) [MSC v.1916 64 bit (AMD64)]
Pandas version 2.2.0
pvdeg version 0.2.4.dev83+ge2ceab9.d20240422
1. Read in spectral irradiance data#
Spectral degradation has 4 main requirements:
Spectral Irradiance [W/m^2 nm]
Wavelength [nm]
Module Relative Humidity [%]
Module Temperature [C]
For more advanced scenarios, you may want to calculate the degradation of a particular layer within the module. Below, we are using backside irradiance and therefore a slightly different temperature and humidity have been calculated. To calculate degradation on the backside, we used pvdeg.humidity.rh_backsheet
. For the the front side, you should use pvdeg.humidity.rh_surface_outside
or rh_front_encap
For this tutorial we are using pre-generated data from a ray-tracing simulation. To calculate the degradation rate, we will need the wavelengths used in the simulation.
wavelengths = np.array(range(280,420,20))
SPECTRA = pd.read_csv(os.path.join(DATA_DIR,'spectra.csv'), header=0, index_col=0)
SPECTRA.head()
Spectra | Temperature | RH | |
---|---|---|---|
timestamp | |||
2021-03-09 10:00:00 | [0.6892146677599185, 0.40215646494410884, 0.67... | 45 | 59 |
2021-03-09 11:00:00 | [0.15575709102178648, 0.5464374649246564, 0.68... | 44 | 56 |
2021-03-09 12:00:00 | [0.22782105874481207, 0.9056495270031296, 0.26... | 59 | 39 |
2021-03-09 13:00:00 | [0.3741943134512433, 0.035830980984344674, 0.4... | 44 | 13 |
2021-03-09 14:00:00 | [0.40321187996337626, 0.6473167864022122, 0.69... | 25 | 39 |
2. Calculate Degradation#
The spectral degradation function has several optional paramters. For more information, refer to the documentation. Below is a function call with the minimum required information.
degradation = pvdeg.degradation.degradation(spectra=SPECTRA['Spectra'],
rh_module=SPECTRA['RH'],
temp_module=SPECTRA['Temperature'],
wavelengths=wavelengths)
Removing brackets from spectral irradiance data