-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add polo-smm #2491
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
Open
jesuspolo
wants to merge
26
commits into
pvlib:main
Choose a base branch
from
jesuspolo:polo-smm
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add polo-smm #2491
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
3363ace
Add polo-smm
jesuspolo ceba758
Apply suggestions from code review
jesuspolo 36c9b43
Update mismatch.py
jesuspolo eaa90b4
Update mismatch.py
jesuspolo 794ed98
Update mismatch.py
jesuspolo 7926a3d
Update mismatch.py
jesuspolo 988557c
Update mismatch.py
jesuspolo 45e768f
Update mismatch.py
jesuspolo 38e5694
Update pvlib/spectrum/mismatch.py
jesuspolo c24e013
Update pvlib/spectrum/mismatch.py
jesuspolo 0a00f1b
Changes from code review
AdamRJensen 2a9d0db
Add function to spectrum/__init__.py
AdamRJensen f296c7b
Update test_mismatch.py
jesuspolo ce862d8
Update test_mismatch.py
jesuspolo 11336ab
Fix module import in tests
AdamRJensen e418218
Update test_mismatch.py
jesuspolo fb0ad0e
Merge branch 'polo-smm' of https://github.com/jesuspolo/pvlib-python …
jesuspolo 450dd37
Fix linter
AdamRJensen 1eb3293
Remove tab character
AdamRJensen 4892e8d
Update test_mismatch.py
jesuspolo 7513f3e
Update test_mismatch.py
jesuspolo 3e4dd56
Update test_mismatch.py
jesuspolo b9d21ac
fix line legth linter error
AdamRJensen 49c8c91
Update test_mismatch.py
jesuspolo fa3ff32
Merge branch 'polo-smm' of https://github.com/jesuspolo/pvlib-python …
jesuspolo 31fe508
Update mismatch.py
jesuspolo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -757,47 +757,39 @@ | |
| [1]. Polo, J., Sanz-saiz, C., Development of spectral mismatch models | ||
| for BIPV applications in building façades Abbreviations : Renew. Energy 245 | ||
| ,122820, 2025.:doi:`10.1016/j.renene.2025.122820` | ||
| """ | ||
| if module_type is None and coefficients is None: | ||
| raise ValueError('Must provide either `module_type` or `coefficients`') | ||
| if module_type is not None and coefficients is not None: | ||
| raise ValueError('Only one of `module_type` and `coefficients` should ' | ||
| 'be provided') | ||
|
|
||
| am_aoi = pvlib.atmosphere.get_relative_airmass(aoi) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will produce a |
||
| pressure = pvlib.atmosphere.alt2pres(altitude) | ||
| am90 = pvlib.atmosphere.get_absolute_airmass(am_aoi,pressure) | ||
| am90 = pvlib.atmosphere.get_absolute_airmass(am_aoi, pressure) | ||
| Ram = am90/airmass_absolute | ||
|
|
||
| _coefficients = {} | ||
| _coefficients = { | ||
| 'cdte': (-0.0009, 46.80, 49.20, -0.87, 0.00041, 0.053), | ||
| 'monosi': (0.0027, 10.34, 9.48, 0.307, 0.00077, 0.006), | ||
| 'cigs': (0.0017, 2.33, 1.30, 0.11, 0.00098, -0.0177), | ||
| 'asi': (0.0024, 7.32, 7.09, -0.72, -0.0013, 0.089), | ||
| } | ||
|
|
||
| c = { | ||
| 'asi': (0.0056, -0.020, 1.014), | ||
| 'cigs': (-0.0009, -0.0003, 1), | ||
| 'cdte': (0.0021, -0.01, 1.01), | ||
| 'monosi': (0, -0.003, 1.0), | ||
| } | ||
|
|
||
| if module_type is not None: | ||
| if module_type is not None: | ||
AdamRJensen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| coeff = _coefficients[module_type] | ||
| c_albedo = c[module_type] | ||
| else: | ||
| coeff = coefficients | ||
| c_albedo = (0.0, 0.0, 1.0) # 0.2 albedo assumed | ||
| albedo = 0.2 | ||
|
|
||
| smm = coeff[0] * Ram + coeff[1] / (coeff[2] + Ram**coeff[3]) \ | ||
| + coeff[4] / aod500 + coeff[5]*np.sqrt(precipitable_water) | ||
|
|
||
| # Ground albedo correction | ||
| g = c_albedo[0] * (albedo/0.2)**2 \ | ||
| + c_albedo[1] * (albedo/0.2) + c_albedo[2] | ||
|
|
||
| return g*smm | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.