floris.turbine_library.turbine_previewer#

Classes

TurbineInterface(turbine)

TurbineLibrary([turbine_map, power_curves, ...])

class floris.turbine_library.turbine_previewer.TurbineInterface(turbine)[source]#
Parameters:

turbine (Turbine)

turbine: Turbine#
classmethod from_library(library_path, file_name)[source]#

Loads the turbine definition from a YAML configuration file located in either the internal turbine library floris/floris/turbine_library/, or a user-specified location.

Args:
library_path (str | pathlib.Path): The location of the turbine library;

use "internal" to use the FLORIS-provided library.

file_name (str | pathlib.Path): The name of the configuration file.

Returns:

(TurbineInterface): Creates a new TurbineInterface object.

Parameters:
  • library_path (str | Path)

  • file_name (str)

classmethod from_yaml(file_path)[source]#

Loads the turbine definition from a YAML configuration file.

Args:
file_pathstr | Path

The full path and file name of the turbine configuration file.

Returns:

(TurbineInterface): Creates a new TurbineInterface object.

Parameters:

file_path (str | Path)

classmethod from_turbine_dict(config_dict)[source]#

Loads the turbine definition from a dictionary.

Args:
config_dictdict

The Turbine configuration dictionary.

Returns:

(TurbineInterface): Returns a TurbineInterface object.

Parameters:

config_dict (dict)

power_curve(wind_speeds=array([0., 0.5, 1., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 5.5, 6., 6.5, 7., 7.5, 8., 8.5, 9., 9.5, 10., 10.5, 11., 11.5, 12., 12.5, 13., 13.5, 14., 14.5, 15., 15.5, 16., 16.5, 17., 17.5, 18., 18.5, 19., 19.5, 20., 20.5, 21., 21.5, 22., 22.5, 23., 23.5, 24., 24.5, 25., 25.5, 26., 26.5, 27., 27.5, 28., 28.5, 29., 29.5, 30., 30.5, 31., 31.5, 32., 32.5, 33., 33.5, 34., 34.5, 35., 35.5, 36., 36.5, 37., 37.5, 38., 38.5, 39., 39.5, 40.]))[source]#

Produces a plot-ready power curve for the turbine for wind speed vs power (MW), assuming no tilt or yaw effects.

Return type:

tuple[ndarray[Any, dtype[float64]], ndarray[Any, dtype[float64]]] | tuple[ndarray[Any, dtype[float64]], dict[tuple, ndarray[Any, dtype[float64]]]]

Parameters:

wind_speeds (ndarray[Any, dtype[float64]])

Args:
wind_speeds (NDArrayFloat, optional): A 1-D array of wind speeds, in m/s. Defaults to

0 m/s -> 40 m/s, every 0.5 m/s.

Returns:
(tuple[NDArrayFloat, NDArrayFloat] | tuple[NDArrayFloat, dict[tuple, NDArrayFloat]]):

Returns the wind speed array and the power array, or the wind speed array and a dictionary of the multidimensional parameters and their associated power arrays.

thrust_coefficient_curve(wind_speeds=array([0., 0.5, 1., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 5.5, 6., 6.5, 7., 7.5, 8., 8.5, 9., 9.5, 10., 10.5, 11., 11.5, 12., 12.5, 13., 13.5, 14., 14.5, 15., 15.5, 16., 16.5, 17., 17.5, 18., 18.5, 19., 19.5, 20., 20.5, 21., 21.5, 22., 22.5, 23., 23.5, 24., 24.5, 25., 25.5, 26., 26.5, 27., 27.5, 28., 28.5, 29., 29.5, 30., 30.5, 31., 31.5, 32., 32.5, 33., 33.5, 34., 34.5, 35., 35.5, 36., 36.5, 37., 37.5, 38., 38.5, 39., 39.5, 40.]))[source]#

Produces a plot-ready thrust curve for the turbine for wind speed vs thrust coefficient assuming no tilt or yaw effects.

Return type:

tuple[ndarray[Any, dtype[float64]], ndarray[Any, dtype[float64]]]

Parameters:

wind_speeds (ndarray[Any, dtype[float64]])

Args:
wind_speeds (NDArrayFloat, optional): A 1-D array of wind speeds, in m/s. Defaults to

0 m/s -> 40 m/s, every 0.5 m/s.

Returns:
tuple[NDArrayFloat, NDArrayFloat]

Returns the wind speed array and the thrust coefficient array.

plot_power_curve(wind_speeds=array([0., 0.5, 1., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 5.5, 6., 6.5, 7., 7.5, 8., 8.5, 9., 9.5, 10., 10.5, 11., 11.5, 12., 12.5, 13., 13.5, 14., 14.5, 15., 15.5, 16., 16.5, 17., 17.5, 18., 18.5, 19., 19.5, 20., 20.5, 21., 21.5, 22., 22.5, 23., 23.5, 24., 24.5, 25., 25.5, 26., 26.5, 27., 27.5, 28., 28.5, 29., 29.5, 30., 30.5, 31., 31.5, 32., 32.5, 33., 33.5, 34., 34.5, 35., 35.5, 36., 36.5, 37., 37.5, 38., 38.5, 39., 39.5, 40.]), fig_kwargs=None, plot_kwargs=None, legend_kwargs=None, return_fig=False)[source]#

Plots the power curve for a given set of wind speeds.

Return type:

None | tuple[Figure, Axes]

Parameters:
  • wind_speeds (ndarray[Any, dtype[float64]])

  • fig_kwargs (dict | None)

  • plot_kwargs (dict | None)

  • legend_kwargs (dict | None)

  • return_fig (bool)

Args:
wind_speeds (NDArrayFloat, optional): A 1-D array of wind speeds, in m/s.

Defaults to 0 m/s -> 40 m/s, every 0.5 m/s.

fig_kwargs (dict, optional): Any keywords arguments to be passed to plt.Figure().

Defaults to None.

plot_kwargs (dict, optional): Any keyword arguments to be passed to plt.plot().

Defaults to None.

legend_kwargs (dict, optional): Any keyword arguments to be passed to plt.legend().

Defaults to None.

return_fig (bool, optional): Indicator if the Figure and Axes objects should be

returned. Defaults to False.

Returns:
None | tuple[plt.Figure, plt.Axes]: None, if return_fig is False, otherwise

a tuple of the Figure and Axes objects are returned.

plot_thrust_coefficient_curve(wind_speeds=array([0., 0.5, 1., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 5.5, 6., 6.5, 7., 7.5, 8., 8.5, 9., 9.5, 10., 10.5, 11., 11.5, 12., 12.5, 13., 13.5, 14., 14.5, 15., 15.5, 16., 16.5, 17., 17.5, 18., 18.5, 19., 19.5, 20., 20.5, 21., 21.5, 22., 22.5, 23., 23.5, 24., 24.5, 25., 25.5, 26., 26.5, 27., 27.5, 28., 28.5, 29., 29.5, 30., 30.5, 31., 31.5, 32., 32.5, 33., 33.5, 34., 34.5, 35., 35.5, 36., 36.5, 37., 37.5, 38., 38.5, 39., 39.5, 40.]), fig_kwargs=None, plot_kwargs=None, legend_kwargs=None, return_fig=False)[source]#

Plots the thrust coefficient curve for a given set of wind speeds.

Return type:

None | tuple[Figure, Axes]

Parameters:
  • wind_speeds (ndarray[Any, dtype[float64]])

  • fig_kwargs (dict | None)

  • plot_kwargs (dict | None)

  • legend_kwargs (dict | None)

  • return_fig (bool)

Args:
wind_speeds (NDArrayFloat, optional): A 1-D array of wind speeds, in m/s. Defaults to

0 m/s -> 40 m/s, every 0.5 m/s.

fig_kwargs (dict, optional): Any keywords arguments to be passed to plt.Figure().

Defaults to None.

plot_kwargs (dict, optional): Any keyword arguments to be passed to plt.plot().

Defaults to None.

legend_kwargs (dict, optional): Any keyword arguments to be passed to plt.legend().

Defaults to None.

return_fig (bool, optional): Indicator if the Figure and Axes objects should be

returned. Defaults to False.

Returns:
None | tuple[plt.Figure, plt.Axes]: None, if return_fig is False, otherwise

a tuple of the Figure and Axes objects are returned.

class floris.turbine_library.turbine_previewer.TurbineLibrary(turbine_map=NOTHING, power_curves=NOTHING, thrust_coefficient_curves=NOTHING)[source]#
Parameters:
  • turbine_map (dict[slice(<class 'str'>, <class 'floris.turbine_library.turbine_previewer.TurbineInterface'>, None)])

  • power_curves (dict[str, tuple[ndarray[Any, dtype[float64]], ndarray[Any, dtype[float64]]]])

  • thrust_coefficient_curves (dict[str, tuple[ndarray[Any, dtype[float64]], ndarray[Any, dtype[float64]]]])

turbine_map: dict[slice(<class 'str'>, <class 'floris.turbine_library.turbine_previewer.TurbineInterface'>, None)]#
power_curves: dict[str, tuple[ndarray[Any, dtype[float64]], ndarray[Any, dtype[float64]]]]#
thrust_coefficient_curves: dict[str, tuple[ndarray[Any, dtype[float64]], ndarray[Any, dtype[float64]]]]#
load_internal_library(which=[], exclude=[])[source]#

Loads all of the turbine configurations from floris/floris/turbine_libary, except any turbines defined in exclude.

Return type:

None

Parameters:
  • which (list[str])

  • exclude (list[str])

Args:
which (list[str], optional): A list of which file names to include from loading.

Defaults to [].

exclude (list[str], optional): A list of file names to exclude from loading.

Defaults to [].

load_external_library(library_path, which=[], exclude=[])[source]#

Loads all the turbine configurations from library_path, except the file names defined in exclude, and adds each to turbine_map via a dictionary update.

Return type:

None

Parameters:
  • library_path (str | Path)

  • which (list[str])

  • exclude (list[str])

Args:
library_pathstr | Path

The external turbine library that should be used for loading the turbines.

which (list[str], optional): A list of which file names to include from loading.

Defaults to [].

exclude (list[str], optional): A list of file names to exclude from loading.

Defaults to [].

compute_power_curves(wind_speeds=array([0., 0.5, 1., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 5.5, 6., 6.5, 7., 7.5, 8., 8.5, 9., 9.5, 10., 10.5, 11., 11.5, 12., 12.5, 13., 13.5, 14., 14.5, 15., 15.5, 16., 16.5, 17., 17.5, 18., 18.5, 19., 19.5, 20., 20.5, 21., 21.5, 22., 22.5, 23., 23.5, 24., 24.5, 25., 25.5, 26., 26.5, 27., 27.5, 28., 28.5, 29., 29.5, 30., 30.5, 31., 31.5, 32., 32.5, 33., 33.5, 34., 34.5, 35., 35.5, 36., 36.5, 37., 37.5, 38., 38.5, 39., 39.5, 40.]))[source]#

Computes the power curves for each turbine in turbine_map and sets the power_curves attribute.

Return type:

None

Parameters:

wind_speeds (ndarray[Any, dtype[float64]])

Args:
wind_speeds (NDArrayFloat, optional): A 1-D array of wind speeds, in m/s. Defaults to

0 m/s -> 40 m/s, every 0.5 m/s.

compute_thrust_coefficient_curves(wind_speeds=array([0., 0.5, 1., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 5.5, 6., 6.5, 7., 7.5, 8., 8.5, 9., 9.5, 10., 10.5, 11., 11.5, 12., 12.5, 13., 13.5, 14., 14.5, 15., 15.5, 16., 16.5, 17., 17.5, 18., 18.5, 19., 19.5, 20., 20.5, 21., 21.5, 22., 22.5, 23., 23.5, 24., 24.5, 25., 25.5, 26., 26.5, 27., 27.5, 28., 28.5, 29., 29.5, 30., 30.5, 31., 31.5, 32., 32.5, 33., 33.5, 34., 34.5, 35., 35.5, 36., 36.5, 37., 37.5, 38., 38.5, 39., 39.5, 40.]))[source]#

Computes the thrust curves for each turbine in turbine_map and sets the thrust_coefficient_curves attribute.

Return type:

None

Parameters:

wind_speeds (ndarray[Any, dtype[float64]])

Args:
wind_speeds (NDArrayFloat, optional): A 1-D array of wind speeds, in m/s. Defaults to

0 m/s -> 40 m/s, every 0.5 m/s.

plot_power_curves(fig=None, ax=None, which=[], exclude=[], wind_speeds=array([0., 0.5, 1., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 5.5, 6., 6.5, 7., 7.5, 8., 8.5, 9., 9.5, 10., 10.5, 11., 11.5, 12., 12.5, 13., 13.5, 14., 14.5, 15., 15.5, 16., 16.5, 17., 17.5, 18., 18.5, 19., 19.5, 20., 20.5, 21., 21.5, 22., 22.5, 23., 23.5, 24., 24.5, 25., 25.5, 26., 26.5, 27., 27.5, 28., 28.5, 29., 29.5, 30., 30.5, 31., 31.5, 32., 32.5, 33., 33.5, 34., 34.5, 35., 35.5, 36., 36.5, 37., 37.5, 38., 38.5, 39., 39.5, 40.]), fig_kwargs=None, plot_kwargs=None, legend_kwargs=None, return_fig=False, show=False)[source]#

Plots each power curve in turbine_map in a single plot.

Return type:

None | tuple[Figure, Axes]

Parameters:
  • fig (Figure | None)

  • ax (Axes | None)

  • which (list[str])

  • exclude (list[str])

  • wind_speeds (ndarray[Any, dtype[float64]])

  • fig_kwargs (dict | None)

  • plot_kwargs (dict | None)

  • legend_kwargs (dict | None)

  • return_fig (bool)

  • show (bool)

Args:

fig (plt.figure, optional): A pre-made figure where the plot should exist. ax (plt.Axes, optional): A pre-initialized axes object that should be used for the plot. which (list[str], optional): A list of which turbine types/names to include. Defaults to

[].

exclude (list[str], optional): A list of turbine types/names names to exclude. Defaults

to [].

wind_speeds (NDArrayFloat, optional): A 1-D array of wind speeds, in m/s. Defaults to

0 m/s -> 40 m/s, every 0.5 m/s.

fig_kwargs (dict, optional): Any keywords arguments to be passed to plt.Figure().

Defaults to None.

plot_kwargs (dict, optional): Any keyword arguments to be passed to plt.plot().

Defaults to None.

legend_kwargs (dict, optional): Any keyword arguments to be passed to plt.legend().

Defaults to None.

return_fig (bool, optional): Indicator if the Figure and Axes objects should be

returned. Defaults to False.

show (bool, optional): Indicator if the figure should be automatically displayed.

Defaults to False.

Returns:
None | tuple[plt.Figure, plt.Axes]: None, if return_fig is False, otherwise

a tuple of the Figure and Axes objects are returned.

plot_thrust_coefficient_curves(fig=None, ax=None, which=[], exclude=[], wind_speeds=array([0., 0.5, 1., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 5.5, 6., 6.5, 7., 7.5, 8., 8.5, 9., 9.5, 10., 10.5, 11., 11.5, 12., 12.5, 13., 13.5, 14., 14.5, 15., 15.5, 16., 16.5, 17., 17.5, 18., 18.5, 19., 19.5, 20., 20.5, 21., 21.5, 22., 22.5, 23., 23.5, 24., 24.5, 25., 25.5, 26., 26.5, 27., 27.5, 28., 28.5, 29., 29.5, 30., 30.5, 31., 31.5, 32., 32.5, 33., 33.5, 34., 34.5, 35., 35.5, 36., 36.5, 37., 37.5, 38., 38.5, 39., 39.5, 40.]), fig_kwargs=None, plot_kwargs=None, legend_kwargs=None, return_fig=False, show=False)[source]#

Plots each thrust coefficient curve in turbine_map in a single plot.

Return type:

None | tuple[Figure, Axes]

Parameters:
  • fig (Figure | None)

  • ax (Axes | None)

  • which (list[str])

  • exclude (list[str])

  • wind_speeds (ndarray[Any, dtype[float64]])

  • fig_kwargs (dict | None)

  • plot_kwargs (dict | None)

  • legend_kwargs (dict | None)

  • return_fig (bool)

  • show (bool)

Args:

fig (plt.figure, optional): A pre-made figure where the plot should exist. ax (plt.Axes, optional): A pre-initialized axes object that should be used for the plot. which (list[str], optional): A list of which turbine types/names to include. Defaults to

[].

exclude (list[str], optional): A list of turbine types/names names to exclude. Defaults

to [].

wind_speeds (NDArrayFloat, optional): A 1-D array of wind speeds, in m/s. Defaults to

0 m/s -> 40 m/s, every 0.5 m/s.

fig_kwargs (dict, optional): Any keywords arguments to be passed to plt.Figure().

Defaults to None.

plot_kwargs (dict, optional): Any keyword arguments to be passed to plt.plot().

Defaults to None.

plot_kwargs (dict, optional): Any keyword arguments to be passed to plt.legend().

Defaults to None.

return_fig (bool, optional): Indicator if the Figure and Axes objects should be

returned. Defaults to False.

show (bool, optional): Indicator if the figure should be automatically displayed.

Defaults to False.

Returns:
None | tuple[plt.Figure, plt.Axes]: None, if return_fig is False, otherwise

a tuple of the Figure and Axes objects are returned.

plot_rotor_diameters(fig=None, ax=None, which=[], exclude=[], fig_kwargs=None, bar_kwargs=None, return_fig=False, show=False)[source]#

Plots a bar chart of rotor diameters for each turbine in turbine_map.

Return type:

None | tuple[Figure, Axes]

Parameters:
  • fig (Figure | None)

  • ax (Axes | None)

  • which (list[str])

  • exclude (list[str])

  • fig_kwargs (dict | None)

  • bar_kwargs (dict | None)

  • return_fig (bool)

  • show (bool)

Args:

fig (plt.figure, optional): A pre-made figure where the plot should exist. ax (plt.Axes, optional): A pre-initialized axes object that should be used for the plot. which (list[str], optional): A list of which turbine types/names to include. Defaults to

[].

exclude (list[str], optional): A list of turbine types/names names to exclude. Defaults

to [].

fig_kwargs (dict, optional): Any keywords arguments to be passed to plt.Figure().

Defaults to None.

bar_kwargs (dict, optional): Any keyword arguments to be passed to plt.bar().

Defaults to None.

return_fig (bool, optional): Indicator if the Figure and Axes objects should be

returned. Defaults to False.

show (bool, optional): Indicator if the figure should be automatically displayed.

Defaults to False.

Returns:
None | tuple[plt.Figure, plt.Axes]: None, if return_fig is False, otherwise

a tuple of the Figure and Axes objects are returned.

plot_hub_heights(fig=None, ax=None, which=[], exclude=[], fig_kwargs=None, bar_kwargs=None, return_fig=False, show=False)[source]#

Plots a bar chart of hub heights for each turbine in turbine_map.

Return type:

None | tuple[Figure, Axes]

Parameters:
  • fig (Figure | None)

  • ax (Axes | None)

  • which (list[str])

  • exclude (list[str])

  • fig_kwargs (dict | None)

  • bar_kwargs (dict | None)

  • return_fig (bool)

  • show (bool)

Args:

fig (plt.figure, optional): A pre-made figure where the plot should exist. ax (plt.Axes, optional): A pre-initialized axes object that should be used for the plot. which (list[str], optional): A list of which turbine types/names to include. Defaults to

[].

exclude (list[str], optional): A list of turbine types/names names to exclude. Defaults

to [].

fig_kwargs (dict, optional): Any keywords arguments to be passed to plt.Figure().

Defaults to None.

bar_kwargs (dict, optional): Any keyword arguments to be passed to plt.bar().

Defaults to None.

return_fig (bool, optional): Indicator if the Figure and Axes objects should be

returned. Defaults to False.

show (bool, optional): Indicator if the figure should be automatically displayed.

Defaults to False.

Returns:
None | tuple[plt.Figure, plt.Axes]: None, if return_fig is False, otherwise

a tuple of the Figure and Axes objects are returned.

plot_comparison(which=[], exclude=[], wind_speeds=array([0., 0.5, 1., 1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 5.5, 6., 6.5, 7., 7.5, 8., 8.5, 9., 9.5, 10., 10.5, 11., 11.5, 12., 12.5, 13., 13.5, 14., 14.5, 15., 15.5, 16., 16.5, 17., 17.5, 18., 18.5, 19., 19.5, 20., 20.5, 21., 21.5, 22., 22.5, 23., 23.5, 24., 24.5, 25., 25.5, 26., 26.5, 27., 27.5, 28., 28.5, 29., 29.5, 30., 30.5, 31., 31.5, 32., 32.5, 33., 33.5, 34., 34.5, 35., 35.5, 36., 36.5, 37., 37.5, 38., 38.5, 39., 39.5, 40.]), fig_kwargs=None, plot_kwargs=None, bar_kwargs=None, legend_kwargs=None, return_fig=False)[source]#

Plots each thrust curve in turbine_map in a single plot.

Return type:

None | tuple[Figure, list[Axes]]

Parameters:
  • which (list[str])

  • exclude (list[str])

  • wind_speeds (ndarray[Any, dtype[float64]])

  • fig_kwargs (dict | None)

  • plot_kwargs (dict | None)

  • bar_kwargs (dict | None)

  • legend_kwargs (dict | None)

  • return_fig (bool)

Args:
which (list[str], optional): A list of which turbine types/names to include. Defaults to

[].

exclude (list[str], optional): A list of turbine types/names names to exclude. Defaults

to [].

wind_speeds (NDArrayFloat, optional): A 1-D array of wind speeds, in m/s. Defaults to

0 m/s -> 40 m/s, every 0.5 m/s.

fig_kwargs (dict, optional): Any keywords arguments to be passed to plt.Figure().

Defaults to None.

plot_kwargs (dict, optional): Any keyword arguments to be passed to plt.plot().

Defaults to None.

bar_kwargs (dict, optional): Any keyword arguments to be passed to plt.bar().

Defaults to None.

legend_kwargs (dict, optional): Any keyword arguments to be passed to plt.legend().

Defaults to None.

return_fig (bool, optional): Indicator if the Figure and Axes objects should be

returned. Defaults to False.

Returns:
None | tuple[plt.Figure, list[plt.Axes]]: None, if return_fig is False,

otherwise a tuple of the Figure and Axes objects are returned.