You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
make projected solar zenith a convenience function #1734
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
As mentioned in #1725 (comment) the projected solar zenith (PSZ) is used more than once, and may benefit from having a standalone function for reuse to remove redundant code.
Describe the solution you'd like
A clear and concise description of what you want to happen.
a new function perhaps in tools or tracking like this:
A clear and concise description of any alternative solutions or features you've considered.
For linear shade calculation in #1725 the user is required to calculate PSZ externally.
Additional context
Add any other context or screenshots about the feature request here.
one version of the PSZ calculation is currently in tracking.py based on the solar vector as seen in the orientation of the tracker axes, that's why axis tilt appears in this "transformed" solar vector:
IDK the correct name for this. If anyone has a stronger opinion please weigh in, otherwise @echedey-ls just go with “profile angle” as @adriesse suggests. As long as it’s well defined, hopefully that should be enough. Do not let perfect be the enemy of good.
I've not heard "profile angle" before. I think I recall hearing a tracker manufacturer call it the "projected solar zenith angle", and that's what I call it too.
I think what we implement ought to account for axis_tilt and axis_azimuth. Where should it live? pvlib.tracking and pvlib.shading seem appropriate to me. If this function is intended to be user-facing (which I think it should be), I'd be -1 to putting it in pvlib.tools.
Once the new function is created, I think pvlib.tracking.singleaxis should call it, and calls to pvlib.bifacial.utils._solar_projection_tangent should be replaced with calls to it.
The relevant equations are Eq 1 with Eq 11 for $\omega_{ID}$ in Lorenzo, or Eq 7 for $R$ in Marion, or Eq 5 for $\theta_T$ in Slope-Aware Backtracking. They use different symbols, but I think the math is all equivalent. Section 7, step 3 in Slope-Aware Backtracking might be helpful.
Where should it live? pvlib.tracking and pvlib.shading seem appropriate to me. If this function is intended to be user-facing (which I think it should be), I'd be -1 to putting it in pvlib.tools.
I'm also -1 to a user facing function in pvlib.tools. pvlib.irradiance is a bit of a junk drawer, but is it more appropriate than the relatively specific pvlib.tracking and pvlib.shading? At the risk of scope creep and unwise API deprecations, geometry.py came to mind for this and the AOI functions in irradiance.
I'm in favour of a geometry.py or something along angles.py or angular.py for this function, aoi and aoi_projection. I didn't expect the latter two to be in irradiance.py
For me, aoi.py > geometry.py. Into shading.py seems like a last resort. My thought is that a user might guess a function like this would be in aoi.py and wouldn't know what to expect of geometry.py.
Reacted by Mark Mikofski, Echedey Luis, Kevin Anderson and Adam R. Jensen
In case there aren't enough options yet, maybe spatial.py? I would personally go the path of least resistance and put it in irradiance.py until the next big reorg.
Activity
kandersolar commentedon May 12, 2023
I'm definitely in favor of having a function to calculate this quantity. It's a step towards #1581 (comment).
adriesse commentedon May 20, 2023
This angle is also referred to as the profile angle sometimes, correct?
echedey-ls commentedon Nov 4, 2023
I'd like to know that too, in order to contribute to this issue and move forward #1725
mikofski commentedon Nov 4, 2023
IDK the correct name for this. If anyone has a stronger opinion please weigh in, otherwise @echedey-ls just go with “profile angle” as @adriesse suggests. As long as it’s well defined, hopefully that should be enough. Do not let perfect be the enemy of good.
kandersolar commentedon Nov 6, 2023
I've not heard "profile angle" before. I think I recall hearing a tracker manufacturer call it the "projected solar zenith angle", and that's what I call it too.
I think what we implement ought to account for
axis_tiltandaxis_azimuth. Where should it live?pvlib.trackingandpvlib.shadingseem appropriate to me. If this function is intended to be user-facing (which I think it should be), I'd be -1 to putting it inpvlib.tools.Options for references:
Once the new function is created, I think
pvlib.tracking.singleaxisshould call it, and calls topvlib.bifacial.utils._solar_projection_tangentshould be replaced with calls to it.echedey-ls commentedon Nov 6, 2023
I don't get how
axis_tiltandaxis_azimuthshould be implemented here. @kandersolar can you point me to any equation that takes that into account?Edit: at least on the last two papers which have many more equations I don't know what would be implemented.
kandersolar commentedon Nov 6, 2023
The relevant equations are Eq 1 with Eq 11 for$\omega_{ID}$ in Lorenzo, or Eq 7 for $R$ in Marion, or Eq 5 for $\theta_T$ in Slope-Aware Backtracking. They use different symbols, but I think the math is all equivalent. Section 7, step 3 in Slope-Aware Backtracking might be helpful.
wholmgren commentedon Nov 16, 2023
I'm also -1 to a user facing function in
pvlib.tools.pvlib.irradianceis a bit of a junk drawer, but is it more appropriate than the relatively specificpvlib.trackingandpvlib.shading? At the risk of scope creep and unwise API deprecations,geometry.pycame to mind for this and the AOI functions inirradiance.echedey-ls commentedon Nov 16, 2023
I'm in favour of a
geometry.pyor something alongangles.pyorangular.pyfor this function,aoiandaoi_projection. I didn't expect the latter two to be inirradiance.pyadriesse commentedon Nov 16, 2023
For the curious:
https://www.google.com/search?q=%22profile+angle%22+sun
cwhanse commentedon Nov 17, 2023
For me,
aoi.py>geometry.py. Intoshading.pyseems like a last resort. My thought is that a user might guess a function like this would be inaoi.pyand wouldn't know what to expect ofgeometry.py.adriesse commentedon Nov 17, 2023
In case there aren't enough options yet, maybe
spatial.py? I would personally go the path of least resistance and put it inirradiance.pyuntil the next big reorg.