-
Notifications
You must be signed in to change notification settings - Fork 26
Implement automatic model calibration #238
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
Merged
Merged
Changes from all commits
Commits
Show all changes
171 commits
Select commit
Hold shift + click to select a range
bdc95e0
Add new `FlascDataFrame` object to enhance user interface with data (…
misi9170 ff8e962
Add dataframe conversions to flascdataframe (#211)
paulf81 ebe1451
Add wind up example using `FlascDataFrame` (#210)
aclerc fb6ff8d
loosen wind-up dependency
paulf81 67a0de9
Add examples
paulf81 9f0fa08
add model fit
paulf81 1877d34
add tests
paulf81 9ce5b60
Clean up a little
paulf81 3d41415
Reorganize
paulf81 7d61e56
Ignore data holding output files
paulf81 7c5cf43
Generate farm data
paulf81 416effc
Add turbine_groupings to cost routing
paulf81 005a028
Cost function optimization library
paulf81 9b0a8e8
bugfix
paulf81 db45287
Can't insist on time
paulf81 a2ce114
Add optimizations
paulf81 19d8921
Add a test notebook
paulf81 4532db4
small update
paulf81 d2acbb3
Don't copy floris model
paulf81 d14a177
add optuna
paulf81 5091d24
reorg and add optuna
paulf81 de66ad8
Update example
paulf81 9d79cc9
Merge branch 'develop' into feature/modelfit_2
paulf81 f7547d8
Merge branch 'develop' into feature/modelfit_2
paulf81 1e8cdf7
Add optuna dependecy
paulf81 34167a0
Merge branch 'develop' into feature/modelfit_2
paulf81 570f661
Merge branch 'develop' into feature/modelfit_2
paulf81 5dba5ad
Update to parflorismodel
paulf81 2668f9f
clean up docs
paulf81 569bf4c
Merge branch 'develop' into feature/modelfit_2
paulf81 4775168
Merge branch 'develop' into feature/modelfit_2
paulf81 15fd0d0
Add estimate_ws_with_floris
paulf81 69d0a7c
Add temp development notebook
paulf81 def5c82
Add a test
paulf81 18deef8
update cost function
paulf81 d9d4344
Merge branch 'ws_est' into feature/modelfit_2
paulf81 5ce287f
Update cost library
paulf81 4ae5921
Add timeout to optuna
paulf81 12299b2
change n_trials default
paulf81 b35982a
use values for alignment
paulf81 285d2cd
add turbine_by_turbine
paulf81 664e5b2
fix function
paulf81 a28b82b
Add save on df floris
paulf81 3f0a8e3
add set wd_std function
paulf81 148b982
add opt with uncertainty
paulf81 edb0944
bugfix
paulf81 3d7f489
add expected turbine error
paulf81 8ea28c9
Add protections against index mismatch
paulf81 8f0230e
give clearer names to cost functions
paulf81 6cc8b12
Add initial enqueing
paulf81 6800b95
Delete unused aggregate opts
paulf81 0f9c6ae
Merge branch 'develop' into feature/modelfit_2
paulf81 92e7742
precommit
paulf81 f13258a
Update hooks
paulf81 1e6fce9
fix tests
paulf81 1d84482
Return study object
paulf81 487ea5d
Merge branch 'develop' into feature/modelfit_2
paulf81 b56e0a0
ruff format
paulf81 8d8c4da
Merge branch 'develop' into feature/modelfit_2
paulf81 f045a4b
Update numpy req
paulf81 535998e
Point to develop
paulf81 b714587
fix inf syntax
paulf81 0be814c
Merge branch 'develop' into feature/modelfit_2
paulf81 d03d988
Merge branch 'feature/up_numpy' into feature/modelfit_2
paulf81 c6f5fac
Add abs function
paulf81 816bebf
Add cost library tests
paulf81 1604b07
fix tests
paulf81 95f0466
formatting
paulf81 b160927
Add future annotations
paulf81 830a5f6
Merge branch 'develop' into feature/modelfit_2
paulf81 9c2b680
Clean up example 0
paulf81 2afaa16
Update example 1
paulf81 533ea1f
Update example 1
paulf81 2a07475
Update opt_library
paulf81 63fd90c
Update optimization example
paulf81 509c6ee
add gauss turbopark
paulf81 a84e725
update examples
paulf81 2cc5a7c
Allow random seed setting; warn, rather than error, if turbine counts…
misi9170 279973d
Arg doc and name study.
misi9170 a562fdb
Formatting
misi9170 cb38b50
add results analysis module
paulf81 e3fdf09
include great tables
paulf81 58cec37
Formatting
misi9170 be6e358
Generalize table
paulf81 b456bbd
resolve merge
paulf81 89c1493
Include total farm result table
paulf81 6cf490e
Remove requirement that pow_000 exists
misi9170 c091deb
Select cost comparison by pow_xxx cols available in df_scada
misi9170 46a810e
Fix error introduced in in_flasc_format and update cost_libarary_test…
misi9170 a111fb4
Formatting
misi9170 76871ca
Add splitting options
paulf81 d36f790
Add turbine_subset option
paulf81 9db5dba
some changes
paulf81 24c083b
Merge branch 'feature/modelfit_2' of github.com:paulf81/flasc into fe…
paulf81 54ab31d
Add time back in
paulf81 b093954
fix conversion
paulf81 87bd39b
start on updated examples
paulf81 76c0c4e
linting
paulf81 e80af64
ignore rules
paulf81 dc21600
remove comments
paulf81 5d6b776
better docstrings
paulf81 21f8e50
improve docstrings and add warnings
paulf81 6780c67
better docstrings
paulf81 d4556e6
remove mixing gain
paulf81 97796c8
update tuning notebook
paulf81 7b23127
update notebook 11
paulf81 b09a7cd
remove deprecated functions
paulf81 6310fc6
Create cost objects
misi9170 3696262
Enhance structure of cost objects
misi9170 69597bb
wake loss method, not yet tested
misi9170 83b01cf
Make set_col_by_turbines public
misi9170 1053524
Format
misi9170 68b16cf
Update examples for cost classes and update type hints
misi9170 d99b84b
Remove examples for old floris_tuning package
misi9170 6bcef2f
Deprecation warning
misi9170 405bd91
Move function to package as a utility
misi9170 b1836fb
Consolidate package into previous model_fitting/ module
misi9170 49494e9
Docstring
misi9170 b801d9a
Update tests
misi9170 36171b9
Remove turbine_groupings and add placeholder for sweep optimizer
misi9170 66dffed
Formatting
misi9170 8cac096
Add sweep opt method and test
misi9170 9968133
Single results dictionary returned from optimizers
misi9170 d46a795
wd_std sweep and test
misi9170 9d596a9
Future annotations to allow type hinting in python 3.9
misi9170 c9c2341
Remove large example
paulf81 7897d79
condense wind-up example
paulf81 70b41a2
further organize modelfit examples
paulf81 39be865
clean up smarteole example
paulf81 bad561c
Update example 2
paulf81 78b1add
rename model fit folder
paulf81 ba576b1
add tests of optuna
paulf81 16c719a
linting
paulf81 a2ed1e9
update model fit example
paulf81 6e1d96c
clean up tuning utilities test
paulf81 27d7b61
update examples
paulf81 82421a3
add model fit to docs and consolidate docs
paulf81 14662cb
improve messages and boolean attributes'
misi9170 62bddc4
Further information on ModelFit inputs, outputs etc
misi9170 437e34a
ignore all pickles
paulf81 f0232b7
remove cursor rules from git exclude
paulf81 17500d4
Just FLASC at head
paulf81 505258b
update model fit doc
paulf81 c7f7703
update README
paulf81 33912d8
remove print out
paulf81 cd43ab1
remove print out
paulf81 6416d71
add print
paulf81 5f7d482
remove turboparkgauss file (unused)
paulf81 331821a
remove uv.lock
paulf81 f46606f
Remove ResultsAnalysis
paulf81 c8efc19
remove print
paulf81 3dd21d5
change form_flasc_dataframe to private member
paulf81 c042713
remove repeat label
paulf81 281224e
Small udpate to deprecation language
misi9170 1a9fada
Remove un-needed par blocking
paulf81 37f6273
Add parallel example
paulf81 47b34db
Merge branch 'feature/modelfit_2' of github.com:paulf81/flasc into pr…
paulf81 445e622
Chain verbose through
paulf81 f73137a
Merge branch 'develop' into pr/paulf81/238
paulf81 9a45153
chain verbose through
paulf81 4e215b0
Revert unneeded changes in smarteole examples
misi9170 00d68c2
Reinstate model_tuning_test
misi9170 dd0db6b
Delete old code
paulf81 9aae028
Update how TI is handled
paulf81 3323847
Add note on emgauss defaults
misi9170 485654a
remove great tables
paulf81 9187bc7
add cost library tests and fix some bugs in cost function classes
misi9170 ec9836c
Add option to use non-default wd_sample_points
paulf81 e3e6fe2
Merge branch 'feature/modelfit_2' of github.com:paulf81/flasc into pr…
paulf81 62068a2
linting
paulf81 07ae8ad
linting
paulf81 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
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
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
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
This file was deleted.
Oops, something went wrong.
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
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
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 |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| # Introduction to FLASC | ||
|
|
||
| FLASC provides a rich suite of analysis tools for SCADA data filtering & analysis, wind farm model validation, field experiment design, and field experiment monitoring. The repository is centrally built around NREL's in-house [FLORIS](https://github.com/nrel/floris) wake modeling utility. FLASC also largely relies on the "energy ratio" to quantify wake losses in synthetic and historical data, perform turbine northing calibrations, and for model parameter estimation. | ||
|
|
||
| ## Getting Started | ||
|
|
||
| The easiest way to get started is to install FLASC and then follow the examples. The recommended approach is: | ||
|
|
||
| ### 1. Install FLASC | ||
| Install the repository following the instructions in [installation](installation). | ||
|
|
||
| ### 2. Explore Examples | ||
| You can generate a demo dataset by following the examples in `examples_smarteole/`. The notebook `02_download_and_format_dataset.ipynb` downloads data from a wake steering experiment conducted in 2019. We encourage users to step through the notebooks in `examples_smarteole/` in order to develop an understanding of FLASC's capabilities using a dataset from a real field experiment. | ||
|
|
||
| Additional useful examples can be found in `examples_artificial_data/`, where we intentionally introduce "challenges" for the FLASC tools to solve using artificially-generated data. This provides a good way for users to get to know the FLASC tools in more depth. Again, we recommend stepping through the examples in the subdirectories in their numerical order. | ||
|
|
||
| ### 3. Workflow Overview | ||
| Roughly speaking, the examples in both `examples_smarteole/` and `examples_artificial_data` demonstrate the FLASC modules in the order: | ||
| - `flasc.data_processing` - Import and filter SCADA data | ||
| - `flasc.analysis` - Energy ratio analysis and uplift calculations | ||
| - `flasc.model_fitting` - Calibrate FLORIS models to SCADA data | ||
|
|
||
| and use `flasc.utilities` throughout for supporting functions. | ||
|
|
||
| ## FLASC Package Structure | ||
|
|
||
| FLASC consists of multiple modules, each serving specific analysis needs: | ||
|
|
||
| ### flasc.data_processing | ||
| This module contains functions that support importing and processing raw SCADA data files. Data is saved in feather format for optimal balance of storage size and load and write speed. | ||
|
|
||
| Functions include filtering data by wind direction, wind speed and/or TI, deriving the ambient conditions from the upstream turbines, all the while dealing with angle wrapping for angular variables. Outliers can be detected and removed at the turbine level. Filtering methods include sensor-stuck type of fault detection and analysis of the turbine wind speed-power curve. | ||
|
|
||
| Also included are functions to downsample, upsample and calculate moving averages of a data frame with SCADA and/or FLORIS data. These functions allow the user to specify which columns contain angular variables, and consequently 360 deg wrapping is taken care of. It also allows the user to calculate the min, max, std and median for downsampled data frames. It leverages efficient functions inherent in pandas and polars to maximize performance. | ||
|
|
||
| Finally, functions are provided to detect northing bias (caused by miscalibrated yaw encoders) in turbine data. | ||
|
|
||
| ### flasc.analysis | ||
| This module contains classes to calculate and visualize the energy ratio as defined by Fleming et al. (2019). The energy ratio is a very useful quantity in SCADA data analysis and related model validation. It represents the amount of energy produced by a turbine relative to what that turbine would have produced if no wakes were present. See [energy ratio](energy_ratio) for more details. Also included are methods for calculating the total power uplift in a comparative field experiment. | ||
|
|
||
| ### flasc.model_fitting | ||
| This module provides automated calibration of FLORIS wake models to SCADA data through the ModelFit framework. It includes modular cost functions, optimization algorithms, and tools for parameter sensitivity analysis. See [model fitting](model_fit) for comprehensive documentation. | ||
|
|
||
| ### flasc.utilities | ||
| This module contains utilities that support the other modules within FLASC. These utilities help to interface with FLORIS and calculate a large set of floris simulations for different atmospheric conditions, yaw misalignments and/or model parameters. It also includes two functions to precalculate and respectively interpolate from a large set of model solutions to speed up further postprocessing. | ||
|
|
||
| Also included are functions to estimate the timeshift between two sources of data, for example, to synchronize measurements from a met mast with measurements from SCADA data. The module also includes a function to estimate the offset between two timeseries of wind direction measurements. This is useful to determine the northing bias of a turbine if you know the correct calibration of at least one other wind turbine. Finally, this module also contains a function to estimate the atmospheric turbulence intensity based on the power measurements of the turbines inside a wind farm. | ||
|
|
||
| Additionally, visualization tools can be found in `flasc.visualization` and `flasc.yaw_optimizer_visualization`. | ||
|
|
||
| ## Literature | ||
|
|
||
| See {cite:p}`Doekemeijer2022a` and {cite:p}`Bay2022a` for practical examples of how the flasc repository is used for processing and analyses of historical SCADA data of three offshore wind farms. | ||
|
|
||
| ```{bibliography} | ||
| ``` | ||
|
|
||
| ## Citation | ||
|
|
||
| If FLASC played a role in your research, please cite it. This software can be cited as: | ||
|
|
||
| FLASC. Version 2.0.1 (2024). Available at https://github.com/NREL/flasc. | ||
|
|
||
| For LaTeX users: | ||
|
|
||
| @misc{flasc2024, | ||
| author = {NREL}, | ||
| title = {FLASC. Version 2.0.1}, | ||
| year = {2024}, | ||
| publisher = {GitHub}, | ||
| journal = {GitHub repository}, | ||
| url = {https://github.com/NREL/flasc}, | ||
| } | ||
|
|
||
| ## Questions | ||
|
|
||
| For technical questions regarding FLASC usage, please post your questions to [GitHub Discussions](https://github.com/NREL/flasc/discussions) on the FLASC repository. Alternatively, email the NREL FLASC team at `[email protected] <mailto:[email protected]>`_ or `[email protected] <mailto:[email protected]>`_. |
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.