Skip to content

Commit b5303da

Browse files
committed
Merge pull request #77 from wholmgren/fix-total-irrad
Fix total irrad
2 parents 263c90e + 5136197 commit b5303da

File tree

4 files changed

+41
-5
lines changed

4 files changed

+41
-5
lines changed

docs/sphinx/source/whatsnew.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ What's New
66

77
These are new features and improvements of note in each release.
88

9+
.. include:: whatsnew/v0.2.1.txt
910
.. include:: whatsnew/v0.2.0.txt
1011
.. include:: whatsnew/v0.1.0.txt
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.. _whatsnew_0210:
2+
3+
v0.2.1 (July 13, 2015)
4+
-----------------------
5+
6+
This is a minor release from 0.2.1. It includes a large number of bug fixes
7+
for the IPython notebook tutorials.
8+
We recommend that all users upgrade to this version.
9+
10+
Bug fixes
11+
~~~~~~~~~
12+
13+
* Fix incorrect call to Perez irradiance function (:issue:`76`)
14+
15+
Contributors
16+
~~~~~~~~~~~~
17+
18+
* Will Holmgren

pvlib/irradiance.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -377,16 +377,19 @@ def total_irrad(surface_tilt, surface_azimuth,
377377
if model == 'isotropic':
378378
sky = isotropic(surface_tilt, dhi)
379379
elif model == 'klutcher':
380-
sky = klucher(surface_tilt, surface_azimuth, dhi, ghi, solar_zenith, solar_azimuth)
380+
sky = klucher(surface_tilt, surface_azimuth, dhi, ghi,
381+
solar_zenith, solar_azimuth)
381382
elif model == 'haydavies':
382-
sky = haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra, solar_zenith, solar_azimuth)
383+
sky = haydavies(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
384+
solar_zenith, solar_azimuth)
383385
elif model == 'reindl':
384-
sky = reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra, solar_zenith,
385-
solar_azimuth)
386+
sky = reindl(surface_tilt, surface_azimuth, dhi, dni, ghi, dni_extra,
387+
solar_zenith, solar_azimuth)
386388
elif model == 'king':
387389
sky = king(surface_tilt, dhi, ghi, solar_zenith)
388390
elif model == 'perez':
389-
sky = perez(surface_tilt, surface_azimuth, dhi, dni, dni_extra, solar_zenith, solar_azimuth, AM,
391+
sky = perez(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
392+
solar_zenith, solar_azimuth, airmass,
390393
modelt=model_perez)
391394
else:
392395
raise ValueError('invalid model selection {}'.format(model))

pvlib/test/test_irradiance.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,20 @@ def test_perez():
138138
ephem_data['apparent_azimuth'], AM)
139139

140140

141+
def test_total_irrad():
142+
models = ['isotropic', 'klutcher', 'haydavies', 'reindl', 'king', 'perez']
143+
AM = atmosphere.relativeairmass(ephem_data['apparent_zenith'])
144+
145+
for model in models:
146+
total = irradiance.total_irrad(
147+
32, 180,
148+
ephem_data['apparent_zenith'], ephem_data['azimuth'],
149+
dni=irrad_data['dni'], ghi=irrad_data['ghi'], dhi=irrad_data['dhi'],
150+
dni_extra=dni_et, airmass=AM,
151+
model=model,
152+
surface_type='urban')
153+
154+
141155
def test_globalinplane():
142156
aoi = irradiance.aoi(40, 180, ephem_data['apparent_zenith'],
143157
ephem_data['apparent_azimuth'])

0 commit comments

Comments
 (0)