Skip to content

Commit d79dd5b

Browse files
committed
total_irrad to get_total_poa_irradiance
1 parent 3bc0f34 commit d79dd5b

File tree

3 files changed

+29
-26
lines changed

3 files changed

+29
-26
lines changed

docs/sphinx/source/whatsnew/v0.5.2.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ API Changes
1515
instead. irradiance.extraradiation will be removed in 0.6. (:issue:`422`)
1616
* Deprecated irradiance.grounddiffuse. Use irradiance.get_ground_diffuse
1717
instead. irradiance.grounddiffuse will be removed in 0.6. (:issue:`422`)
18-
18+
* Added irradiance.get_poa_sky_diffuse. (:issue:`422`)
19+
* Deprecated irradiance.total_irrad. Use irradiance.get_total_poa_irradiance
20+
instead. irradiance.total_irrad will be removed in 0.6. (:issue:`422`)
1921
* Removed 'klutcher' from get_sky_diffuse/total_irrad. This misspelling was
2022
deprecated long ago but never removed.
2123

pvlib/irradiance.py

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,12 @@ def beam_component(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth,
300300
return beam
301301

302302

303-
def total_irrad(surface_tilt, surface_azimuth,
304-
apparent_zenith, azimuth,
305-
dni, ghi, dhi, dni_extra=None, airmass=None,
306-
albedo=.25, surface_type=None,
307-
model='isotropic',
308-
model_perez='allsitescomposite1990', **kwargs):
303+
def get_total_poa_irradiance(surface_tilt, surface_azimuth,
304+
apparent_zenith, azimuth,
305+
dni, ghi, dhi, dni_extra=None, airmass=None,
306+
albedo=.25, surface_type=None,
307+
model='isotropic',
308+
model_perez='allsitescomposite1990', **kwargs):
309309
r"""
310310
Determine total in-plane irradiance and its beam, sky diffuse and ground
311311
reflected components, using the specified sky diffuse irradiance model.
@@ -361,23 +361,27 @@ def total_irrad(surface_tilt, surface_azimuth,
361361
solar_zenith = apparent_zenith
362362
solar_azimuth = azimuth
363363

364-
poa_sky_diffuse = get_sky_diffuse(
364+
poa_sky_diffuse = get_poa_sky_diffuse(
365365
surface_tilt, surface_azimuth, solar_zenith, solar_azimuth,
366-
dni, ghi, dhi, dni_extra=dni_extra, airmass=airmass, albedo=albedo,
367-
surface_type=surface_type, model=model, model_perez=model_perez)
366+
dni, ghi, dhi, dni_extra=dni_extra, airmass=airmass, model=model,
367+
model_perez=model_perez)
368368

369-
poa_ground_diffuse = grounddiffuse(surface_tilt, ghi, albedo, surface_type)
369+
poa_ground_diffuse = get_poa_ground_diffuse(surface_tilt, ghi, albedo,
370+
surface_type)
370371
aoi_ = aoi(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth)
371372
irrads = poa_components(aoi_, dni, poa_sky_diffuse, poa_ground_diffuse)
372373
return irrads
373374

374375

375-
def get_sky_diffuse(surface_tilt, surface_azimuth,
376-
solar_zenith, solar_azimuth,
377-
dni, ghi, dhi, dni_extra=None, airmass=None,
378-
albedo=.25, surface_type=None,
379-
model='isotropic',
380-
model_perez='allsitescomposite1990'):
376+
total_irrad = deprecated('0.5.2', alternative='get_total_poa_irradiance',
377+
name='total_irrad')(get_total_poa_irradiance)
378+
379+
380+
def get_poa_sky_diffuse(surface_tilt, surface_azimuth,
381+
solar_zenith, solar_azimuth,
382+
dni, ghi, dhi, dni_extra=None, airmass=None,
383+
model='isotropic',
384+
model_perez='allsitescomposite1990'):
381385
r"""
382386
Determine in-plane sky diffuse irradiance component
383387
using the specified sky diffuse irradiance model.
@@ -410,10 +414,6 @@ def get_sky_diffuse(surface_tilt, surface_azimuth,
410414
Extraterrestrial direct normal irradiance
411415
airmass : None or numeric, default None
412416
Airmass
413-
albedo : numeric, default 0.25
414-
Surface albedo
415-
surface_type : None or String, default None
416-
Surface type. See grounddiffuse.
417417
model : String, default 'isotropic'
418418
Irradiance model.
419419
model_perez : String, default 'allsitescomposite1990'
@@ -509,6 +509,8 @@ def poa_components(aoi, dni, poa_sky_diffuse, poa_ground_diffuse):
509509
return irrads
510510

511511

512+
# globalinplane returns less data than poa_components, so better
513+
# to copy it
512514
@deprecated('0.5.2', alternative='poa_components',
513515
addendum=' This function will be removed in 0.6')
514516
def globalinplane(aoi, dni, poa_sky_diffuse, poa_ground_diffuse):
@@ -567,7 +569,7 @@ def globalinplane(aoi, dni, poa_sky_diffuse, poa_ground_diffuse):
567569
return irrads
568570

569571

570-
def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None):
572+
def get_poa_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None):
571573
'''
572574
Estimate diffuse irradiance from ground reflections given
573575
irradiance, albedo, and surface tilt
@@ -634,8 +636,8 @@ def get_ground_diffuse(surface_tilt, ghi, albedo=.25, surface_type=None):
634636
return diffuse_irrad
635637

636638

637-
grounddiffuse = deprecated('0.5.2', alternative='get_ground_diffuse',
638-
name='grounddiffuse')(get_ground_diffuse)
639+
grounddiffuse = deprecated('0.5.2', alternative='get_poa_ground_diffuse',
640+
name='grounddiffuse')(get_poa_ground_diffuse)
639641

640642

641643
def isotropic(surface_tilt, dhi):

pvlib/test/test_irradiance.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,8 @@ def test_liujordan():
211211
assert_frame_equal(out, expected)
212212

213213

214-
# klutcher (misspelling) will be removed in 0.3
215214
def test_total_irrad():
216-
models = ['isotropic', 'klutcher', 'klucher',
215+
models = ['isotropic', 'klucher',
217216
'haydavies', 'reindl', 'king', 'perez']
218217
AM = atmosphere.relativeairmass(ephem_data['apparent_zenith'])
219218

0 commit comments

Comments
 (0)