flasc.analysis.cumulative_production_analysis#

Compare energy production and wake losses across dataframes.

Functions

compare_cumulative_production

Compare energy and wake losses between dataframes.

compare_relative_wake_loss

Compare energy and wake losses between dataframes.

flasc.analysis.cumulative_production_analysis._err(old_val, new_val)[source]#

Calculate percentage error between old and new value.

Note that this is not a symmetric error metric, and should be interpreted as the percentage change from old_val to new_val.

flasc.analysis.cumulative_production_analysis._wake_loss(cumprod_waked, cumprod_unwaked)[source]#

Calculate wake loss percentage between waked and unwaked cumulative production.

Note that this is not a symmetric metric, and should be interpreted as the percentage loss from unwaked to waked production.

flasc.analysis.cumulative_production_analysis._print_pretty_table(table_dict, title)[source]#

Print the given table dictionary in a pretty format using markdown.

The title is centered above the table.

Parameters:
  • table_dict (dict) -- Dictionary containing the table data.

  • title (str) -- Title to be displayed above the table.

Returns:

None

flasc.analysis.cumulative_production_analysis._mirror_timeseries_nans_in_df_list(df_list: list, verbose: bool = False) list[source]#

Mirror NaNs in 'pow_{id:03d}' columns across a list of dataframes.

Parameters:
  • df_list (list) -- A list of DataFrames containing SCADA, LES or FLORIS model timeseries with power production columns, pow_000, pow_001, etc.

  • verbose (bool, optional) -- If True, print the number of NaNs in each dataframe. Defaults to False.

Returns:

The list of DataFrames with copied-over NaNs. Each dataframe has an equal number of

NaNs in the power columns, and these NaNs are located at the same timestamps across all dataframes.

Return type:

list

flasc.analysis.cumulative_production_analysis._prepare_df_list(df_list: list, model_tags: list, exclude_turbs: list, ws_range: list)[source]#

Prepare list with timeseries dataframes for cumulative production and rel. wake loss.

Parameters:
  • df_list (list) -- List of Pandas DataFrame timeseries. The first entry is typically SCADA or LES, and the remaining entries are models to compare.

  • model_tags (list, optional) -- List of string tags for the models.

  • exclude_turbs (list, optional) -- List of turbines to exclude from the analysis, e.g., because of poor performance or odd behavior. Defaults to [].

  • ws_range (list, optional) -- Wind speed range for filtering the data. When inspecting wake losses, one may want to zoom into the relevant wind speed range, typically between 6 and 14 m/s. This also allows you to inspect the model performance for different wind speed regions. Defaults to [0.0, 99.0].

  • print_to_console (bool, optional) -- Whether to print the results to the console. Defaults to True.

Raises:
  • ValueError -- If input timeseries dataframes in df_list have different timestamps.

  • ValueError -- If input timeseries dataframes in df_list have different number of turbines.

  • ValueError -- If input timeseries dataframes in df_list already contain a 'pow_ref' column.

Returns:

List of Pandas DataFrame timeseries, after applying wind speed filtering,

excluding turbines, and mirroring NaNs across dataframes.

Return type:

df_list (list)

flasc.analysis.cumulative_production_analysis.compare_cumulative_production(df_list, exclude_turbs=[], ws_range=[0.0, 99.0], model_tags=None, print_to_console=True)[source]#

Compare energy and wake losses between dataframes.

Calculate the cumulative energy production for a list of Pandas DataFrame timeseries. Then, calculate the error between the first timeseries in the list (typically SCADA or LES) and the remaining timeseries (typically LES and/or FLORIS models).

Parameters:
  • df_list (list) -- List of Pandas DataFrame timeseries. The first entry is typically SCADA or LES, and the remaining entries are models to compare.

  • exclude_turbs (list, optional) -- List of turbines to exclude from the analysis, e.g., because of poor performance or odd behavior. Defaults to [].

  • ws_range (list, optional) -- Wind speed range for filtering the data. When inspecting wake losses, one may want to zoom into the relevant wind

  • range (speed) -- performance for different wind speed regions. Defaults to [0.0, 99.0].

  • model (typically between 6 and 14 m/s. This also allows you to inspect the) -- performance for different wind speed regions. Defaults to [0.0, 99.0].

  • model_tags (list, optional) -- List of string tags for the models. Defaults to None, which will generate tags as "Model 0", "Model 1", etc.

  • print_to_console (bool, optional) -- Whether to print the results to the console. Defaults to True.

Raises:
  • ValueError -- If input timeseries dataframes in df_list have different timestamps.

  • ValueError -- If input timeseries dataframes in df_list have different number of turbines.

  • ValueError -- If input timeseries dataframes in df_list already contain a 'pow_ref' column.

Returns:

Dictionary containing the absolute cumulative production

numbers, including errors w.r.t. the first dataframe.

Return type:

table_absolute_cumprod_dict

flasc.analysis.cumulative_production_analysis.compare_relative_wake_loss(df_list, df_upstream, exclude_turbs=[], ws_range=[0.0, 99.0], model_tags=None, print_to_console=True)[source]#

Compare energy and wake losses between dataframes.

Calculate the relative wake loss for a list of Pandas DataFrame timeseries. Then, calculate the error between the first timeseries in the list (typically SCADA or LES) and the remaining timeseries (typically LES and/or FLORIS models).

Parameters:
  • df_list (list) -- List of Pandas DataFrame timeseries. The first entry is typically SCADA or LES, and the remaining entries are models to compare.

  • df_upstream (Pandas DataFrame) -- Upstream data for reference, generated using 'ftools.get_upstream_turbs_floris()'

  • exclude_turbs (list, optional) -- List of turbines to exclude from the analysis, e.g., because of poor performance or odd behavior. Defaults to [].

  • ws_range (list, optional) -- Wind speed range for filtering the data. When inspecting wake losses, one may want to zoom into the relevant wind

  • range (speed) -- performance for different wind speed regions. Defaults to [0.0, 99.0].

  • model (typically between 6 and 14 m/s. This also allows you to inspect the) -- performance for different wind speed regions. Defaults to [0.0, 99.0].

  • model_tags (list, optional) -- List of string tags for the models. Defaults to None, which will generate tags as "Model 0", "Model 1", etc.

  • print_to_console (bool, optional) -- Whether to print the results to the console. Defaults to True.

Raises:
  • ValueError -- If input timeseries dataframes in df_list have different timestamps.

  • ValueError -- If input timeseries dataframes in df_list have different number of turbines.

  • ValueError -- If input timeseries dataframes in df_list already contain a 'pow_ref' column.

Returns:

Dictionary containing the relative wake loss numbers, including

errors w.r.t. the first dataframe.

Return type:

table_wakeloss_cumprod_dict