8000 Townsend snow by abhisheksparikh · Pull Request #1251 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content

Townsend snow #1251

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

Closed
wants to merge 10 commits into from
Closed

Conversation

abhisheksparikh
Copy link
Contributor
@abhisheksparikh abhisheksparikh commented Jul 2, 2021
  • Closes Implement monthly snow loss model #1246
  • I am familiar with the contributing guidelines
  • Tests added
  • Updates entries to docs/sphinx/source/api.rst for API changes.
  • Adds description and name entries in the appropriate "what's new" file in docs/sphinx/source/whatsnew for all changes. Includes link to the GitHub Issue with :issue:`num` or this Pull Request with :pull:`num`. Includes contributor name and/or GitHub username (link with :ghuser:`user`).
  • New code is fully documented. Includes numpydoc compliant docstrings, examples, and comments where necessary.
  • Pull request is nearly complete and ready for detailed review.
  • Maintainer: Appropriate GitHub Labels and Milestone are assigned to the Pull Request and linked Issue.

Copy link
Member
@cwhanse cwhanse left a comment

Choose a reason for hiding this comment

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

Thanks @abhisheksparikh this is a great start. Some comments for you to consider as you work through the formatting.

pvlib/snow.py Outdated
'''
return(np.where(N>0, 0.5 * S * (1 + 1/N), 0))

def townsend_snow_loss_model(S, N, tilt, RH, T_air, POA, R, H, P=40):
Copy link
Member

Choose a reason for hiding this comment

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

Prefer loss_townsend, and would prefer more descriptive parameter names e.g., snow_total instead of S, num_events instead of N. It's a good idea to maintain traceability to the terms used in the reference but we can do that in the description of each parameter.

@wholmgren wholmgren modified the milestones: 0.9.0, 0.9.1 Aug 7, 2021
@cwhanse cwhanse mentioned this pull request Mar 14, 2022
14 tasks
@abhisheksparikh
Copy link
Contributor Author

Excuse me for the long delay! I will be working on resolving the issues of this PR in the coming couple of days.

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.

Thanks @abhisheksparikh, looking good so far! Can you please also add an entry to docs/sphinx/source/whatsnew/v0.9.1.rst under Enhancements, and yourself to the contributors list?

Several other small changes - variable names change, comment change - in response to Kevin's review notes
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.

More nitpicking. I think after this it will be close!

@@ -28,6 +28,8 @@ Enhancements
* Added ``map_variables`` option to :func:`~pvlib.iotools.read_crn` (:pull:`1368`)
* Added :py:func:`pvlib.temperature.prilliman` for modeling cell temperature
at short time steps (:issue:`1081`, :pull:`1391`)
* Added Townsend Powers Snow loss model in :py:func:`pvlib.snow`
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Added Townsend Powers Snow loss model in :py:func:`pvlib.snow`
* Added Townsend-Powers monthly snow loss model: :py:func:`pvlib.snow.townsend`

-------
loss : numeric
Average monthly DC capacity loss due to snow coverage [%]

Copy link
Member

Choose a reason for hiding this comment

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

Let's add a Notes section here pointing out that this model has not been validated for tracking arrays, but the reference suggests using the maximum rotation angle in place of surface_tilt.

lower_edge_drop_height : float
Drop height from array edge to ground [in]

P : float
Copy link
Member

Choose a reason for hiding this comment

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

This P slipped through the cracks :)


GIT = 1 - C2 * np.exp(-gamma)
loss = (C1 * Se_weighted * (cosd(surface_tilt))**2 * GIT *
relative_humidity / (temp_air+273.15)**2 / poa_global**0.67) / 100
Copy link
Member

Choose a reason for hiding this comment

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

Good catch that temperature is in Kelvin 👍

Relative humidity [%]

temp_air : numeric
Ambient temperature [°C]
Copy link
Member

Choose a reason for hiding this comment

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

I think it's worth explicitly using the word "monthly" for all the monthly inputs, and "average/total/etc" as appropriate. Temperature is monthly average, and I'm not seeing it in the reference but I guess RH is monthly average as well?

Row length in the slanted plane of array dimension [in]

lower_edge_drop_height : float
Drop height from array edge to ground [in]
Copy link
Member

Choose a reason for hiding this comment

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

To discuss: what units should snow_total, slant_height, and lower_edge_drop_height use? I propose cm, m, m respectively, all for consistency with other pvlib functions.

Copy link
Contributor Author
@abhisheksparikh abhisheksparikh Mar 22, 2022

Choose a reason for hiding this comment

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

I prefer metric system over everything else :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can change slant_height and lower_edge_drop_height inputs to m. However, I think, we should leave snow_total in in because that's what is available in most of the weather sources. Thoughts?

Copy link
Member