flasc.data_processing.timeseries_to_grid_solutions

flasc.data_processing.timeseries_to_grid_solutions#

Module for generating tabulated data from times series.

Functions

bin_timeseries_to_grid

Convert a timeseries DataFrame into a gridded solution table.

flasc.data_processing.timeseries_to_grid_solutions._plot_binned_data_counts(df_grid: DataFrame)[source]#

Plot the number of entries in each wind direction/wind speed bin.

This is a supporting function used to display how complete one can derive a steady-state table (grid) from a timeseries of solutions, e.g., from an LES timeseries.

Parameters:

df_grid (pd.DataFrame) -- DataFrame containing the binned data.

Returns:

Axes object of the generated plot.

Return type:

matplotlib.axes.Axes

flasc.data_processing.timeseries_to_grid_solutions.bin_timeseries_to_grid(df_timeseries: DataFrame, wd_step: float = 5.0, wd_min: float = 0.0, wd_max: float = 360.0, ws_step: float = 1.0, ws_min: float = 0.0, ws_max: float = 50.0, N_min: int = 3, plot: bool = False)[source]#

Convert a timeseries DataFrame into a gridded solution table.

Table is based on wind direction and wind speed bins.

Parameters:
  • df_timeseries (pd.DataFrame) -- Dataframe with timeseries that you want to turn into a gridded solution table. Requires the columns 'wd', 'ws', and one power column (pow_000, pow_001, etc.) for every turbine in your wind farm.

  • wd_step (float, optional) -- Step size for wind direction bins. Defaults to 5.0.

  • wd_min (float, optional) -- Minimum wind direction for binning. Defaults to 0.0.

  • wd_max (float, optional) -- Maximum wind direction for binning. Defaults to 360.0.

  • ws_step (float, optional) -- Step size for wind speed bins. Defaults to 1.0.

  • ws_min (float, optional) -- Minimum wind speed for binning. Defaults to 0.0.

  • ws_max (float, optional) -- Maximum wind speed for binning. Defaults to 50.0.

  • N_min (int, optional) -- Minimum number of samples within a bin for it to be considered valid. Defaults to 3.

  • plot (bool, optional) -- Whether to generate a plot of the binned data counts. Defaults to False.

Returns:

DataFrame containing the gridded solution table.

Return type:

pd.DataFrame