14
14
from pvlib import atmosphere , solarposition , tools
15
15
16
16
17
- # see References section of grounddiffuse function
17
+ # see References section of get_ground_diffuse function
18
18
SURFACE_ALBEDOS = {'urban' : 0.18 ,
19
19
'grass' : 0.20 ,
20
20
'fresh grass' : 0.26 ,
@@ -326,38 +326,51 @@ def get_total_irradiance(surface_tilt, surface_azimuth,
326
326
Parameters
327
327
----------
328
328
surface_tilt : numeric
329
- Panel tilt from horizontal.
329
+ Panel tilt from horizontal. [degree]
330
330
surface_azimuth : numeric
331
- Panel azimuth from north.
331
+ Panel azimuth from north. [degree]
332
332
solar_zenith : numeric
333
- Solar zenith angle.
333
+ Solar zenith angle. [degree]
334
334
solar_azimuth : numeric
335
- Solar azimuth angle.
335
+ Solar azimuth angle. [degree]
336
336
dni : numeric
337
- Direct Normal Irradiance
337
+ Direct Normal Irradiance. [W/m2]
338
338
ghi : numeric
339
- Global horizontal irradiance
339
+ Global horizontal irradiance. [W/m2]
340
340
dhi : numeric
341
- Diffuse horizontal irradiance
341
+ Diffuse horizontal irradiance. [W/m2]
342
342
dni_extra : None or numeric, default None
343
- Extraterrestrial direct normal irradiance
343
+ Extraterrestrial direct normal irradiance. [W/m2]
344
344
airmass : None or numeric, default None
345
- Airmass
345
+ Relative airmass (not adjusted for pressure). [unitless]
346
346
albedo : numeric, default 0.25
347
- Surface albedo
348
- surface_type : None or String, default None
349
- Surface type. See grounddiffuse.
350
- model : String, default 'isotropic'
351
- Irradiance model.
352
- model_perez : String, default 'allsitescomposite1990'
353
- Used only if model='perez'. See :py:func:`perez`.
347
+ Surface albedo. [unitless]
348
+ surface_type : None or str, default None
349
+ Surface type. See :py:func:`~pvlib.irradiance.get_ground_diffuse` for
350
+ the list of accepted values.
351
+ model : str, default 'isotropic'
352
+ Irradiance model. Can be one of ``'isotropic'``, ``'klucher'``,
353
+ ``'haydavies'``, ``'reindl'``, ``'king'``, ``'perez'``.
354
+ model_perez : str, default 'allsitescomposite1990'
355
+ Used only if ``model='perez'``. See :py:func:`~pvlib.irradiance.perez`.
354
356
355
357
Returns
356
358
-------
357
359
total_irrad : OrderedDict or DataFrame
358
360
Contains keys/columns ``'poa_global', 'poa_direct', 'poa_diffuse',
359
361
'poa_sky_diffuse', 'poa_ground_diffuse'``.
362
+
363
+ Notes
364
+ -----
365
+ Models ``'haydavies'``, ``'reindl'``, or ``'perez'`` require
366
+ ``'dni_extra'``. Values can be calculated using
367
+ :py:func:`~pvlib.irradiance.get_extra_radiation`.
368
+
369
+ The ``'perez'`` model requires relative airmass (``airmass``) as input. If
370
+ ``airmass`` is not provided, it is calculated using the defaults in
371
+ :py:func:`~pvlib.atmosphere.get_relative_airmass`.
360
372
"""
373
+
361
374
poa_sky_diffuse = get_sky_diffuse (
362
375
surface_tilt , surface_azimuth , solar_zenith , solar_azimuth ,
363
376
dni , ghi , dhi , dni_extra = dni_extra , airmass = airmass , model = model ,
@@ -390,34 +403,56 @@ def get_sky_diffuse(surface_tilt, surface_azimuth,
390
403
Parameters
391
404
----------
392
405
surface_tilt : numeric
393
- Panel tilt from horizontal.
406
+ Panel tilt from horizontal. [degree]
394
407
surface_azimuth : numeric
395
- Panel azimuth from north.
408
+ Panel azimuth from north. [degree]
396
409
solar_zenith : numeric
397
- Solar zenith angle.
410
+ Solar zenith angle. [degree]
398
411
solar_azimuth : numeric
399
- Solar azimuth angle.
412
+ Solar azimuth angle. [degree]
400
413
dni : numeric
401
- Direct Normal Irradiance
414
+ Direct Normal Irradiance. [W/m2]
402
415
ghi : numeric
403
- Global horizontal irradiance
416
+ Global horizontal irradiance. [W/m2]
404
417
dhi : numeric
405
- Diffuse horizontal irradiance
418
+ Diffuse horizontal irradiance. [W/m2]
406
419
dni_extra : None or numeric, default None
407
- Extraterrestrial direct normal irradiance
420
+ Extraterrestrial direct normal irradiance. [W/m2]
408
421
airmass : None or numeric, default None
409
- Airmass
410
- model : String, default 'isotropic'
411
- Irradiance model.
412
- model_perez : String, default 'allsitescomposite1990'
413
- See perez.
422
+ Relative airmass (not adjusted for pressure). [unitless]
423
+ model : str, default 'isotropic'
424
+ Irradiance model. Can be one of ``'isotropic'``, ``'klucher'``,
425
+ ``'haydavies'``, ``'reindl'``, ``'king'``, ``'perez'``.
426
+ model_perez : str, default 'allsitescomposite1990'
427
+ Used only if ``model='perez'``. See :py:func:`~pvlib.irradiance.perez`.
414
428
415
429
Returns
416
430
-------
417
431
poa_sky_diffuse : numeric
432
+ Sky diffuse irradiance in the plane of array. [W/m2]
433
+
434
+ Raises
435
+ ------
436
+ ValueError
437
+ If model is one of ``'haydavies'``, ``'reindl'``, or ``'perez'`` and
438
+ ``dni_extra`` is ``None``.
439
+
440
+ Notes
441
+ -----
442
+ Models ``'haydavies'``, ``'reindl'``, and ``'perez``` require 'dni_extra'.
443
+ Values can be calculated using
444
+ :py:func:`~pvlib.irradiance.get_extra_radiation`.
445
+
446
+ The ``'perez'`` model requires relative airmass (``airmass``) as input. If
447
+ ``airmass`` is not provided, it is calculated using the defaults in
448
+ :py:func:`~pvlib.atmosphere.get_relative_airmass`.
418
449
"""
419
450
420
451
model = model .lower ()
452
+
453
+ if (model in {'haydavies' , 'reindl' , 'perez' }) and (dni_extra is None ):
454
+ raise ValueError (f'dni_extra is required for model { model } ' )
455
+
421
456
if model == 'isotropic' :
422
457
sky = isotropic (surface_tilt , dhi )
423
458
elif model == 'klucher' :
@@ -432,6 +467,8 @@ def get_sky_diffuse(surface_tilt, surface_azimuth,
432
467
elif model == 'king' :
433
468
sky = king (surface_tilt , dhi , ghi , solar_zenith )
434
469
elif model == 'perez' :
470
+ if airmass is None :
471
+ airmass = atmosphere .get_relative_airmass (solar_zenith )
435
472
sky = perez (surface_tilt , surface_azimuth , dhi , dni , dni_extra ,
436
473
solar_zenith , solar_azimuth , airmass ,
437
474
model = model_perez )
@@ -504,7 +541,7 @@ def poa_components(aoi, dni, poa_sky_diffuse, poa_ground_diffuse):
504
541
def get_ground_diffuse (surface_tilt , ghi , albedo = .25 , surface_type = None ):
505
542
'''
506
543
Estimate diffuse irradiance from ground reflections given
507
- irradiance, albedo, and surface tilt
544
+ irradiance, albedo, and surface tilt.
508
545
509
546
Function to determine the portion of irradiance on a tilted surface
510
547
due to ground reflections. Any of the inputs may be DataFrames or
@@ -518,7 +555,7 @@ def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None):
518
555
(e.g. surface facing up = 0, surface facing horizon = 90).
519
556
520
557
ghi : numeric
521
- Global horizontal irradiance in W/m^2.
558
+ Global horizontal irradiance. [ W/m^2]
522
559
523
560
albedo : numeric, default 0.25
524
561
Ground reflectance, typically 0.1-0.4 for surfaces on Earth
@@ -534,7 +571,7 @@ def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None):
534
571
Returns
535
572
-------
536
573
grounddiffuse : numeric
537
- Ground reflected irradiances in W/m^2.
574
+ Ground reflected irradiance. [ W/m^2]
538
575
539
576
540
577
References
0 commit comments