Skip to content

Fix dirint NaN at night and for missing temp_dew - #2901

Open
vera-rubin wants to merge 1 commit into
pvlib:mainfrom
vera-rubin:fix/dirint-night-and-missing-dew
Open

vera-rubin wants to merge 1 commit into
pvlib:mainfrom
vera-rubin:fix/dirint-night-and-missing-dew

Conversation

@vera-rubin

@vera-rubin vera-rubin commented Oct 14, 2026 •

Copy link
Copy Markdown
  • I am familiar with the contributing guidelines
  • I attest that all AI-generated material has been vetted for accuracy and is in compliance with the pvlib license
    • AI-assisted.
  • Tests added
  • Adds description and name entries in the "what's new" file
  • Pull request is nearly complete and ready for detailed review.

Two fixes in dirint: re-apply the max_zenith zero after the coefficient step, and treat a NaN temp_dew sample as "no dew point". One regression test covers both.

Fixes #2900

— ChipLab

dirint returned NaN where solar_zenith is above 90 degrees: the DIRINT
coefficient is NaN there because the airmass is undefined, and it turned
the zero DNI from disc into NaN. Reapply the max_zenith cutoff after the
coefficient multiplication.

A NaN temp_dew value also left the precipitable water bin unassigned.
Use the dew point unavailable bin for missing values, as the dirint,
dirindex and gti_dirint docstrings describe.

Add a regression test and a whatsnew entry.
@github-actions

Copy link
Copy Markdown

Hey @vera-rubin! 🎉

Thanks for opening your first pull request! We appreciate your
contribution. Please ensure you have reviewed and understood the
contributing guidelines.

If AI is used for any portion of this PR, you must vet the content
for technical accuracy.

Finally, be sure the PR description includes the PR
checklist,
and complete the items you are able to.

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.

DIRINT loses the nighttime zero and missing-dew-point fallback

1 participant