Merged
Conversation
2ee57b2 to
cfc630f
Compare
cfc630f to
fe1d465
Compare
aclerc
approved these changes
Mar 9, 2026
Contributor
aclerc
left a comment
There was a problem hiding this comment.
Thanks Sam! I think this is OK to merge
Minor comments:
- it looks like the forward fill is done no matter what but then overwritten by site mean if that option is enabled. is that intentional? might be more convention to if-else this logic.
- there might be an issue with this option if the test and reference turbines have different turbine types (reversal analysis). but I suspect this is not the only part of the code base where there is a logical issue with only passing the test turbine type into
_calc_test_ref_results. given this is an optional non-standard feature I'm ok to push forward. maybe raise an issue so this logical problem is noted.
Collaborator
Author
Thanks for highlighting this, I've created issue #87 |
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.
Summary
When
gapfill_uplift_curve_using_site_mean_power_curve = Truein theWindUpConfig, any wind speed bin with insufficient data (fewer than 3 hours per m/s of bin width) is filled using the site mean power curve rather than the previous flat fill approach.Problem
Previously, when a turbine/period had sparse data at high wind speeds,
_cook_ppwould detect a false "rated wind speed" at the highest observed power value and fill all wind speed bins above that with that single flat power value. For example, a turbine rated at 1300 kW when reaching 12 m/s could have its cooked power curve clip flat at 700 kW if data above 8 m/s wind speed was sparse, leading to an unrealistic power curve for the uplift calculation.Solution
The site mean power curve is already computed during preprocessing from all turbines of the same type across the full dataset. For each invalid bin, the corresponding power value is now obtained by linearly interpolating the site mean curve at that bin's midpoint wind speed.
This means a bin at 10 m/s gets the site mean power at 10 m/s, a bin at 14 m/s gets the site mean power at 14 m/s, and so on, allowing the cooked power curve to follow the site mean curve up to rated power rather than clipping flat at lower power.
Changes
gapfill_uplift_curve_using_site_mean_power_curve: bool = FalsetoWindUpConfigsite_mean_pc_dfoptional parameter to_cook_pp, threaded through pp analysis functionsmain_analysis.py,scada_pc(already available per turbine type) is passed assite_mean_pc_dfwhen theWindUpConfig.gapfill_uplift_curve_using_site_mean_power_curveflag is enabledNotes
pre_validorpost_validisFalsesite_mean_pc_df=None(the default), behaviour is identical to beforetest_cook_pp.pycovering the gap-filling behaviour