Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ipython notebook tutorial for irradiance is out of date? #309

Closed
garciaev opened this issue Feb 12, 2017 · 1 comment
Closed

Ipython notebook tutorial for irradiance is out of date? #309

garciaev opened this issue Feb 12, 2017 · 1 comment

Comments

@garciaev
Copy link

garciaev commented Feb 12, 2017

Hi -

It looks like the Ipython notebook tutorial irradiance.pynb has code to compute the ineichen model as follows:

irrad_data = pvlib.clearsky.ineichen(times, tus.latitude, tus.longitude, tus.altitude)
irrad_data.plot()

Which gives an error:

Traceback (most recent call last):
File "compute_ghi.py", line 41, in
tus.longitude, tus.altitude)
File "//anaconda/lib/python2.7/site-packages/pvlib/clearsky.py", line 113, in ineichen
cos_zenith = np.maximum(tools.cosd(apparent_zenith), 0)
File "//anaconda/lib/python2.7/site-packages/pvlib/tools.py", line 26, in cosd
res = np.cos(np.radians(angle))
TypeError: ufunc 'radians' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

It looks like the clearsky.ineichen takes solar zenith angle as the first argument? However, this code does reproduce what is seen in the middle figure of out[11] of irradiance.pynb for linke turbidity = 2.0, all other code being the same:

irrad_data = tus.get_clearsky(times, model='ineichen', linke_turbidity=2)

@wholmgren
Copy link
Member

The API changed in version 0.4. I thought this tutorial worked with the new version of pvlib (it does have a note at the top saying that it should) but I guess I missed something or forgot to commit a change.

There's a very similar example in the documentation that does work...

http://pvlib-python.readthedocs.io/en/latest/clearsky.html#examples

Do you want to make a pull request with the change? You'll want to use the notebook's "Restart and run all" command until it works through the end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants