19
19
20
20
from pvlib import tools
21
21
from pvlib .location import Location
22
+ from pvlib import irradiance
22
23
23
24
24
25
# not sure if this belongs in the pvsystem module.
@@ -62,14 +63,23 @@ class PVSystem(Location):
62
63
name : None or string.
63
64
Sets the name attribute of the PVSystem object.
64
65
65
- surface_tilt: None, float, or array-like
66
+ surface_tilt: float or array-like
66
67
Tilt angle of the module surface.
67
68
Up=0, horizon=90.
68
69
69
- surface_azimuth: None, float, or array-like
70
+ surface_azimuth: float or array-like
70
71
Azimuth angle of the module surface.
71
72
North=0, East=90, South=180, West=270.
72
73
74
+ albedo : None, float
75
+ The ground albedo. If ``None``, will attempt to use
76
+ ``surface_type`` and ``irradiance.SURFACE_ALBEDOS``
77
+ to lookup albedo.
78
+
79
+ surface_type : None, string
80
+ The ground surface type. See ``irradiance.SURFACE_ALBEDOS``
81
+ for valid values.
82
+
73
83
module : None, string
74
84
The model name of the modules.
75
85
May be used to look up the module_parameters dictionary
@@ -100,16 +110,27 @@ class PVSystem(Location):
100
110
"""
101
111
102
112
def __init__ (self , latitude , longitude , tz = 'UTC' , altitude = 0 ,
103
- name = None , module = None , module_parameters = None ,
113
+ name = None ,
114
+ surface_tilt = 0 , surface_azimuth = 180 ,
115
+ albedo = None , surface_type = None ,
116
+ module = None , module_parameters = None ,
104
117
inverter = None , inverter_parameters = None ,
105
- racking_model = None , ** kwargs ):
118
+ racking_model = None ,
119
+ ** kwargs ):
106
120
107
121
super (PVSystem , self ).__init__ (latitude , longitude , tz = tz ,
108
122
altitude = altitude , name = name )
109
123
110
124
self .surface_tilt = surface_tilt
111
125
self .surface_azimuth = surface_azimuth
112
126
127
+ # could tie these together with @property
128
+ self .surface_type = surface_type
129
+ if albedo is None :
130
+ self .albedo = irradiance .SURFACE_ALBEDOS .get (surface_type , 0.25 )
131
+ else :
132
+ self .albedo = albedo
133
+
113
134
# could tie these together with @property
114
135
self .module = module
115
136
self .module_parameters = module_parameters
@@ -121,8 +142,55 @@ def __init__(self, latitude, longitude, tz='UTC', altitude=0,
121
142
122
143
# makes self.some_parameter = some_value for everything in kwargs
123
144
[setattr (self , k , v ) for k , v in kwargs .items ()]
124
-
125
-
145
+
146
+
147
+ def get_irradiance (self , solar_zenith , solar_azimuth , dni , ghi , dhi ,
148
+ dni_extra = None , airmass = None , model = 'isotropic' ,
149
+ ** kwargs ):
150
+ """
151
+ Uses the :func:`irradiance.total_irrad` function to calculate
152
+ the plane of array irradiance components on a tilted surface
153
+ defined by
154
+ ``self.surface_tilt``, ``self.surface_azimuth``, and
155
+ ``self.albedo``.
156
+
157
+ Parameters
158
+ ----------
159
+ solar_zenith : float or Series.
160
+ Solar zenith angle.
161
+ solar_azimuth : float or Series.
162
+ Solar azimuth angle.
163
+ dni : float or Series
164
+ Direct Normal Irradiance
165
+ ghi : float or Series
166
+ Global horizontal irradiance
167
+ dhi : float or Series
168
+ Diffuse horizontal irradiance
169
+ dni_extra : float or Series
170
+ Extraterrestrial direct normal irradiance
171
+ airmass : float or Series
172
+ Airmass
173
+ model : String
174
+ Irradiance model.
175
+
176
+ kwargs passed to :func:`irradiance.total_irrad`.
177
+
178
+ Returns
179
+ -------
180
+ poa_irradiance : DataFrame
181
+ Column names are: ``total, beam, sky, ground``.
182
+ """
183
+
184
+ return irradiance .total_irrad (self .surface_tilt ,
185
+ self .surface_azimuth ,
186
+ solar_zenith , solar_azimuth ,
187
+ dni , ghi , dhi ,
188
+ dni_extra = dni_extra , airmass = airmass ,
189
+ model = model ,
190
+ albedo = self .albedo ,
191
+ ** kwargs )
192
+
193
+
126
194
# defaults to kwargs, falls back to attributes. complicated.
127
195
# harder to support?
128
196
def ashraeiam (self , ** kwargs ):
@@ -132,56 +200,123 @@ def ashraeiam(self, **kwargs):
132
200
----------
133
201
kwargs : None, b, a
134
202
See pvsystem.ashraeiam for details
203
+
204
+ Returns
205
+ -------
206
+ See pvsystem.ashraeiam for details
135
207
"""
136
208
return ashraeiam (kwargs .pop ('b' , self .b ), kwargs .pop ('aoi' , self .aoi ))
137
209
138
210
139
211
# thin wrappers of other pvsystem functions
140
212
def physicaliam (self , aoi ):
141
-
213
+ """Wrapper around the physicaliam function.
214
+
215
+ Parameters
216
+ ----------
217
+ See pvsystem.physicaliam for details
218
+
219
+ Returns
220
+ -------
221
+ See pvsystem.physicaliam for details
222
+ """
142
223
return physicaliam (K , L , n , aoi )
143
224
144
225
145
226
def calcparams_desoto (self , poa_global , temp_cell , alpha_isc ,
146
227
module_parameters ,
147
228
EgRef , dEgdT , M = 1 , irrad_ref = 1000 , temp_ref = 25 ):
148
-
229
+ """Wrapper around the calcparams_desoto function.
230
+
231
+ Parameters
232
+ ----------
233
+ See pvsystem.calcparams_desoto for details
234
+
235
+ Returns
236
+ -------
237
+ See pvsystem.calcparams_desoto for details
238
+ """
149
239
return calcparams_desoto (poa_global , temp_cell , alpha_isc ,
150
240
module_parameters ,
151
- EgRef , dEgdT , M , irrad_ref , temp_ref ):
241
+ EgRef , dEgdT , M , irrad_ref , temp_ref )
152
242
153
243
154
244
def sapm (self , module , poa_direct , poa_diffuse ,
155
245
temp_cell , airmass_absolute , aoi ):
246
+ """Wrapper around the sapm function.
247
+
248
+ Parameters
249
+ ----------
250
+ See pvsystem.sapm for details
156
251
252
+ Returns
253
+ -------
254
+ See pvsystem.sapm for details
255
+ """
157
256
return sapm (module , poa_direct , poa_diffuse ,
158
257
temp_cell , airmass_absolute , aoi )
159
258
160
259
161
260
# model now specified by self.racking_model
162
261
def sapm_celltemp (self , irrad , wind , temp ):
163
-
262
+ """Wrapper around the sapm_celltemp function.
263
+
264
+ Parameters
265
+ ----------
266
+ See pvsystem.sapm_celltemp for details
267
+
268
+ Returns
269
+ -------
270
+ See pvsystem.sapm_celltemp for details
271
+ """
164
272
return sapm_celltemp (irrad , wind , temp , self .racking_model )
165
273
166
274
167
275
def singlediode (self , photocurrent , saturation_current ,
168
276
resistance_series , resistance_shunt , nNsVth ):
169
-
277
+ """Wrapper around the singlediode function.
278
+
279
+ Parameters
280
+ ----------
281
+ See pvsystem.singlediode for details
282
+
283
+ Returns
284
+ -------
285
+ See pvsystem.singlediode for details
286
+ """
170
287
return singlediode (self .module_parameters , photocurrent ,
171
288
saturation_current ,
172
289
resistance_series , resistance_shunt , nNsVth )
173
290
174
291
175
292
def i_from_v (self , resistance_shunt , resistance_series , nNsVth , voltage ,
176
293
saturation_current , photocurrent ):
177
-
294
+ """Wrapper around the i_from_v function.
295
+
296
+ Parameters
297
+ ----------
298
+ See pvsystem.i_from_v for details
299
+
300
+ Returns
301
+ -------
302
+ See pvsystem.i_from_v for details
303
+ """
178
304
return i_from_v (resistance_shunt , resistance_series , nNsVth , voltage ,
179
305
saturation_current , photocurrent )
180
306
181
307
182
308
# inverter now specified by self.inverter_parameters
183
309
def snlinverter (self , v_dc , p_dc ):
184
-
310
+ """Wrapper around the snlinverter function.
311
+
312
+ Parameters
313
+ ----------
314
+ See pvsystem.snlinverter for details
315
+
316
+ Returns
317
+ -------
318
+ See pvsystem.snlinverter for details
319
+ """
185
320
return snlinverter (self .inverter_parameters , v_dc , p_dc )
186
321
187
322
0 commit comments