Skip to content

Commit 5995974

Browse files
committed
Fix rendering
1 parent e07b8c7 commit 5995974

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

docs/examples/agrivoltaics/plot_agrivoltaics_ground_irradiance.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# for an agriPV system using pvlib's infinite sheds model.
1111
# For an overview of agrivPV concepts and performance, the reader
1212
# is referred to :doi:`10.69766/XAEU5008`.
13-
13+
#
1414
# The first steps is to define the plant location and calculate solar position
1515
# and clearsky irradiance for a single day as an example.
1616
#
@@ -23,6 +23,7 @@
2323
# *Source: Adam R. Jensen*
2424

2525
import pvlib
26+
from pvlib.tools import cosd
2627
import pandas as pd
2728
import matplotlib.pyplot as plt
2829

@@ -55,7 +56,7 @@
5556
max_angle=max_angle,
5657
backtrack=True,
5758
gcr=gcr,
58-
)
59+
)
5960

6061
# %%
6162
# For agrivPV systems, the local albedo is dependent on crop growth and thus
@@ -125,8 +126,6 @@
125126
# ground and second we calculate the fraction of the ground that is unshaded
126127
# (i.e., receives DNI).
127128

128-
from pvlib.tools import cosd
129-
130129
vf_ground_sky = pvlib.bifacial.utils.vf_ground_sky_2d_integ(
131130
surface_tilt=tracking_orientations['surface_tilt'],
132131
gcr=gcr,
@@ -142,9 +141,9 @@
142141
gcr=gcr,
143142
)
144143

145-
crop_avg_irradiance = (
146-
unshaded_ground_fraction * clearsky['dni'] * cosd(solpos['apparent_zenith'])
147-
+ vf_ground_sky * clearsky['dhi'])
144+
crop_avg_irradiance = (unshaded_ground_fraction * clearsky['dni']
145+
* cosd(solpos['apparent_zenith'])
146+
+ vf_ground_sky * clearsky['dhi'])
148147

149148
fig, ax = plt.subplots()
150149
clearsky['ghi'].plot(ax=ax, label='Horizontal irradiance above panels')

0 commit comments

Comments
 (0)