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

Shaded Fraction on Sloped Terrains - PR1725 partial continuation #1962

Merged

Conversation

echedey-ls
Copy link
Contributor

@echedey-ls echedey-ls commented Feb 3, 2024

See #1725 for context.

Link to docs

I moved the linear loss model to #2004

Feel free to suggest anything and ask about the adopted solutions.

@echedey-ls echedey-ls marked this pull request as ready for review February 3, 2024 23:54
@echedey-ls echedey-ls force-pushed the pr1725-continuation-shaded-fraction-mikofski branch 2 times, most recently from a6dbae1 to 481a2e3 Compare February 15, 2024 19:25
@kandersolar
Copy link
Member

Does, for example, a N-S SAT tracker azimuth follow the East - West direction or the torque tube? I would say the azimuth and elevation define the normal vector of any PV panel on it, but I'm not at all sure.

A distinction needs to be drawn between the angles that define the orientation of tracker and the angles that define the orientation of the modules on the tracker. A single-axis tracker with N-S axis has constant axis_azimuth=180 (or zero, but 180 is better). The modules on the tracker will have surface_azimuth=90 in the morning and surface_azimuth=270.

I will take a closer look at this PR in the coming days. Thanks for your patience @echedey-ls!

@echedey-ls
Copy link
Contributor Author

echedey-ls commented Feb 27, 2024

Lot of thanks for clearing this up. Now I feel like it's obvious.

Don't worry about the review. I know it's premature to open a PR based on another one (I've got yet another one in the drawer that needs this implementation to work, sorry 😬 )

@echedey-ls echedey-ls force-pushed the pr1725-continuation-shaded-fraction-mikofski branch from ee47994 to aeed6af Compare February 27, 2024 23:24
@williamhobbs
Copy link
Contributor

I'm late jumping in here, but one thought I have: does this need to be limited to trackers? Or can the function name and variable names be updated to more generally cover fixed or tracking rows?

@mikofski
Copy link
Member

It should work for fixed tilt just fine, so not limited to trackers

@williamhobbs
Copy link
Contributor

Thanks, @mikofski. It seems like it would be helpful to change:

  • the function name from tracker_shaded_fraction to shaded_fraction,
  • the variables tracker_tilt and tracker_azimuth to surface_tilt and surface_azimuth, and
  • references in the docs to “trackers” to “rows”

or something like that.

@mikofski
Copy link
Member

mikofski commented Feb 28, 2024

Maybe I misspoke. Sorry, I meant to say that it could be repurposed for fixed tilt with some care, but, I’m not sure if we should make it all purpose for both fixed tilt & SAT. For one, tracker azimuth and surface azimuth mean different things, so we can’t just swap them.

I think it would work if we treat fixed tilt as a tracker aligned east to west and set the tracker azimuth to either 90° or 270° measured clockwise from north, or 90° from the surface azimuth. Like a similar issue you raised recently, if azimuth were 90° then tilts would be negative if north and positive if south.

Currently this algorithm doesn’t seem to account for tracker axis tilt, but as I mentioned in the original PR #1725 I think it could be managed when calculating projected solar zenith? A tracker axis tilt would correspond to an east-west slope for a fixed tilt.

Anyway I apologize for being too glib, I should have been more careful in my replies, again sorry.

@echedey-ls
Copy link
Contributor Author

I agree with @williamhobbs. surface_tilt and surface_azimuth terms seem to apply to all contexts independently of the used tracker, so they are less prone to be misunderstood by a user.

Copy link
Member

@kandersolar kandersolar left a comment

Choose a reason for hiding this comment

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

The docs build is failing because the example gallery is still using the old parameter names. Other than that, LGTM!

FYI I believe @AdamRJensen plans to review as well.

Co-Authored-By: Kevin Anderson <57452607+kandersolar@users.noreply.github.com>
@echedey-ls
Copy link
Contributor Author

Well spotted, I always miss something...

FYI I believe @AdamRJensen plans to review as well.

All feedback is welcome, even better if it comes from one of the authors 😉

@kandersolar kandersolar modified the milestones: v0.10.5, 0.11.0 May 3, 2024
Copy link
Member

@AdamRJensen AdamRJensen left a comment

Choose a reason for hiding this comment

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

An initial review of the gallery example

latitude, longitude = 28.51, -13.89
altitude = pvlib.location.lookup_altitude(latitude, longitude)

axis_tilt = 3 # degrees
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a comment about what this represents?

Copy link
Contributor Author

@echedey-ls echedey-ls May 23, 2024

Choose a reason for hiding this comment

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

Let me know your opinion on axis_tilt = 3 # degrees, positive is upwards in the axis_azimuth direction (edit: already commited)

Copy link
Member

@AdamRJensen AdamRJensen left a comment

Choose a reason for hiding this comment

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

Awesome stuff @echedey-ls !

I'm really looking forward to using this.

docs/sphinx/source/whatsnew/v0.10.5.rst Outdated Show resolved Hide resolved
pvlib/shading.py Outdated Show resolved Hide resolved
pvlib/shading.py Outdated Show resolved Hide resolved
pvlib/shading.py Outdated Show resolved Hide resolved
pvlib/shading.py Outdated Show resolved Hide resolved
pvlib/shading.py Outdated Show resolved Hide resolved
pvlib/shading.py Outdated Show resolved Hide resolved
pvlib/shading.py Outdated Show resolved Hide resolved
pvlib/shading.py Outdated Show resolved Hide resolved
pvlib/shading.py Outdated Show resolved Hide resolved
echedey-ls and others added 6 commits May 23, 2024 19:15
Co-authored-by: Adam R. Jensen <39184289+AdamRJensen@users.noreply.github.com>
Co-Authored-By: Adam R. Jensen <39184289+AdamRJensen@users.noreply.github.com>
Co-Authored-By: Adam R. Jensen <39184289+AdamRJensen@users.noreply.github.com>
@echedey-ls
Copy link
Contributor Author

Everything's ready IMO 😄 . Feel free to review and propose changes 📝

Co-authored-by: Adam R. Jensen <39184289+AdamRJensen@users.noreply.github.com>
@AdamRJensen AdamRJensen added the GSoC Contributions related to Google Summer of Code. label May 24, 2024
@kandersolar
Copy link
Member

I just fixed a syntax issue and linter issue, and then fixed a new syntax issue I introduced...

Thanks for this great contribution @echedey-ls!

@kandersolar kandersolar merged commit d53f97e into pvlib:main May 24, 2024
30 checks passed
@echedey-ls echedey-ls deleted the pr1725-continuation-shaded-fraction-mikofski branch May 24, 2024 19:30
@echedey-ls
Copy link
Contributor Author

Excited to see this merged! Thanks to everyone that helped move this forward!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement GSoC Contributions related to Google Summer of Code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add shaded fraction (FS) calculation for true-tracking on flat terrain
7 participants