flasc.data_processing.dataframe_manipulations.set_ti_by_upstream_turbines

flasc.data_processing.dataframe_manipulations.set_ti_by_upstream_turbines#

flasc.data_processing.dataframe_manipulations.set_ti_by_upstream_turbines(df: DataFrame | FlascDataFrame, df_upstream: DataFrame, exclude_turbs: List[int] = []) DataFrame | FlascDataFrame[source]#

Add TI column using upstream turbines.

Add a column called 'ti' in your dataframe with value equal to the averaged turbulence intensity measurements of all the turbines upstream, excluding the turbines listed in exclude_turbs.

Parameters:
  • df (pd.Dataframe | FlascDataFrame) -- Dataframe with measurements. This dataframe typically consists of wd_%03d, ws_%03d, ti_%03d, pow_%03d, and potentially additional measurements.

  • df_upstream (pd.Dataframe) -- Dataframe containing rows indicating wind direction ranges and the corresponding upstream turbines for that wind direction range. This variable can be generated with flasc.utilities.floris_tools.get_upstream_turbs_floris(...). exclude_turbs ([list, array]): array-like variable containing turbine indices that should be excluded in determining the column mean quantity.

  • exclude_turbs ([list, array]) -- array-like variable containing turbine indices that should be excluded in determining the column mean quantity.

Returns:

Dataframe which equals the inserted dataframe

plus the additional column called 'ti'.

Return type:

pd.Dataframe | FlascDataFrame