Skip to content

Safely calculate dni from dhi and ghi. #249

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 42 commits into from
Closed

Conversation

uvchik
Copy link
Contributor

@uvchik uvchik commented Oct 17, 2016

This PR is a little bit confusing, because it works on top of PR #239. The changes of this PR start with commit 6907b6c. It will be easier to read once PR #239 is merged.

The aim of this PR is to safely calculate DNI from GHI and DHI. There are different approaches and we may collect them within this function. A method parameter (or something similar) can be used to switch between the different approaches.

As this PR is a spin-off from PR #239 there are already two comments regarding this PR.

@adriesse wrote:

For your specific example, you can keep DNI values somewhat sane by not allowing them to be greater than a value obtained from a clear-sky model. Calculating the sun angles for the midpoint of the averaging interval is common practice (I hope). For long time steps like one hour, you can split the intervals that includes sunrise/set into two parts (one before and one after the event).

@cwhanse wrote:

Ø Calculating the angles for the midpoint of the averaging interval is common practice (I hope). It ought to be common practice. SAM does it, as does PVsyst I think, but other applications? We ought to build this capability into pvlib I think, as part of model chain – a kwarg switch perhaps?

A rough approach is to use the horizontal value for low angles, as there might not be relevant irradiation at small angles (high zenith angles) or set it to zero.

dni = (ghi - dhi) / tools.cosd(zenith)
dni[zenith > 88] = ghi[zenith > 88] - dhi[zenith > 88]
# or
dni[zenith > 88] = 0
  1. What methods do we want to implement?
  2. How do we want to switch between methods?

@birgits will help to implement this feature.

uvchik and others added 30 commits September 1, 2016 11:44
@wholmgren
Copy link
Member

Can you rebase this on the squashed commit created by merging #239? That will make it easier to review.

@uvchik
Copy link
Contributor Author

uvchik commented Oct 18, 2016

Replaced by #250.

@uvchik uvchik closed this Oct 18, 2016
@uvchik uvchik deleted the safe_dni branch October 18, 2016 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants