Skip to content

Commit e23662d

Browse files
committed
respond to comments
- revise & condense conclusions, don't refer to differences as errors without operational data - add header before plots section, explain why comparing normalized GHI - add subheaders for seasonal plots
1 parent c9ce7b8 commit e23662d

File tree

1 file changed

+33
-22
lines changed

1 file changed

+33
-22
lines changed

docs/examples/plot_diffuse_fraction.py

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,15 @@
102102
columns={'dni': 'dni_boland', 'dhi': 'dhi_boland'})
103103

104104
# %%
105-
# Combine everything together.
105+
# Comparison Plots
106+
# ----------------
107+
# In the plots below we compare the four decomposition models to the TMY3 file
108+
# for Greensboro, North Carolina. We also compare the clearness index, kt, with
109+
# GHI normalized by a reference irradiance, E0 = 1000 [W/m^2], to highlight
110+
# spikes caused when cosine of zenith approaches zero, particularly at sunset.
111+
#
112+
# First we combine the dataframes for the decomposition models and the TMY3
113+
# file together to make plotting easier.
106114

107115
dni_renames = {
108116
'DNI': 'TMY3', 'dni_disc': 'DISC', 'dni_dirint': 'DIRINT',
@@ -121,6 +129,8 @@
121129
ghi_kt = pd.concat([greensboro.GHI/1000.0, out_erbs.kt], axis=1)
122130

123131
# %%
132+
# Winter
133+
# ++++++
124134
# Finally, let's plot them for a few winter days and compare
125135

126136
JAN6AM, JAN6PM = '1990-01-04 00:00:00-05:00', '1990-01-07 23:59:59-05:00'
@@ -138,6 +148,8 @@
138148
f.tight_layout()
139149

140150
# %%
151+
# Spring
152+
# ++++++
141153
# And a few spring days ...
142154

143155
APR6AM, APR6PM = '1990-04-04 00:00:00-05:00', '1990-04-07 23:59:59-05:00'
@@ -155,6 +167,8 @@
155167
f.tight_layout()
156168

157169
# %%
170+
# Summer
171+
# ++++++
158172
# And few summer days to finish off the seasons.
159173

160174
JUL6AM, JUL6PM = '1990-07-04 00:00:00-05:00', '1990-07-07 23:59:59-05:00'
@@ -174,29 +188,26 @@
174188
# %%
175189
# Conclusion
176190
# ----------
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.
191+
# This example compares several decomposition models to a TMY3 file for
192+
# Greensboro, North Carolina. However, DNI and DHI in TMY3 files are themselves
193+
# the output of models (either METSTAT or SUNY), and so differences between
194+
# *e.g.* DISC output and the TMY3 file shouldn't be regarded as errors, and
195+
# it's not a reasonable expectation to assume that the four models should
196+
# reproduce the TMY3 values. We refer those interested to the `TMY3`_ and
197+
# `NSRDB`_ user manuals.
184198
#
185-
# The Erbs and Boland are correlations with only kt, which is derived from the
186-
# horizontal component of the extra-terrestrial irradiance. Therefore at low
187-
# sun elevation (zenith ~ 90-deg), especially near sunset, this causes kt to
188-
# explode as the denominator approaches zero. This is controlled in pvlib by
189-
# setting ``min_cos_zenith`` and ``max_clearness_index`` which each have
190-
# reasonable defaults, but there are still concerning spikes at sunset for Jan.
191-
# 5th & 7th, April 4th, 5th, & 7th, and July 6th & 7th. The DISC & DIRINT
192-
# methods differ from Erbs and Boland by including airmass, which seems to
193-
# reduce DNI spikes over 1000[W/m^2], but still have errors at other times.
199+
# The Erbs and Boland models are correlations with only kt, which is derived
200+
# from the horizontal component of the extra-terrestrial irradiance. At low sun
201+
# elevation (zenith near 90 degrees), especially near sunset, kt can explode
202+
# because the denominator (extra-terrestrial irradiance) approaches zero. In
203+
# pvlib this behavior is moderated by ``min_cos_zenith`` and
204+
# ``max_clearness_index`` which each have reasonable defaults. Even so, near
205+
# sunset there are still spikes in kt and DNI from Erbs and Boland for Jan. 5th
206+
# & 7th, April 4th, 5th, & 7th, and July 6th & 7th.
194207
#
195-
# Another difference is that DISC & DIRINT return DNI whereas Erbs & Boland
196-
# calculate the diffuse fraction which is then used to derive DNI from GHI and
197-
# the solar zenith, which exacerbates errors at low sun elevation due to the
198-
# relation:
199-
# :math:`DNI = GHI \frac{1 - \mathit{DF}}{\cos \left(\mathit{zenith} \right)}`.
208+
# By contrast, the DISC and DIRINT methods estimate DNI first by means of
209+
# correlations, which include additional variables such as airmass. These methods
210+
# seem to reduce DNI spikes over 1000 [W/m^2].
200211
#
201212
# .. _TMY3: https://www.nrel.gov/docs/fy08osti/43156.pdf
202213
# .. _NSRDB: https://www.nrel.gov/docs/fy12osti/54824.pdf

0 commit comments

Comments
 (0)