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

Allow arbitrary IAM function in pvlib.iam.marion_diffuse #2049

Open
markcampanelli opened this issue May 12, 2024 · 5 comments · May be fixed by #2050
Open

Allow arbitrary IAM function in pvlib.iam.marion_diffuse #2049

markcampanelli opened this issue May 12, 2024 · 5 comments · May be fixed by #2050

Comments

@markcampanelli
Copy link
Contributor

Is your feature request related to a problem? Please describe.
I am working on an application using pvlib.iam.marion_diffuse, and I would like to inject my own IAM function (from interpolated IEC 61853-2 data) as a parameter to pvlib.iam.marion_diffuse.

Describe the solution you'd like
Add the option for passing a callable to pvlib.iam.marion_diffuse instead of the existing strings for the builtin IAM model functions. (The existing strings would still be accepted.)

Also add a function to create IAM functions as a PCHIP interpolation of data such as from IEC 61853-2. Note that this solution can also be made to add support for passing the existing pvlib.iam.interp function (whose cubic option is slightly different that pchip) to pvlib.iam.marion_diffuse.

Describe alternatives you've considered
Rolling my own interpolant each time, and then calling the lower-level pvlib.iam.marion_integrate for each of the three components.

Additional context
This is a followup to #1980, but without any concern to improving the diffuse-horizontal integral.

image

@adriesse
Copy link
Member

Have you considered adding the pchip option into pvlib.iam.interp rather than creating a new function?

@markcampanelli
Copy link
Contributor Author

@adriesse

Have you considered adding the pchip option into pvlib.iam.interp rather than creating a new function?

I am open to this consolidation. Do you think folks would be open to pvlib.iam.interp returning a callable that could then be passed to the new pvlib.iam.marion_diffuse (or used for other calculations)?

If I understand correctly, this avoids some overhead of recreating the interpolating function on each usage, although it would break the existing interface to pvlib.iam.interp.

@adriesse
Copy link
Member

@adriesse

Have you considered adding the pchip option into pvlib.iam.interp rather than creating a new function?

I am open to this consolidation. Do you think folks would be open to pvlib.iam.interp returning a callable that could then be passed to the new pvlib.iam.marion_diffuse (or used for other calculations)?

If I understand correctly, this avoids some overhead of recreating the interpolating function on each usage, although it would break the existing interface to pvlib.iam.interp.

I think Marion only has one call to the model.

@markcampanelli
Copy link
Contributor Author

I noticed that the builtin interp and schlick AOI modifiers didn't have full support in ModelChain like the other builtins, so I'm trying to add that here too.

@echedey-ls
Copy link
Contributor

Feel free to break down these issues into different PRs, doing too many things in one big PR makes the review process more time consuming - and reviewers more hesitant to review.

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 a pull request may close this issue.

3 participants