Add support for diffuse irradiance components and component-specific IAM to ModelChain - #2847
Add support for diffuse irradiance components and component-specific IAM to ModelChain#2847cbcrespo wants to merge 39 commits into
ModelChain#2847Conversation
…tropic_components
Co-authored-by: Adam R. Jensen <39184289+AdamRJensen@users.noreply.github.com>
I understand that this is a clean way to handle things, however I thing it will just make people not use transposition models which don't provide components like Would it make sense that users in this case are allowed to use |
ModelChain#2846, GSoC 2026: Standardizing Diffuse Irradiance Components and Extending ModelChain Optical Loss Modeling #2750Updates entries indocs/sphinx/source/referencefor API changes.docs/sphinx/source/whatsnewfor 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`).remote-data) and Milestone are assigned to the Pull Request and linked Issue.This PR adds support for diffuse irradiance components and component-specific IAM to the
ModelChainclass, thereby closing the final stage of my GSoC project (#2750) 😄Note: This PR is currently based on #2845, which has not yet been merged. I expect reviewing will become easier once that PR is merged. Also, I’m very open to revisiting any of the design choices below based on feedback.
This adds a new
iam_diffuse_modelproperty toModelChain, which can be any of the three existing diffuse IAM functionsmarion_diffuse,martin_ruiz_diffuse, orschlick_diffuse, as well as'no_loss', which does not apply optical losses to diffuse irradiance. By default,iam_diffuse_modelisNone, in which case the previous behavior is preserved:ModelChainfetches theFD(fraction diffuse) module parameter for each array and applies it to the overall diffuse irradiance.FDis essentially always 1, meaning this behavior will generally be equivalent tono_loss.For
marion_diffusespecifically, an additional parametermarion_diffuse_modelis necessary (corresponding to themodelparameter ofiam.marion_diffuse). It defaults toNone, but can be inferred from the module parameters via the newinfer_marion_diffuse_model, which follows a similar logic to the existinginfer_aoi_model.A new
iam_diffuse_modifieris added to theModelChainResultdataclass.Circumsolar irradiance is treated as direct (i.e., the direct IAM is applied to it). The remaining diffuse components have their respective component-specific IAMs applied.
If a diffuse component is present for which the selected IAM model does not provide an IAM value, no optical losses are applied to that component and a warning is raised. This would happen, for example, with
perezandmartin_ruiz_diffuse: thepereztransposition model provides isotropic, circumsolar, and horizon components, while themartin_ruiz_diffusediffuse IAM model does not provide a horizon IAM.If the selected transposition model does not provide individual components for sky diffuse irradiance (as is the case for
klucher), optical losses are applied to the ground diffuse component only. The aggregate sky diffuse irradiance is left unmodified (IAM = 1), and a warning is raised to make this behavior explicit.