Skip to content

Commit 09a95d4

Browse files
committed
docs: update solar angle definitions in nomenclature
- Add detailed definitions for solar angles with range constraints - Clarify pvlib's east-of-north convention for azimuth angles - Add cross-references between related terms using :term: directive - Add coordinate system conventions for latitude/longitude - Enhance existing angle definitions with usage notes and examples This commit addresses issue #2448 by migrating angle definitions and conventions from parameter descriptions to the nomenclature page. (cherry picked from commit 16435c7)
1 parent a27c686 commit 09a95d4

File tree

2 files changed

+80
-10
lines changed

2 files changed

+80
-10
lines changed

docs/sphinx/source/user_guide/extras/nomenclature.rst

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,23 @@ There is a convention on consistent variable names throughout the library:
2222

2323
aoi
2424
Angle of incidence. Angle between the surface normal vector and the
25-
vector pointing towards the sun’s center
25+
vector pointing towards the sun's center. Must be >=0 and <=180 degrees.
26+
When the sun is behind the surface, the value is >90 degrees.
2627

2728
aoi_projection
28-
cos(aoi)
29+
cos(aoi). When the sun is behind the surface, the value is negative.
30+
For many uses, negative values must be set to zero.
2931

3032
ape
3133
Average photon energy
3234

3335
apparent_zenith
34-
Refraction-corrected solar zenith angle in degrees
36+
Refraction-corrected solar zenith angle in degrees. Must be >=0 and <=180.
37+
This angle accounts for atmospheric refraction effects.
38+
39+
apparent_elevation
40+
Refraction-corrected solar elevation angle in degrees. Must be >=-90 and <=90.
41+
This is the complement of apparent_zenith (90 - apparent_zenith).
3542

3643
bhi
3744
Beam/direct horizontal irradiance
@@ -87,10 +94,10 @@ There is a convention on consistent variable names throughout the library:
8794
Sandia Array Performance Model IV curve parameters
8895

8996
latitude
90-
Latitude
97+
Latitude in decimal degrees. Positive north of equator, negative to south.
9198

9299
longitude
93-
Longitude
100+
Longitude in decimal degrees. Positive east of prime meridian, negative to west.
94101

95102
pac, ac
96103
AC power
@@ -141,10 +148,14 @@ There is a convention on consistent variable names throughout the library:
141148
Diode saturation current
142149

143150
solar_azimuth
144-
Azimuth angle of the sun in degrees East of North
151+
Azimuth angle of the sun in degrees East of North. Must be >=0 and <=360.
152+
The convention is defined as degrees east of north (e.g. North = 0°,
153+
East = 90°, South = 180°, West = 270°).
145154

146155
solar_zenith
147-
Zenith angle of the sun in degrees
156+
Zenith angle of the sun in degrees. Must be >=0 and <=180.
157+
This is the angle between the sun's rays and the vertical direction.
158+
This is the complement of :term:`solar_elevation` (90 - elevation).
148159

149160
spectra
150161
spectra_components
@@ -154,11 +165,14 @@ There is a convention on consistent variable names throughout the library:
154165
is composed of direct and diffuse components.
155166

156167
surface_azimuth
157-
Azimuth angle of the surface
168+
Azimuth angle of the surface in degrees East of North. Must be >=0 and <=360.
169+
The convention is defined as degrees east (clockwise) of north. This is pvlib's
170+
convention; other tools may use different conventions. For example, North = 0°,
171+
East = 90°, South = 180°, West = 270°.
158172

159173
surface_tilt
160-
Panel tilt from horizontal [°]. For example, a surface facing up = 0°,
161-
surface facing horizon = 90°.
174+
Panel tilt from horizontal [°]. Must be >=0 and <=180.
175+
For example, a surface facing up = 0°, surface facing horizon = 90°.
162176

163177
temp_air
164178
Temperature of the air

example.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Simple pvlib demonstration script
2+
import pvlib
3+
import pandas as pd
4+
from datetime import datetime, timedelta
5+
import matplotlib.pyplot as plt
6+
7+
# Create a location object for a specific site
8+
location = pvlib.location.Location(
9+
latitude=40.0, # New York City latitude
10+
longitude=-74.0, # New York City longitude
11+
tz='America/New_York',
12+
altitude=10 # meters above sea level
13+
)
14+
15+
# Calculate solar position for a day
16+
date = datetime(2024, 3, 15)
17+
times = pd.date_range(date, date + timedelta(days=1), freq='1H', tz=location.tz)
18+
solpos = location.get_solarposition(times)
19+
20+
# Plot solar position
21+
plt.figure(figsize=(10, 6))
22+
plt.plot(solpos.index, solpos['elevation'], label='Elevation')
23+
plt.plot(solpos.index, solpos['azimuth'], label='Azimuth')
24+
plt.title('Solar Position for New York City on March 15, 2024')
25+
plt.xlabel('Time')
26+
plt.ylabel('Angle (degrees)')
27+
plt.legend()
28+
plt.grid(True)
29+
plt.show()
30+
31+
# Calculate clear sky irradiance
32+
clearsky = location.get_clearsky(times)
33+
34+
# Plot clear sky irradiance
35+
plt.figure(figsize=(10, 6))
36+
plt.plot(clearsky.index, clearsky['ghi'], label='Global Horizontal Irradiance')
37+
plt.plot(clearsky.index, clearsky['dni'], label='Direct Normal Irradiance')
38+
plt.plot(clearsky.index, clearsky['dhi'], label='Diffuse Horizontal Irradiance')
39+
plt.title('Clear Sky Irradiance for New York City on March 15, 2024')
40+
plt.xlabel('Time')
41+
plt.ylabel('Irradiance (W/m²)')
42+
plt.legend()
43+
plt.grid(True)
44+
plt.show()
45+
46+
# Print some basic information
47+
print("\nSolar Position at Solar Noon:")
48+
noon_idx = solpos['elevation'].idxmax()
49+
print(f"Time: {noon_idx}")
50+
print(f"Elevation: {solpos.loc[noon_idx, 'elevation']:.2f}°")
51+
print(f"Azimuth: {solpos.loc[noon_idx, 'azimuth']:.2f}°")
52+
53+
print("\nMaximum Clear Sky Irradiance:")
54+
print(f"GHI: {clearsky['ghi'].max():.2f} W/m²")
55+
print(f"DNI: {clearsky['dni'].max():.2f} W/m²")
56+
print(f"DHI: {clearsky['dhi'].max():.2f} W/m²")

0 commit comments

Comments
 (0)