Modified the calc tilt angle function for pysam solar#646
Merged
johnjasa merged 1 commit intoNatLabRockies:developfrom Apr 6, 2026
Merged
Modified the calc tilt angle function for pysam solar#646johnjasa merged 1 commit intoNatLabRockies:developfrom
johnjasa merged 1 commit intoNatLabRockies:developfrom
Conversation
elenya-grant
approved these changes
Apr 3, 2026
Collaborator
elenya-grant
left a comment
There was a problem hiding this comment.
Thanks for this update and all the awesome tests for this function! Looks great to me!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix
calc_tilt_anglefor southern hemisphere (negative) latitudesPYSAMSolarPlantPerformanceModel.calc_tilt_anglepreviously passed latitude directly to the"lat"and"lat-func"tilt calculations. For southern hemisphere sites (negative latitudes), this produced negative or incorrect tilt angles.The fix applies
abs(latitude)before computing tilt in those branches, so positive and negative latitudes of the same magnitude yield identical tilt angles. The"none"branch is unaffected.Section 1: Type of Contribution
Section 2: General PR Checklist
docs/files are up-to-date, or added when necessaryCHANGELOG.md"A complete thought. [PR XYZ]((https://github.com/NatLabRockies/H2Integrate/pull/XYZ)", where
XYZshould be replaced with the actual number.Section 3: Related Issues
Resolves #645
N/A
Section 4: Impacted Areas of the Software
Section 4.1: New Files
N/A
Section 4.2: Modified Files
h2integrate/converters/solar/solar_pysam.pycalc_tilt_angle: Useabs(latitude)in the"lat"and"lat-func"branches to support southern hemisphere sites.h2integrate/converters/solar/test/test_pysam_solar.pyTestCalcTiltAngleclass (26 tests) covering alltilt_angle_funcmodes with positive, negative, zero, and boundary latitudes.Section 5: Additional Supporting Information
N/A
Section 6: Test Results, if applicable
All 26 new
TestCalcTiltAngletests pass. Existing PySAM solar tests are unaffected.