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

Add Muneer transposition model #2184

Draft
wants to merge 55 commits into
base: main
Choose a base branch
from
Draft
Changes from 11 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
02ae568
muneer transposition model
bernatnic Aug 26, 2024
ea15728
Update pvlib/irradiance.py
BernatNicolau Aug 26, 2024
feafcea
Update pvlib/irradiance.py
BernatNicolau Aug 26, 2024
e4646d4
Update pvlib/irradiance.py
BernatNicolau Aug 26, 2024
8066458
Update pvlib/irradiance.py
BernatNicolau Aug 26, 2024
1798da8
Update pvlib/irradiance.py
BernatNicolau Aug 26, 2024
4281d61
Update pvlib/irradiance.py
BernatNicolau Aug 26, 2024
8b13595
references modified and doi added
BernatNicolau Aug 26, 2024
6cd63a8
removed unwanted file
BernatNicolau Aug 26, 2024
fa4d8e6
formating autopep8
BernatNicolau Aug 26, 2024
8318d5b
formatting
BernatNicolau Aug 26, 2024
d5c8bc3
avoid references first paragraph
BernatNicolau Aug 27, 2024
8cbee57
updated wording
BernatNicolau Aug 27, 2024
20c8fae
function finished
BernatNicolau Aug 27, 2024
a326e94
Merge branch 'muneer' of https://github.com/BernatNicolau/pvlib-pytho…
BernatNicolau Aug 27, 2024
e0d85c0
pvlib.irradiance update (muneer)
BernatNicolau Aug 28, 2024
30fb33a
documentation, tests and flake8
BernatNicolau Aug 28, 2024
e1a7f74
flake8 update
BernatNicolau Aug 28, 2024
618ca91
test_added
BernatNicolau Aug 28, 2024
373d3e0
flake8
BernatNicolau Aug 28, 2024
e517a84
E501
BernatNicolau Aug 28, 2024
9452248
update whatsnew
BernatNicolau Aug 28, 2024
b2d5239
Merge branch 'main' into muneer
BernatNicolau Aug 28, 2024
36f633e
Update docs/sphinx/source/whatsnew/v0.11.1.rst
BernatNicolau Aug 28, 2024
982d2f9
documentation improvement
BernatNicolau Aug 28, 2024
eecc05e
documentation improvement
BernatNicolau Aug 28, 2024
83b5036
documentation improvement
BernatNicolau Aug 28, 2024
6bd1d51
Merge branch 'main' into muneer
BernatNicolau Aug 28, 2024
4fb4bae
b added to `get_total_irradiance`
BernatNicolau Aug 29, 2024
4c69d6f
Apply suggestions from code review (documentation)
BernatNicolau Sep 2, 2024
b93aa05
flake8-linter
BernatNicolau Sep 2, 2024
c2248f1
Update DOI
BernatNicolau Sep 3, 2024
91fd117
create scenario with low solar altitude (<0.1rad)
BernatNicolau Sep 3, 2024
b8910de
avoid zero in denominator
BernatNicolau Sep 3, 2024
0591323
division by zero fix
BernatNicolau Sep 3, 2024
aed0e6d
solar_azimuth is not optional anymore + test updated
BernatNicolau Sep 3, 2024
2d4b10f
# GH 432
BernatNicolau Sep 3, 2024
bec7412
test_update
BernatNicolau Sep 3, 2024
a3e3e3c
replace np.where by .where to keep the pd.Series type
BernatNicolau Sep 3, 2024
927c8a8
revert np.where and modify type if needed
BernatNicolau Sep 3, 2024
7cfd605
typo when converting sky_diffuse
BernatNicolau Sep 3, 2024
5298cb2
improvement # GH 432
BernatNicolau Sep 3, 2024
ce6f5c0
np.array and float tests added
BernatNicolau Sep 4, 2024
ce42241
updated expected to np.array as it should be
BernatNicolau Sep 4, 2024
5632bda
assert_series_equal to assert_almost_equal
BernatNicolau Sep 4, 2024
b2128cf
documentation improvement
BernatNicolau Sep 4, 2024
f9fb65c
linter
BernatNicolau Sep 4, 2024
c0caf04
Apply suggestions from code review
BernatNicolau Sep 4, 2024
2142559
unify irradiation unit format
BernatNicolau Sep 4, 2024
4e58192
Merge branch 'muneer' of https://github.com/BernatNicolau/pvlib-pytho…
BernatNicolau Sep 4, 2024
bedd18b
linter
BernatNicolau Sep 4, 2024
b5e4aec
muneer2004
BernatNicolau Sep 5, 2024
1bcf20d
overcast condition
BernatNicolau Sep 5, 2024
c9b9214
update clearness index
BernatNicolau Sep 6, 2024
519861e
Merge pull request #1 from BernatNicolau/muneer-book
BernatNicolau Sep 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions pvlib/irradiance.py
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,58 @@
return sky_diffuse


def muneer(surface_tilt, dhi, b):
'''
Determine sky diffuse irradiance on a tilted surface using the
Muneer [1]_ model.
BernatNicolau marked this conversation as resolved.
Show resolved Hide resolved

Parameters
----------
surface_tilt : numeric
Surface tilt angle in decimal degrees. Tilt must be >=0 and
<=180. The tilt angle is defined as degrees from horizontal
(e.g. surface facing up = 0, surface facing horizon = 90)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Surface tilt angle in decimal degrees. Tilt must be >=0 and
<=180. The tilt angle is defined as degrees from horizontal
(e.g. surface facing up = 0, surface facing horizon = 90)
Surface tilt angle from horizontal. E.g.,
facing up = 0°, facing horizon = 90°.
In degrees [°].

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got the wording from perez. For consistency, should other functions also be updated or shall I keep the one that currently is (from perez)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

echedey-ls edits are an improvement but I'm not in favor of changing documentation for other functions. You can change it here, but I think it's not a big deal if we use the old language.


dhi : numeric
Diffuse horizontal irradiance. [W/m^2]
BernatNicolau marked this conversation as resolved.
Show resolved Hide resolved

b : numeric
Radiance distribution index, introduced by Moon and Spencer [2]_
to model luminance distribution of overcast sky. [unitless]
Recommend values from [1]_:
BernatNicolau marked this conversation as resolved.
Show resolved Hide resolved

- isotropic: b = 0
- shaded surface: b = 5.73
- sunlit surface, overcast sky: b = 1.68
- sunlit surface, non-overcast sky: b = -0.62

Returns
-------
poa_sky_diffuse : numeric
In-plane diffuse irradiance from the sky. [W/m^2]
BernatNicolau marked this conversation as resolved.
Show resolved Hide resolved

References
----------
.. [1] Muneer, T., 1990. Solar radiation model for Europe. Building
Services Engineering Research and Technology 11, 153-163.
:doi:`10.1177/014362449001100405`

.. [2] Moon, P., Spencer, D.E., 1942. Illumination from a non-uniform sky.
BernatNicolau marked this conversation as resolved.
Show resolved Hide resolved
Trans. Illum. Eng. Soc. (London) 37, 707-725.
:doi:`10.1177/096032719302500301`
BernatNicolau marked this conversation as resolved.
Show resolved Hide resolved
'''

term1 = 2 * b / (np.pi * (3 + 2 * b))
term2 = (

Check warning on line 1039 in pvlib/irradiance.py

View check run for this annotation

Codecov / codecov/patch

pvlib/irradiance.py#L1038-L1039

Added lines #L1038 - L1039 were not covered by tests
tools.sind(surface_tilt)
- surface_tilt * tools.cosd(surface_tilt)
- np.pi * (1 - tools.cosd(surface_tilt)) * 0.5
)
sky_diffuse = dhi * ((1 + tools.cosd(surface_tilt)) * 0.5 + term1 * term2)

Check warning on line 1044 in pvlib/irradiance.py

View check run for this annotation

Codecov / codecov/patch

pvlib/irradiance.py#L1044

Added line #L1044 was not covered by tests

return sky_diffuse

Check warning on line 1046 in pvlib/irradiance.py

View check run for this annotation

Codecov / codecov/patch

pvlib/irradiance.py#L1046

Added line #L1046 was not covered by tests


def perez(surface_tilt, surface_azimuth, dhi, dni, dni_extra,
solar_zenith, solar_azimuth, airmass,
model='allsitescomposite1990', return_components=False):
Expand Down
Loading