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
DIRINT and DIRINDEX discrepancies between 0.5.2 and 0.6.3 #738
We are in the process of upgrading PVLib from v0.5.2 to v0.6.3, and caught some big changes in the DIRINT and DIRINDEX functions. Here are some plots ran from the same notebook with both versions:
0.5.2
0.6.3
The GHI clearsky (used by the DIRINDEX model) seems to be kind of shifted compared to 0.5.2:
DIRINT changed compared to 0.5.2 and DIRINDEX is way off:
Is this expected? Or are we doing anything wrong? It seems it is due to the changes in #400. Wanted to share this before digging further into the root cause.
@cedricleroy not expected to see that increase in DNI at high zenith/air mass. @mikofski maybe #459 but I think it's more likely due to the zenith angle limit.
@cedricleroy could you plot some intermediates from the dirindex function, outputs of these lines:
@mikofski, @cwhanse: Confirmed that it has been introduced by #459. We don't have problems anymore when using the clear-sky model with perez_enhancement=True.
As the default is False, should expect users to be aware of that?
Another option might be to modify dirindex to use any clear sky as input - it's there a possibility for you to use simplified solis? TMY3 has aod and pwat
@mikofski I'd prefer not to do that in pvlib. The original reference for DIRINDEX builds in the Ineichen clearsky model. I don't think it's wrong to substitute a different clear sky model, but the result is not DIRINDEX as documented.
The paper behind DIRINDEX assumes the Ineichen model using the Perez enhancement. It appears that the enhancement was introduced as part of the DIRINDEX model, apparently to offset some systematic discrepancy. When the enhancement term is omitted then DIRINDEX suffers.
For the near term, @cedricleroy can move ahead by modifying his workflow. In pvlib, I see a few options:
do nothing and point re-discoverers of this problem to this discussion. I vote no here.
add a usage note to DIRINDEX docstring about the calculating clearsky_ghi and clearsky_dni inputs using Ineichen.
bring calculation of the clearsky GHI into DIRINDEX. I would prefer this option. It removes the flexibility of substituting other clear sky models for Ineichen, but DIRINDEX wasn't developed independent of Ineichen, and there's no validation outside of Ineichen.
@cedricleroy Does perez_enhancement=True give suspect results for you at higher latitudes? If yes, then it's not clear to me if resolution path #3 also solves this issue.
I vote for 2. Bringing the clear sky calculation into this function would require major API changes.
How so? My take is that the signature for dirindex would look more like dirint. We would not expose perez_enhancement as an argument in dirindex, since that is part of the DIRINDEX model, as I interpret the paper.
Edit - I see your point now, we'd drop a few arguments but would need to add others for the embedded call to ineichen.
I think what @wholmgren means is that ghi_clearsky and dni_clearsky are mandatory input to dirindex. If they are calculated within the function (not inputs anymore), it breaks the API.
As a user, I personally prefer the API breaking than upgrading to a version which leads to bad results without notification. And since PVLib implements "as per paper", removing the inputs will be less ambiguous maybe.
@cedricleroy Does perez_enhancement=True give suspect results for you at higher latitudes? If yes, > then it's not clear to me if resolution path #3 also solves this issue.
Hey @markcampanelli. I am not aware of this issue. What is a high latitude? Are you experiencing this?
@cedricleroy for more info on Ineichen clear sky high latitude discrepencies, see my previous comment, pr #459, and issue #435. In a nutshell, Ineichen mornings and evenings have unphysical peaks at high altitudes due to an undocumented extra parameter that seems to have been added just for Perez's DIRINDEX model maybe?
due to an undocumented extra parameter that seems to have been added just for Perez's DIRINDEX model maybe?
That's the way I interpret the sequence of papers - the "Perez enhancement" appears in the paper describing DIRINDEX, and I'm of the point of view that the enhancement is intrinsic to the DIRINDEX model. To be fair it is documented but not emphasized.
Activity
mikofski commentedon Jun 12, 2019
maybe this is related to changes in the clear sky model in #459 which was part of v0.6.0?
cwhanse commentedon Jun 12, 2019
@cedricleroy not expected to see that increase in DNI at high zenith/air mass. @mikofski maybe #459 but I think it's more likely due to the zenith angle limit.
@cedricleroy could you plot some intermediates from the
dirindexfunction, outputs of these lines:I might get to some diagnostics later this week.
cedricleroy commentedon Jun 12, 2019
v0.5.2
v0.6.3
cedricleroy commentedon Jun 13, 2019
@mikofski, @cwhanse: Confirmed that it has been introduced by #459. We don't have problems anymore when using the clear-sky model with
perez_enhancement=True.As the default is
False, should expect users to be aware of that?mikofski commentedon Jun 13, 2019
Another option might be to modify dirindex to use any clear sky as input - it's there a possibility for you to use simplified solis? TMY3 has aod and pwat
cwhanse commentedon Jun 13, 2019
@mikofski I'd prefer not to do that in pvlib. The original reference for DIRINDEX builds in the Ineichen clearsky model. I don't think it's wrong to substitute a different clear sky model, but the result is not DIRINDEX as documented.
cwhanse commentedon Jun 13, 2019
The paper behind DIRINDEX assumes the Ineichen model using the Perez enhancement. It appears that the enhancement was introduced as part of the DIRINDEX model, apparently to offset some systematic discrepancy. When the enhancement term is omitted then DIRINDEX suffers.
For the near term, @cedricleroy can move ahead by modifying his workflow. In pvlib, I see a few options:
cwhanse commentedon Jun 18, 2019
Any objections to #3 above, as the resolution path?
cedricleroy commentedon Jun 18, 2019
markcampanelli commentedon Jun 18, 2019
@cedricleroy Does
perez_enhancement=Truegive suspect results for you at higher latitudes? If yes, then it's not clear to me if resolution path #3 also solves this issue.wholmgren commentedon Jun 18, 2019
I vote for 2. Bringing the clear sky calculation into this function would require major API changes.
cwhanse commentedon Jun 19, 2019
How so? My take is that the signature for
dirindexwould look more likedirint. We would not exposeperez_enhancementas an argument indirindex, since that is part of the DIRINDEX model, as I interpret the paper.Edit - I see your point now, we'd drop a few arguments but would need to add others for the embedded call to
ineichen.cedricleroy commentedon Jun 19, 2019
I think what @wholmgren means is that
ghi_clearskyanddni_clearskyare mandatory input todirindex. If they are calculated within the function (not inputs anymore), it breaks the API.As a user, I personally prefer the API breaking than upgrading to a version which leads to bad results without notification. And since PVLib implements "as per paper", removing the inputs will be less ambiguous maybe.
Hey @markcampanelli. I am not aware of this issue. What is a high latitude? Are you experiencing this?
mikofski commentedon Jun 23, 2019
@cedricleroy for more info on Ineichen clear sky high latitude discrepencies, see my previous comment, pr #459, and issue #435. In a nutshell, Ineichen mornings and evenings have unphysical peaks at high altitudes due to an undocumented extra parameter that seems to have been added just for Perez's DIRINDEX model maybe?
markcampanelli commentedon Jun 23, 2019
@cedricleroy I can offer no further insight, other than I recognized the potential artifact after reading through the above referenced issue and pr.
cwhanse commentedon Jun 24, 2019
That's the way I interpret the sequence of papers - the "Perez enhancement" appears in the paper describing DIRINDEX, and I'm of the point of view that the enhancement is intrinsic to the DIRINDEX model. To be fair it is documented but not emphasized.