3
3
Clear sky
4
4
=========
5
5
6
- Clear sky irradiance data is essential to many PV modeling tasks. Here, we
7
- review the clear sky modeling capabilities of pvlib-python. The
8
- :ref: `location ` section demonstrates the easiest way to obtain a time
9
- series of clear sky data for a location. The :ref: `ineichen ` and
10
- :ref: `simplified_solis ` sections detail the clear sky algorithms and
11
- input data.
6
+ This section reviews the clear sky modeling capabilities of
7
+ pvlib-python.
8
+
9
+ pvlib-python supports two ways to generate clear sky irradiance:
10
+
11
+ 1. A :py:class: `~pvlib.location.Location ` object's
12
+ :py:meth: `~pvlib.location.Location.get_clearsky ` method.
13
+ 2. The functions contained within the :py:mod: `~pvlib.clearsky ` module,
14
+ including :py:func: `~pvlib.clearsky.ineichen ` and
15
+ :py:func: `~pvlib.clearsky.simplified_solis `.
16
+
17
+ Users that work with simple time series data may prefer to use
18
+ :py:meth: `~pvlib.location.Location.get_clearsky `, while users
19
+ that want finer control, more explicit code, or work with
20
+ multidimensional data may prefer to use the basic functions.
21
+
22
+ The :ref: `location ` subsection demonstrates the easiest
23
+ way to obtain a time series of clear sky data for a location.
24
+ The :ref: `ineichen ` and :ref: `simplified_solis ` subsections detail the
25
+ clear sky algorithms and input data.
12
26
13
27
We'll need these imports for the examples below.
14
28
@@ -40,7 +54,8 @@ The easiest way to obtain a time series of clear sky irradiance is to use a
40
54
work of calculating solar position, extraterrestrial irradiance,
41
55
airmass, and atmospheric pressure, as appropriate, leaving the user to
42
56
only specify the most important parameters: time and atmospheric
43
- attenuation.
57
+ attenuation. The time input must be a :py:class: `pandas.DatetimeIndex `,
58
+ while the atmospheric attenuation inputs may be constants or arrays.
44
59
45
60
.. ipython :: python
46
61
@@ -80,11 +95,12 @@ See the sections below for more detail on the clear sky models.
80
95
81
96
.. _ineichen :
82
97
83
- Ineichen
84
- --------
98
+ Ineichen and Perez
99
+ ------------------
85
100
86
- The Ineichen and Perez clear sky model parameterizes irradiance
87
- in terms of the Linke turbidity [Ine02 ]_.
101
+ The Ineichen and Perez clear sky model parameterizes irradiance in terms
102
+ of the Linke turbidity [Ine02 ]_. pvlib-python implements this model in
103
+ the :py:func: `pvlib.clearsky.ineichen ` function.
88
104
89
105
Turbidity data
90
106
^^^^^^^^^^^^^^
@@ -103,11 +119,12 @@ the year. You could run it in a loop to create plots for all months.
103
119
filepath = os.path.join(pvlib_path, ' data' , ' LinkeTurbidities.mat' )
104
120
105
121
mat = scipy.io.loadmat(filepath)
122
+ # data is in units of 20 x turbidity
106
123
linke_turbidity_table = mat[' LinkeTurbidity' ] / 20 .
107
124
108
125
month = 1
109
126
plt.imshow(linke_turbidity_table[:, :, month- 1 ], vmin = 1 , vmax = 5 );
110
- plt.title(calendar.month_name[1 + month]);
127
+ plt.title(' Linke turbidity, ' + calendar.month_name[1 + month]);
111
128
plt.colorbar(shrink = 0.5 );
112
129
plt.tight_layout();
113
130
@savefig turbidity -1.png width=10in
@@ -117,7 +134,7 @@ the year. You could run it in a loop to create plots for all months.
117
134
118
135
month = 7
119
136
plt.imshow(linke_turbidity_table[:, :, month- 1 ], vmin = 1 , vmax = 5 );
120
- plt.title(calendar.month_name[month]);
137
+ plt.title(' Linke turbidity, ' + calendar.month_name[month]);
121
138
plt.colorbar(shrink = 0.5 );
122
139
plt.tight_layout();
123
140
@savefig turbidity -7.png width=10in
@@ -129,9 +146,9 @@ turbidity value for that time at those coordinates. By default, the
129
146
:py:func: `~pvlib.clearsky.lookup_linke_turbidity ` function will linearly
130
147
interpolate turbidity from month to month. This removes discontinuities
131
148
in multi-month PV models. Here's a plot of a few locations in the
132
- Southwest U.S. with and without interpolation. We have intentionally
133
- shown points that are relatively close so that you can get a sense of
134
- the variability of the data set.
149
+ Southwest U.S. with and without interpolation. We chose points that are
150
+ relatively close so that you can get a better sense of the spatial
151
+ variability of the data set.
135
152
136
153
.. ipython :: python
137
154
@@ -174,7 +191,7 @@ A clear sky time series using basic pvlib functions.
174
191
linke_turbidity = pvlib.clearsky.lookup_linke_turbidity(times, latitude, longitude)
175
192
dni_extra = pvlib.irradiance.extraradiation(apparent_zenith.index.dayofyear)
176
193
177
- # an input is a Series, so solis is a DataFrame
194
+ # an input is a pandas Series, so solis is a DataFrame
178
195
ineichen = clearsky.ineichen(apparent_zenith, airmass, linke_turbidity,
179
196
altitude, dni_extra)
180
197
ax = ineichen.plot();
@@ -183,9 +200,9 @@ A clear sky time series using basic pvlib functions.
183
200
@savefig ineichen -vs-time-climo.png width=6in
184
201
plt.show();
185
202
186
- The function respects the input types . Array input results in an OrderedDict
187
- of array output, and Series input results in a DataFrame output. The keys
188
- are 'ghi', 'dni', and 'dhi'.
203
+ The input data types determine the returned output type . Array input
204
+ results in an OrderedDict of array output, and Series input results in a
205
+ DataFrame output. The keys are 'ghi', 'dni', and 'dhi'.
189
206
190
207
Grid with a clear sky irradiance for a few turbidity values.
191
208
@@ -239,7 +256,9 @@ Simplified Solis
239
256
----------------
240
257
241
258
The Simplified Solis model parameterizes irradiance in terms of
242
- precipitable water and aerosol optical depth [Ine08ss ]_.
259
+ precipitable water and aerosol optical depth [Ine08ss ]_. pvlib-python
260
+ implements this model in the :py:func: `pvlib.clearsky.simplified_solis `
261
+ function.
243
262
244
263
Aerosol and precipitable water data
245
264
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -289,9 +308,9 @@ A clear sky time series using basic pvlib functions.
289
308
@savefig solis -vs-time-0.1-1.png width=6in
290
309
plt.show();
291
310
292
- The function respects the input types . Array input results in an OrderedDict
293
- of array output, and Series input results in a DataFrame output. The keys
294
- are 'ghi', 'dni', and 'dhi'.
311
+ The input data types determine the returned output type . Array input
312
+ results in an OrderedDict of array output, and Series input results in a
313
+ DataFrame output. The keys are 'ghi', 'dni', and 'dhi'.
295
314
296
315
Irradiance as a function of solar elevation.
297
316
0 commit comments