-
Notifications
You must be signed in to change notification settings - Fork 1.1k
NREL bird clearsky #276
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
NREL bird clearsky #276
Conversation
* move clearsky.py into clearsky/core.py just for fun, let's try it out * fix path to data in clearsky to LinkeTurbidities.mat * add BIRD workbook to data for testing Signed-off-by: Mark Mikofski <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I think the Bird model would be a useful addition, though I admit I don't have any experience with it.
I'll put the API-level comments here. The resolution of these might make some of my line-by-line comments irrelevant.
- Restructuring clearsky.py into a package: maybe we should do this first in a separate PR? On a related note, I thought you were an proponent of
api.py
in modules are too long and have too many symbols #235 so I was a little surprised that you didn't use that here. It's not clear to me why bird would be in its own module while the other algorithms remain in the same module. - I'm not sure about the
nrel.py
module name. Do people frequently associate this algorithm with NREL? - The bird function does a lot: calculates solar position, airmass, atmospheric properties, ET irradiance, and finally clear sky. I think the function and its signature should be simplified by requiring users to do more work before they get here. This would also be consistent with the way the existing clear sky algorithms work. So, I think the signature should be more like
bird(zenith, airmass_relative, aod700=0.1, precipitable_water=1., ozone=0.3, pressure=101325., dni_extra=1364.)
This is also related to the ineichen
refactoring that I did in #199. The documentation can make note of the methods that need to be used on the input data in order to exactly reproduce the traditional model.
Should we strip out the test data from the excel file and put it in a csv file? Advantages are that the csv file is smaller and we avoid the xlrd dependency. More importantly, are we allowed to redistribute the NREL file?
Why add the requirements file? setup.py
already has the minimum pvlib requirements in it.
pvlib/clearsky/nrel.py
Outdated
def bird(doy, hr, lat, lon, tz, press_mB, o3_cm, h2o_cm, aod_500nm, aod_380nm, | ||
b_a, alb, lyear=365.0, solar_constant=1367.0): | ||
""" | ||
Bird Simple Clearsky Model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use numpydoc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
pvlib/clearsky/nrel.py
Outdated
np.sin(dec_rad) * np.sin(lat_rad) | ||
) | ||
zenith = np.rad2deg(ze_rad) | ||
airmass = np.where(zenith < 89, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same as relativeairmass(method='kasten1966')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- removed this calc in bird since passing relative airmass as argument
- use this in test_clearsky.test_bird()
✔️
pvlib/clearsky/nrel.py
Outdated
return pd.DataFrame({'Eb': Eb, 'Ebh': Ebh, 'Gh': Gh, 'Dh': Dh}, index=dt) | ||
|
||
|
||
if __name__ == "__main__": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, we don't have any script code in pvlib, but I would consider keeping this in a test module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed script - it was just for debugging
✔️
pvlib/clearsky/nrel.py
Outdated
return solar_constant * (a0 + a1 + a2 + a3 + a4) | ||
|
||
|
||
def test_bird(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests should go in a module named test_[__name__].py
. We should probably make a tests subsubpackage within each subpackage e.g. pvlib/clearsky/tests/test_bird.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
pvlib/clearsky/nrel.py
Outdated
return id_, id_nh, gh, gh - id_nh, testvalues | ||
|
||
|
||
def etr(doy, lyear=365.0, solar_constant=1367.0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This the same as irradiance.extraradiation(method='spencer')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using dni_extra
arg now, so this is removed, but I'll use it in the test
✔️
pvlib/clearsky/nrel.py
Outdated
) | ||
pstar = press_mB / patm | ||
am_press = pstar*airmass | ||
t_rayliegh = np.where(airmass > 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are any of the np.where
statements repetitive? In any case, calculate the airmass > 0
mask once and reuse it in subsequent tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not necessary anymore, since relative airmass is NaN
if not valid
✔️
pvlib/clearsky/nrel.py
Outdated
) | ||
gh = np.where(airmass > 0, (id_nh + ias) / (1.0 - alb * rs), 0.0) | ||
testvalues = (day_angle, declination, eqt, hour_angle, zenith, airmass) | ||
return id_, id_nh, gh, gh - id_nh, testvalues |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to do the subtraction on a separate line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, changed to diffuse_horiz
✔️
pvlib/clearsky/nrel.py
Outdated
Solar Radiation Model | ||
From the publication "A Simplified Clear Sky model for Direct and Diffuse | ||
Insolation on Horizontal Surfaces" by R.E. Bird and R.L Hulstrom, SERI Technical | ||
Report SERI/TR-642-761, Feb 1991. Solar Energy Research Institute, Golden, CO. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1981
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
pvlib/clearsky/nrel.py
Outdated
Insolation on Horizontal Surfaces" by R.E. Bird and R.L Hulstrom, SERI Technical | ||
Report SERI/TR-642-761, Feb 1991. Solar Energy Research Institute, Golden, CO. | ||
|
||
The model is based on comparisons with results from rigourous radiative transfer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
text needs to be edited so that it's not specific to the excel file. Not sure if there is a licensing/attribution issue here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
pvlib/clearsky/nrel.py
Outdated
|
||
def bird(doy, hr, lat, lon, tz, press_mB, o3_cm, h2o_cm, aod_500nm, aod_380nm, | ||
b_a, alb, lyear=365.0, solar_constant=1367.0): | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some (all?) of the edited doc string above should be moved here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Also not a fan of a module called nrel.py for this purpose, and I think
that the bird model should be included in clearsky.py. Not sure about the
new package concept for clearsky.py, but if it is, would prefer the module
name to be bird or include bird.
…On Sat, Dec 3, 2016 at 1:43 PM, Will Holmgren ***@***.***> wrote:
***@***.**** commented on this pull request.
Thanks! I think the Bird model would be a useful addition, though I admit
I don't have any experience with it.
I'll put the API-level comments here. The resolution of these might make
some of my line-by-line comments irrelevant.
1. Restructuring clearsky.py into a package: maybe we should do this
first in a separate PR? On a related note, I thought you were an proponent
of api.py in #235 <#235>
so I was a little surprised that you didn't use that here. It's not clear
to me why bird would be in its own module while the other algorithms remain
in the same module.
2. I'm not sure about the nrel.py module name. Do people frequently
associate this algorithm with NREL?
3. The bird function does a lot: calculates solar position, airmass,
atmospheric properties, ET irradiance, and finally clear sky. I think the
function and its signature should be simplified by requiring users to do
more work before they get here. This would also be consistent with the way
the existing clear sky algorithms work. So, I think the signature should be
more like
bird(zenith, airmass_relative, aod700=0.1, precipitable_water=1.,
ozone=0.3, pressure=101325., dni_extra=1364.)
This is also related to the ineichen refactoring that I did in #199
<#199>. The documentation can
make note of the methods that need to be used on the input data in order to
exactly reproduce the traditional model.
Should we strip out the test data from the excel file and put it in a csv
file? Advantages are that the csv file is smaller and we avoid the xlrd
dependency. More importantly, are we allowed to redistribute the NREL file?
Why add the requirements file? setup.py already has the minimum pvlib
requirements in it.
------------------------------
In pvlib/clearsky/nrel.py
<#276 (review)>
:
> +http://rredc.nrel.gov/solar/models/clearsky/
+http://rredc.nrel.gov/solar/pubs/pdfs/tr-642-761.pdf
+http://rredc.nrel.gov/solar/models/clearsky/error_reports.html
+"""
+
+import numpy as np
+import pandas as pd
+import seaborn as sns
+import xlrd
+import os
+
+
+def bird(doy, hr, lat, lon, tz, press_mB, o3_cm, h2o_cm, aod_500nm, aod_380nm,
+ b_a, alb, lyear=365.0, solar_constant=1367.0):
+ """
+ Bird Simple Clearsky Model
use numpydoc
------------------------------
In pvlib/clearsky/nrel.py
<#276 (review)>
:
> + )
+ declination = np.rad2deg(dec_rad)
+ # equation of time
+ eqt = 229.18 * (
+ 0.0000075 + 0.001868 * np.cos(day_angle) -
+ 0.032077 * np.sin(day_angle) - 0.014615 * np.cos(2.0 * day_angle) -
+ 0.040849 * np.sin(2.0 * day_angle)
+ )
+ hour_angle = 15.0 * (hr - 12.5) + lon - tz * 15.0 + eqt / 4.0
+ lat_rad = np.deg2rad(lat)
+ ze_rad = np.arccos(
+ np.cos(dec_rad) * np.cos(lat_rad) * np.cos(np.deg2rad(hour_angle)) +
+ np.sin(dec_rad) * np.sin(lat_rad)
+ )
+ zenith = np.rad2deg(ze_rad)
+ airmass = np.where(zenith < 89,
This is the same as relativeairmass(method='kasten1966')
------------------------------
In pvlib/clearsky/nrel.py
<#276 (review)>
:
> + for n, h in enumerate(headers)},
+ index=dt[1:48])
+ assert np.allclose(testdata['Dangle'], day_angle[1:48])
+ assert np.allclose(testdata['DEC'], declination[1:48])
+ assert np.allclose(testdata['EQT'], eqt[1:48])
+ assert np.allclose(testdata['Hour Angle'], hour_angle[1:48])
+ assert np.allclose(testdata['Zenith Ang'], zenith[1:48])
+ assert np.allclose(testdata['Air Mass'], airmass[1:48])
+ assert np.allclose(testdata['Direct Beam'], Eb[1:48])
+ assert np.allclose(testdata['Direct Hz'], Ebh[1:48])
+ assert np.allclose(testdata['Global Hz'], Gh[1:48])
+ assert np.allclose(testdata['Dif Hz'], Dh[1:48])
+ return pd.DataFrame({'Eb': Eb, 'Ebh': Ebh, 'Gh': Gh, 'Dh': Dh}, index=dt)
+
+
+if __name__ == "__main__":
Hm, we don't have any script code in pvlib, but I would consider keeping
this in a test module.
------------------------------
In pvlib/clearsky/nrel.py
<#276 (review)>
:
> + gh = np.where(airmass > 0, (id_nh + ias) / (1.0 - alb * rs), 0.0)
+ testvalues = (day_angle, declination, eqt, hour_angle, zenith, airmass)
+ return id_, id_nh, gh, gh - id_nh, testvalues
+
+
+def etr(doy, lyear=365.0, solar_constant=1367.0):
+ a0 = 1.00011
+ doy0 = doy - 1.0
+ a1 = 0.034221 * np.cos(2.0 * np.pi * doy0 / lyear)
+ a2 = 0.00128 * np.sin(2.0 * np.pi * doy0 / lyear)
+ a3 = 0.000719 * np.cos(2.0 * (2.0 * np.pi * doy0 / lyear))
+ a4 = 0.000077 * np.sin(2.0 * (2.0 * np.pi * doy0 / lyear))
+ return solar_constant * (a0 + a1 + a2 + a3 + a4)
+
+
+def test_bird():
tests should go in a module named test_[__name__].py. We should probably
make a tests subsubpackage within each subpackage e.g.
pvlib/clearsky/tests/test_bird.py
------------------------------
In pvlib/clearsky/nrel.py
<#276 (review)>
:
> + 0.9662 * etr_ * t_aerosol * t_water * t_gases * t_ozone * t_rayliegh,
+ 0.0
+ )
+ id_nh = np.where(zenith < 90, id_ * np.cos(ze_rad), 0.0)
+ ias = np.where(airmass > 0,
+ etr_ * np.cos(ze_rad) * 0.79 * t_ozone * t_gases * t_water * taa *
+ (0.5 * (1.0 - t_rayliegh) + b_a * (1.0 - (t_aerosol / taa))) / (
+ 1.0 - airmass + airmass ** 1.02
+ ), 0.0
+ )
+ gh = np.where(airmass > 0, (id_nh + ias) / (1.0 - alb * rs), 0.0)
+ testvalues = (day_angle, declination, eqt, hour_angle, zenith, airmass)
+ return id_, id_nh, gh, gh - id_nh, testvalues
+
+
+def etr(doy, lyear=365.0, solar_constant=1367.0):
This the same as irradiance.extraradiation(method='spencer')
------------------------------
In pvlib/clearsky/nrel.py
<#276 (review)>
:
> + 0.032077 * np.sin(day_angle) - 0.014615 * np.cos(2.0 * day_angle) -
+ 0.040849 * np.sin(2.0 * day_angle)
+ )
+ hour_angle = 15.0 * (hr - 12.5) + lon - tz * 15.0 + eqt / 4.0
+ lat_rad = np.deg2rad(lat)
+ ze_rad = np.arccos(
+ np.cos(dec_rad) * np.cos(lat_rad) * np.cos(np.deg2rad(hour_angle)) +
+ np.sin(dec_rad) * np.sin(lat_rad)
+ )
+ zenith = np.rad2deg(ze_rad)
+ airmass = np.where(zenith < 89,
+ 1.0 / (np.cos(ze_rad) + 0.15 / (93.885 - zenith) ** 1.25), 0.0
+ )
+ pstar = press_mB / patm
+ am_press = pstar*airmass
+ t_rayliegh = np.where(airmass > 0,
Are any of the np.where statements repetitive? In any case, calculate the airmass
> 0 mask once and reuse it in subsequent tests.
------------------------------
In pvlib/clearsky/nrel.py
<#276 (review)>
:
> + )
+ etr_ = etr(doy, lyear, solar_constant)
+ id_ = np.where(airmass > 0,
+ 0.9662 * etr_ * t_aerosol * t_water * t_gases * t_ozone * t_rayliegh,
+ 0.0
+ )
+ id_nh = np.where(zenith < 90, id_ * np.cos(ze_rad), 0.0)
+ ias = np.where(airmass > 0,
+ etr_ * np.cos(ze_rad) * 0.79 * t_ozone * t_gases * t_water * taa *
+ (0.5 * (1.0 - t_rayliegh) + b_a * (1.0 - (t_aerosol / taa))) / (
+ 1.0 - airmass + airmass ** 1.02
+ ), 0.0
+ )
+ gh = np.where(airmass > 0, (id_nh + ias) / (1.0 - alb * rs), 0.0)
+ testvalues = (day_angle, declination, eqt, hour_angle, zenith, airmass)
+ return id_, id_nh, gh, gh - id_nh, testvalues
Better to do the subtraction on a separate line.
------------------------------
In pvlib/clearsky/nrel.py
<#276 (review)>
:
> @@ -0,0 +1,187 @@
+"""
+Richard E. Bird
+ Clear Sky Broadband
+ Solar Radiation Model
+From the publication "A Simplified Clear Sky model for Direct and Diffuse
+Insolation on Horizontal Surfaces" by R.E. Bird and R.L Hulstrom, SERI Technical
+Report SERI/TR-642-761, Feb 1991. Solar Energy Research Institute, Golden, CO.
1981
------------------------------
In pvlib/clearsky/nrel.py
<#276 (review)>
:
> @@ -0,0 +1,187 @@
+"""
+Richard E. Bird
+ Clear Sky Broadband
+ Solar Radiation Model
+From the publication "A Simplified Clear Sky model for Direct and Diffuse
+Insolation on Horizontal Surfaces" by R.E. Bird and R.L Hulstrom, SERI Technical
+Report SERI/TR-642-761, Feb 1991. Solar Energy Research Institute, Golden, CO.
+
+The model is based on comparisons with results from rigourous radiative transfer
text needs to be edited so that it's not specific to the excel file. Not
sure if there is a licensing/attribution issue here.
------------------------------
In pvlib/clearsky/nrel.py
<#276 (review)>
:
> +
+http://rredc.nrel.gov/solar/models/clearsky/
+http://rredc.nrel.gov/solar/pubs/pdfs/tr-642-761.pdf
+http://rredc.nrel.gov/solar/models/clearsky/error_reports.html
+"""
+
+import numpy as np
+import pandas as pd
+import seaborn as sns
+import xlrd
+import os
+
+
+def bird(doy, hr, lat, lon, tz, press_mB, o3_cm, h2o_cm, aod_500nm, aod_380nm,
+ b_a, alb, lyear=365.0, solar_constant=1367.0):
+ """
Some (all?) of the edited doc string above should be moved here.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#276 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AH66AV_G_c7XNkhsM_6sTWTQPYQwK6waks5rEeKRgaJpZM4LDQh7>
.
|
* compare eot from spencer and pvcdrom to spa-python * add note about coefficients in spencer 1971 and more references
* clean up docstrings for bird model, fix pub date to 1981, add references section, add attribution to daryl myers * add spaces between colon and parameter to ineichen and simplified_solis models to correspond to numpydoc style * revert changes in 457615d, change pvlib-path back to dirname of clearsky.py file, remove added clearsky_path * start to change bird function signature to conform to existing clear sky algos, and strip out some of the complicated algos like the relative airmass, declination and solpos * change args aod_380nm to aod380 and aod_500nm to aod500. * clean up eot docstrings, add references, use external linking
* added both cooper-69 and spencer-71 * replacing calls in bird to calls to new formulas for declination, eot, dayangle
* remove day_angle, relative airmass, eot, zenith, declination, extraterrestrial dni calcs, and pass values in as needed * change o3_cm to ozone, h2o_cm to precipitable_water, b_a to asymmetry and alb to albedo * replace pstar, patm and am_press with absolute airmass method from atmosphere * testvalues no longer needed * use irradiance.extraradiation() and remove etr() * add analytical solar zenith angle and hour angle methods to solar position module
* also add returns * remove defaults for aod, since should be supplied TODO: change input to broadband when linke turbidity PR is complete * remove times, not needed anymore * remove commented relative airmass(method="kasten1966") since passed as arg * remove extraradiation(method="spencer") since passed as arg * change etr_ to etr since no more etr TODO: change all variables to easier names * add seinfeld and pandis to declination references * finish hour angle calc
* also add returns * remove defaults for aod, since should be supplied TODO: change input to broadband when linke turbidity PR is complete * remove times, not needed anymore * remove commented relative airmass(method="kasten1966") since passed as arg * remove extraradiation(method="spencer") since passed as arg * change etr_ to etr since no more etr TODO: change all variables to easier names * add seinfeld and pandis to declination references * finish hour angle calc
* save ze_cos once, instead of recalculating * simplify/shorten some lines now that np.where(airmass > 0,<calc>,0.0) is gone
* add to what's new for v0.4.4 * add new solar position formulas and bird clear sky to api * move links to references, and space references to make numpydoc happy * add see also for eot, declination and solar_zenith_analytical
I think this is done. Some notes:
|
Sorry again for the delay @mikofski. Does anyone have time to look at this more carefully? Without looking closely (and thus running a high chance of saying something stupid)...
API looks good, thanks. I like the idea of reorganizing with api.py or something else, but let's do it in a separate PR.
I was initially unhappy to see all of this less precise solar position functionality in a clear sky model PR. But I guess I'm ok with these functions if we document that users should prefer other functions for high precision calculations. Maybe put them in a different subsection in the API documentation?
I like plain text for smaller data because people can view it on github, in diffs, and their editors. But this is fine.
The base requirements are numpy 1.9, pandas 0.14, pytz, and six. Maybe you want to make two requirements files -- requirements and requirements-all? Why the newer numpy scipy version limits?
see #293. Are the keyword parameters sufficiently tested? Does it work with scalars? |
- use csv file instead of xls file - NOTE: I made this file by changing all cells' format to General, fitting column size to content width to show all significant figures, then saving as csv, new file is less than 370kb vs 1.2mb - use pandas read_csv instead of xlrd, way easier :) - remove requirements.txt, can't be bothered
still working on it. Any comments from anyone?
good idea, I'll put them in a section after spa with text prefixing that says these are low accuracy solar position methods
remove xls, and reversed xlrd dependencies everywhere and use csv instead
I removed the
Nope, still need to check on this |
* add Daryl R. Myers, "Solar Radiation" CRC Press (2013) reference * fix some sphinx-build errors in solar-position, explicit emphasis start with no end for "*Note" (missing closing "*" for emphasis in `nrel_earthsun_distance` and `spa_python` * use numpydoc linked references for spencer71 equation of time
* add BIRD_08_16_2012_patm.csv for 2nd bird test data * fix docs by moving text before parameters so not indented
@wholmgren and others: This is ready for your review now:
|
Thanks, Mark. Might be next week before I can look carefully. Other users should feel free to chime in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for long delay in getting to this @mikofski. I think we're close.
It would be great if you could add a new section to the clearsky.rst file and update the other sections appropriately, but I worry that might be asking too much for this PR. We could leave it as a stub in the documentation and create a separate issue to remind us to get to it eventually.
docs/sphinx/source/api.rst
Outdated
solarposition.solar_zenith_analytical | ||
solarposition.declination_spencer71 | ||
solarposition.declination_cooper69 | ||
solarposition.equation_of_time_Spencer71 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lower case s here and in function definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
☑️
pvlib/clearsky.py
Outdated
Parameters | ||
---------- | ||
zenith : numeric | ||
Solar zenith angle in degrees. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solar_zenith or apparent_zenith? http://pvlib-python.readthedocs.io/en/latest/variables_style_rules.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solar_zenith
not apparent - in case I forget
pvlib/clearsky.py
Outdated
NREL Bird Simple Clear Sky Broadband Solar Radiation Model | ||
|
||
Based on original implementation by Daryl R. Myers at NREL. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could add some notes about how zenith and airmass should be calculated if users want to exactly reproduce the entire bird model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or this could go into a new section in the clearsky.rst documentation.
pvlib/clearsky.py
Outdated
|
||
Returns | ||
------- | ||
direct_beam : numeric |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's more conventional in pvlib to return a DataFrame or OrderedDict, rather than a tuple. Series in, DataFrame out, anything else in, OrderedDict out. The other functions in this module demonstrate this pattern. columns/keys should follow http://pvlib-python.readthedocs.io/en/latest/variables_style_rules.html
@wholmgren sorry for being so slow. I am still working on this. |
@wholmgren and @cwhanse I think this is finally ready to be merged. It passes all tests. I've addressed the return types by converting them to |
@wholmgren I made minor documentation changes to address the testing parameters and solar or apparent zenith argument. Please let me know if there are any other issues to address before you can merge this. I would like to use the Bird model for comparisons of AOD/Pwat data with Linke turbidity in with Ineichen's original and newer simplified-Solis clearsky model for our upcoming PVSC paper. 😉 |
That all sounds good, but I probably will not be able to look at this
closely until next wednesday.
…On Thu, May 18, 2017 at 2:44 PM Mark Mikofski ***@***.***> wrote:
@wholmgren <https://github.com/wholmgren> I made minor documentation
changes to address the testing parameters and solar or apparent zenith
argument. Please let me know if there are any other issues to address
before you can merge this. I would like to use the Bird model for
comparisons of AOD/Pwat data with Linke turbidity in with Ineichen's
original and newer simplified-Solis clearsky model for our upcoming PVSC
paper. 😉
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#276 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AELiR2G6PWT34mBjPNJkVjl1eRUMAWF1ks5r7LvTgaJpZM4LDQh7>
.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How big (MB) are these test files?
@@ -6,6 +6,7 @@ v0.4.4 (February 18, 2017) | |||
Enhancements | |||
~~~~~~~~~~~~ | |||
|
|||
* Added NREL Bird clear sky model. (:issue:`276`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're onto 0.4.5
pvlib/clearsky.py
Outdated
airmass = airmass_relative | ||
# Bird clear sky model | ||
am_press = atmosphere.absoluteairmass(airmass, pressure) | ||
t_rayliegh = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rayleigh not rayliegh
@@ -367,3 +367,15 @@ def test_nrel_earthsun_distance(): | |||
expected = pd.Series(np.array([0.983289204601]), | |||
index=pd.DatetimeIndex([times, ])) | |||
assert_series_equal(expected, result) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we add tests for all of the other functions you've added to solarposition.py
? I think they should be marked private if you don't want to add the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added 2 more tests for low accuracy declination and solar-zenith formulas.
@wholmgren the test files are each 360-kb, so total combined less than 1-mb, okay? |
* move whats new note from 0.4.4 to 0.4.5 * test declination and solar-zenith * correct spelling of Rayleigh
ok on the test file size. I think this is ready to go. Agreed? |
Unless anyone else has any comments, yes! |
Yet another clear sky model, based on the MS Excel workbook by NREL Daryl Myers and the model described in the paper "A Simplified Clear Sky model for Direct and Diffuse
Insolation on Horizontal Surfaces" by R.E. Bird and R.L Hulstrom, SERI Technical
Report SERI/TR-642-761, Feb 1981. Solar Energy Research Institute, Golden, CO.