Skip to content

Use site mean power curve#86

Merged
samuelwnaylor merged 1 commit intomainfrom
use-site-mean-power-curve
Mar 10, 2026
Merged

Use site mean power curve#86
samuelwnaylor merged 1 commit intomainfrom
use-site-mean-power-curve

Conversation

@samuelwnaylor
Copy link
Collaborator

@samuelwnaylor samuelwnaylor commented Mar 6, 2026

Summary

When gapfill_uplift_curve_using_site_mean_power_curve = True in the WindUpConfig, 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_pp would 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

  • Added gapfill_uplift_curve_using_site_mean_power_curve: bool = False to WindUpConfig
  • Added site_mean_pc_df optional parameter to _cook_pp, threaded through pp analysis functions
  • In main_analysis.py, scada_pc (already available per turbine type) is passed as site_mean_pc_df when the WindUpConfig.gapfill_uplift_curve_using_site_mean_power_curve flag is enabled

Notes

  • Valid bins (those with sufficient measured data) are completely unaffected, because the interpolation only applies where pre_valid or post_valid is False
  • When site_mean_pc_df=None (the default), behaviour is identical to before
  • Tests added in test_cook_pp.py covering the gap-filling behaviour

@samuelwnaylor samuelwnaylor force-pushed the use-site-mean-power-curve branch 2 times, most recently from 2ee57b2 to cfc630f Compare March 6, 2026 21:18
@samuelwnaylor samuelwnaylor marked this pull request as ready for review March 6, 2026 21:57
@samuelwnaylor samuelwnaylor requested a review from aclerc as a code owner March 6, 2026 21:57
@samuelwnaylor samuelwnaylor force-pushed the use-site-mean-power-curve branch from cfc630f to fe1d465 Compare March 9, 2026 15:34
Copy link
Contributor

@aclerc aclerc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@samuelwnaylor
Copy link
Collaborator Author

  • 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.

Thanks for highlighting this, I've created issue #87

@samuelwnaylor samuelwnaylor merged commit 351e7f6 into main Mar 10, 2026
4 checks passed
@samuelwnaylor samuelwnaylor deleted the use-site-mean-power-curve branch March 10, 2026 11:42
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.

2 participants