Skip to content

Commit c9ce7b8

Browse files
committed
respond to comments
- add section to conclusions to warn users that TMY3 and NSRDB are also models, therefore not to assume differences are errors, and link to TMY3 & NSRDB documentation - use implicit targets to link to DISC, DIRINT, Erbs, & Boland sections - reverse change of scaled GHI by E0 to Gsc (aka: solar constant) - use math directive for DNI formula
1 parent cbb61bd commit c9ce7b8

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

docs/examples/plot_diffuse_fraction.py

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@
3939
temperature=greensboro.DryBulb)
4040

4141
# %%
42+
# pvlib Decomposition Functions
43+
# -----------------------------
4244
# Methods for separating DHI into diffuse and direct components include:
43-
# **DISC**, **DIRINT**, **Erbs** and **Boland**.
45+
# `DISC`_, `DIRINT`_, `Erbs`_, and `Boland`_.
4446

4547
# %%
4648
# DISC
@@ -89,7 +91,7 @@
8991

9092
# %%
9193
# Boland
92-
# ----
94+
# ------
9395
#
9496
# The Boland method, :py:func:`~pvlib.irradiance.boland` is a single logistic
9597
# exponential correlation that is continuously differentiable and bounded
@@ -103,20 +105,20 @@
103105
# Combine everything together.
104106

105107
dni_renames = {
106-
'DNI': 'TMY', 'dni_disc': 'DISC', 'dni_dirint': 'DIRINT',
108+
'DNI': 'TMY3', 'dni_disc': 'DISC', 'dni_dirint': 'DIRINT',
107109
'dni_erbs': 'Erbs', 'dni_boland': 'Boland'}
108110
dni = [
109111
greensboro.DNI, out_disc.dni_disc, out_dirint.dni_dirint,
110112
out_erbs.dni_erbs, out_boland.dni_boland]
111113
dni = pd.concat(dni, axis=1).rename(columns=dni_renames)
112114
dhi_renames = {
113-
'DHI': 'TMY', 'dhi_disc': 'DISC', 'dhi_dirint': 'DIRINT',
115+
'DHI': 'TMY3', 'dhi_disc': 'DISC', 'dhi_dirint': 'DIRINT',
114116
'dhi_erbs': 'Erbs', 'dhi_boland': 'Boland'}
115117
dhi = [
116118
greensboro.DHI, out_disc.dhi_disc, out_dirint.dhi_dirint,
117119
out_erbs.dhi_erbs, out_boland.dhi_boland]
118120
dhi = pd.concat(dhi, axis=1).rename(columns=dhi_renames)
119-
ghi_kt = pd.concat([greensboro.GHI/1366.1, out_erbs.kt], axis=1)
121+
ghi_kt = pd.concat([greensboro.GHI/1000.0, out_erbs.kt], axis=1)
120122

121123
# %%
122124
# Finally, let's plot them for a few winter days and compare
@@ -132,7 +134,7 @@
132134
ax[1].set_ylabel('DHI $[W/m^2]$')
133135
ghi_kt[JAN6AM:JAN6PM].plot(ax=ax[2])
134136
ax[2].grid(which='both')
135-
ax[2].set_ylabel(r'$\frac{GHI}{G_{SC}}, k_t$')
137+
ax[2].set_ylabel(r'$\frac{GHI}{E0}, k_t$')
136138
f.tight_layout()
137139

138140
# %%
@@ -172,17 +174,29 @@
172174
# %%
173175
# Conclusion
174176
# ----------
177+
# This example has compared several decomposition models to a TMY3 file for
178+
# Greensboro, North Carolina. However, DNI and DHI in the TMY3 file are
179+
# themselves the output of a model (either METSTAT or SUNY), and so differences
180+
# between *e.g.* DISC output and TMY3 shouldn't be regarded as an error in the
181+
# DISC model. Therefore, it's not a reasonable expectation to assume that the
182+
# four models should reproduce the TMY3 values. We refer those interested to
183+
# the `TMY3`_ and `NSRDB`_ user manuals.
184+
#
175185
# The Erbs and Boland are correlations with only kt, which is derived from the
176186
# horizontal component of the extra-terrestrial irradiance. Therefore at low
177187
# sun elevation (zenith ~ 90-deg), especially near sunset, this causes kt to
178188
# explode as the denominator approaches zero. This is controlled in pvlib by
179189
# setting ``min_cos_zenith`` and ``max_clearness_index`` which each have
180190
# reasonable defaults, but there are still concerning spikes at sunset for Jan.
181191
# 5th & 7th, April 4th, 5th, & 7th, and July 6th & 7th. The DISC & DIRINT
182-
# methods differ from Erbs and Boland be including airmass, which seems to
192+
# methods differ from Erbs and Boland by including airmass, which seems to
183193
# reduce DNI spikes over 1000[W/m^2], but still have errors at other times.
184194
#
185195
# Another difference is that DISC & DIRINT return DNI whereas Erbs & Boland
186196
# calculate the diffuse fraction which is then used to derive DNI from GHI and
187197
# the solar zenith, which exacerbates errors at low sun elevation due to the
188-
# relation: DNI = GHI*(1 - DF)/cos(zenith).
198+
# relation:
199+
# :math:`DNI = GHI \frac{1 - \mathit{DF}}{\cos \left(\mathit{zenith} \right)}`.
200+
#
201+
# .. _TMY3: https://www.nrel.gov/docs/fy08osti/43156.pdf
202+
# .. _NSRDB: https://www.nrel.gov/docs/fy12osti/54824.pdf

0 commit comments

Comments
 (0)