floris.turbine_library.turbine_previewer#
Classes
|
|
|
- class floris.turbine_library.turbine_previewer.TurbineInterface(turbine)#
- Parameters:
turbine (Turbine) --
- classmethod from_library(library_path, file_name)#
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.- library_path (
- Returns:
(TurbineInterface): Creates a new
TurbineInterfaceobject.
- Parameters:
library_path (str | Path) --
file_name (str) --
- classmethod from_turbine_dict(config_dict)#
Loads the turbine definition from a dictionary.
- Args:
- config_dictdict
The
Turbineconfiguration dictionary.
- Returns:
(TurbineInterface): Returns a
TurbineInterfaceobject.
- Parameters:
config_dict (dict) --
- classmethod from_yaml(file_path)#
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
TurbineInterfaceobject.
- Parameters:
file_path (str | Path) --
- 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)#
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
FigureandAxesobjects should be returned. Defaults to False.
- Returns:
- None | tuple[plt.Figure, plt.Axes]: None, if
return_figis False, otherwise a tuple of the Figure and Axes objects are returned.
- None | tuple[plt.Figure, plt.Axes]: None, if
- 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)#
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
FigureandAxesobjects should be returned. Defaults to False.
- Returns:
- None | tuple[plt.Figure, plt.Axes]: None, if
return_figis False, otherwise a tuple of the Figure and Axes objects are returned.
- None | tuple[plt.Figure, plt.Axes]: None, if
- 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.]))#
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.]))#
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.
- class floris.turbine_library.turbine_previewer.TurbineLibrary(turbine_map=_Nothing.NOTHING, power_curves=_Nothing.NOTHING, thrust_coefficient_curves=_Nothing.NOTHING)#
- 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]]]]#
- 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.]))#
Computes the power curves for each turbine in
turbine_mapand sets thepower_curvesattribute.- 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.]))#
Computes the thrust curves for each turbine in
turbine_mapand sets thethrust_coefficient_curvesattribute.- 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.
- load_external_library(library_path, which=[], exclude=[])#
Loads all the turbine configurations from
library_path, except the file names defined inexclude, and adds each toturbine_mapvia 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 [].
- load_internal_library(which=[], exclude=[])#
Loads all of the turbine configurations from
floris/floris/turbine_libary, except any turbines defined inexclude.- 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 [].
- 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)#
Plots each thrust curve in
turbine_mapin 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
FigureandAxesobjects should be returned. Defaults to False.
- Returns:
- None | tuple[plt.Figure, list[plt.Axes]]: None, if
return_figis False, otherwise a tuple of the Figure and Axes objects are returned.
- None | tuple[plt.Figure, list[plt.Axes]]: None, if
- plot_hub_heights(fig=None, ax=None, which=[], exclude=[], fig_kwargs=None, bar_kwargs=None, return_fig=False, show=False)#
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
FigureandAxesobjects 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_figis False, otherwise a tuple of the Figure and Axes objects are returned.
- None | tuple[plt.Figure, plt.Axes]: None, if
- 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)#
Plots each power curve in
turbine_mapin 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
FigureandAxesobjects 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_figis False, otherwise a tuple of the Figure and Axes objects are returned.
- None | tuple[plt.Figure, plt.Axes]: None, if
- plot_rotor_diameters(fig=None, ax=None, which=[], exclude=[], fig_kwargs=None, bar_kwargs=None, return_fig=False, show=False)#
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
FigureandAxesobjects 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_figis False, otherwise a tuple of the Figure and Axes objects are returned.
- None | tuple[plt.Figure, plt.Axes]: None, if
- 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)#
Plots each thrust coefficient curve in
turbine_mapin 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
FigureandAxesobjects 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_figis False, otherwise a tuple of the Figure and Axes objects are returned.
- None | tuple[plt.Figure, plt.Axes]: None, if