As I delved deeper into solar pv design, I felt the need to understand and reproduce how the solar pv power output given on websites such as the Global Solar Atlas and the NREL NSRDB is calculated. Solar pv panels converts solar irradiance to power. Thus the first step is to understand solar irradiance.
Solar Irradiance
Solar irradiance incidental on a solar panel is described by three components : Direct Normal Irradiance (DNI), Diffuse Horizontal Irradiance (DHI), and Global Horizontal Irradiance (GHI):
- Direct Normal Irradiance (DNI): This is the amount of solar radiation received per unit area by a surface that is always held perpendicular (normal) to the direction of the sun.
- Diffuse Horizontal Irradiance (DHI): This is the amount of solar radiation received per unit area by a surface that does not arrive on a direct path from the sun, but has been scattered by molecules and particles in the atmosphere and arrives at the surface from all directions.
- Global Horizontal Irradiance (GHI): This is the total amount of shortwave radiation received from above by a horizontal surface. It is the sum of direct (beam) and diffuse horizontal irradiance.
To calculate the total irradiance on a tilted solar panel, you would use both DNI and DHI, along with the angle of the solar panel with respect to the ground, in the following formula:
![]()
The elevation Angle of the sun above the horizon plays a critical role in calculating the effective irradiance on a solar panel. The elevation angle is the angle between the sun’s rays and the horizontal plane. It varies throughout the day and is affected by geographical location and the time of year. An elevation angle of 0° means the sun is on the horizon, while an elevation angle of 90° means the sun is directly overhead.
The Incident Angle is the angle between the sun’s rays and the normal (perpendicular) to the surface of the solar panel. The incident angle is crucial for determining how much solar radiation hits the panel directly. You can calculate the incident angle using the elevation angle and the tilt angle of the solar panel. If the panel is facing directly towards the equator, the incident angle (θ) can be calculated as:
![]()
Here, the azimuth difference is the difference between the solar azimuth angle and the azimuth angle of the panel. If the panel is oriented towards the equator, this difference could be minimal.
The Direct Normal Irradiance (DNI) component of solar radiation is most affected by the incident angle and is adjusted into the Effective DNI that hits the panel as follows :
![]()
Total Effective Irradiance is calculated by combining the effective DNI with the Diffuse Horizontal Irradiance (DHI) and a component of the Global Horizontal Irradiance (GHI) as follows:
This formula assumes that a portion of GHI (excluding DHI) hits the panel directly and the rest comes as diffuse radiation.
The Power Output is estimated using the total effective irradiance and the panel’s rated power, assuming standard conditions as follows:
![]()
Computing the Irradiance
On the NREL NSRDB website, one can download files that contain the data required to compute the total effective irradiance using the data viewer or APIs. I’m using the “METEOSAT IODC Region: Physical Solar Model (PSM)” and downloaded the 2019 file Lubumbashi, in DR Congo, with data recorded at 60minutes interval. The file contains the input required, namely the elevation, the DNI, DHI and GHI givens on an hourly interval for the full year.
I used a Python script to compute the total irradiance and can be viewed or downloaded from github on the following link: python_script.
The script hinges on several key Python libraries:
- Pandas: Data manipulation and analysis.
- ephem: Used for performing high-precision astronomy computations.
- datetime and math: Standard libraries for handling time-related data and mathematical operations.
The script has key functions:
- Effective Irradiance Computation: The effective_irradiance function calculates the irradiance received by a solar panel, considering both the direct and diffuse components of sunlight. It incorporates solar elevation and panel tilt angle into its calculations, crucial factors that affect a panel’s solar gain.
- Solar Position Calculation: Using ephem, solar_position function computes the sun’s position in the sky at any given moment. This is vital for determining the incident angle of sunlight on the panel.
- Data Processing and Timestamp Indexing: The script reads solar irradiance data from a *.csv file, transforming it into a structured format using pandas. It converts specific columns into a timestamp index, allowing for time-series analysis of the irradiance data.
Overall Process. The script initially reads location data (latitude, longitude, and elevation) from the *csv file with the weather data downloaded from NSRDB, transform the data and then computes the effective irradiance for each timestamp.
The following graph shows the effective irradiance for the 1st of June.

For a 550W panel, the power output will be calculated as follows:
![]()
Plotting it will give the following daily output:
