-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Calculating horizon profiles and associated shading losses #758
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
Open
JPalakapillyKWH
wants to merge
29
commits into
pvlib:main
Choose a base branch
from
JPalakapillyKWH:horizon_shading_pr
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
691d353
first pass at horizon code in pvlib
JPalakapillyKWH 99426ba
added most of horizon shading code
JPalakapillyKWH 39302d6
wrapped up most code and added docstrings to irradiance
JPalakapillyKWH 2daa5c6
added more documentation
JPalakapillyKWH 6cb7399
reverted setup
JPalakapillyKWH df724e5
linted
JPalakapillyKWH 808af03
more lints + moved import of gmaps
JPalakapillyKWH 7573763
added scipy to setup.py and fixed bug in modelchain
JPalakapillyKWH 3421899
moved some horizon functions to tools and fixed naming. Also wrote 2 …
JPalakapillyKWH b600e16
added test_horizon.py and code restructuring
JPalakapillyKWH b0c9193
moved horizon adjustmen to isotropic. Fixed some tests
JPalakapillyKWH e6beb32
removed gmaps from horizon. Deleted remnants of horizon adjusment model
JPalakapillyKWH 10baccd
major code restructuring. much more numpy friendly now. still need to…
JPalakapillyKWH 345eaa0
updated docstrings
JPalakapillyKWH 5405d75
docstring changes
JPalakapillyKWH cc481c7
made some changes to modelchain and location due to restructuring of …
JPalakapillyKWH 15e59eb
added one more test to modelchain
JPalakapillyKWH 33c0bb8
threw code and some docs into horizon.rst
JPalakapillyKWH 18ccd1a
reverted irradiance, location and modelchain (and tests) to master
JPalakapillyKWH d1119ab
changed dip angles to elevation angles
JPalakapillyKWH 57c2035
removed horizon.rst for now
JPalakapillyKWH 00017e2
added DNI correction to horizon.py
JPalakapillyKWH a87b797
added a test case to get 100% of diff hit
JPalakapillyKWH aeb5f95
minor test fix
JPalakapillyKWH b022f9e
docstring changes and improvement to filter_points
JPalakapillyKWH d07e66f
added tests for functions added in tools.py. Some docstring changes a…
JPalakapillyKWH 2411520
minor improvements and docstring changes
JPalakapillyKWH 210fd1c
docstring changes
JPalakapillyKWH a630acc
reference update
JPalakapillyKWH File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
The ``horizon`` module contains functions for horizon profile modeling. | ||
There are various geometric utilities that are useful in horizon calculations. | ||
""" | ||
from __future__ import division | ||
|
||
import itertools | ||
|
||
|
@@ -65,7 +64,7 @@ def elevation_and_azimuth(pt1, pt2): | |
horizontal has a positive elevation angle. Also computes the azimuth | ||
defined as degrees East of North of the bearing from pt1 to pt2. | ||
This uses the Haversine formula. | ||
The method used to calculate the elevation angle is discussed in [1]. | ||
The trigonometry used to calculate the elevation angle is described in [1]. | ||
|
||
Parameters | ||
---------- | ||
|
@@ -100,6 +99,9 @@ def elevation_and_azimuth(pt1, pt2): | |
[36, 35, 231], | ||
[36, 35, 21]]) | ||
bearing, elev_angles = elevation_and_azimuth(site_loc, target_locs) | ||
|
||
|
||
[1] https://aty.sdsu.edu/explain/atmos_refr/dip.html | ||
''' | ||
# Equatorial Radius of the Earth (ellipsoid model) in meters | ||
a = 6378137.0 | ||
|
@@ -612,11 +614,14 @@ def calculate_dtf(horizon_azimuths, horizon_angles, | |
integral is the cosine of the angle between the incoming radiation and the | ||
vector normal to the surface. The method calculates a sum of integrations | ||
from the "peak" of the sky dome down to the elevation angle of the horizon. | ||
A similar method is used in section II of [1] although it is looking at | ||
both ground and sky diffuse irradiation. | ||
|
||
[1] Goss et al. (2014) Solar Energy 110, 410-419 | ||
|
||
[2] Wright D. (2019) IEEE Journal of Photovoltaics 9(2), 391-396 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks interesting. Could you send me a copy? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sent an email |
||
""" | ||
assert(horizon_azimuths.shape[0] == horizon_angles.shape[0]) | ||
if horizon_azimuths.shape[0] != horizon_angles.shape[0]: | ||
raise ValueError('azimuths and elevation_angles must be of the same' | ||
'length.') | ||
tilt_rad = np.radians(surface_tilt) | ||
plane_az_rad = np.radians(surface_azimuth) | ||
a = np.sin(tilt_rad) * np.cos(plane_az_rad) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could you mention the relevant section or equation(s) in [1]?
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.
Do you mean [2]?
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.
I only see one reference...
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.
my bad. latest changes have the new reference. Old one was wrong.
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.
Ok, I read this paper too. Which equation(s) are you implementing?