foxes.output.farm_layout.FarmLayoutOutput¶
- class foxes.output.farm_layout.FarmLayoutOutput[source]¶
Bases:
Output
Plot the farm layout
- Parameters:
farm (foxes.WindFarm) – The wind farm
farm_results (xarray.Dataset, optional) – The wind farm calculation results
from_results (bool, optional) – Flag for coordinates from results data
results_state (int, optional) – The state index, for from_res
D (float, optional) – The rotor diameter, if not from data
- farm¶
The wind farm
- Type:
foxes.WindFarm
- fres¶
The wind farm calculation results
- Type:
xarray.Dataset
Methods
__init__
(farm[, farm_results, from_results, ...])get_figure
([color_by, fontsize, figsize, ...])Creates farm layout figure.
Returns wind farm layout.
Returns wind farm layout.
new
(model_type, **kwargs)Run-time output model factory.
Prints all model names.
write
(file_path, data[, format_col2var, ...])Writes data to file via pandas.
write_csv
([file_path])Writes csv layout file.
write_json
([file_path])Writes xyh layout file.
write_plot
([file_path, fontsize])Writes the layout plot to file.
write_xyh
([file_path])Writes xyh layout file.
- get_figure(color_by=None, fontsize=8, figsize=None, annotate=1, title=None, fig=None, ax=None, normalize_D=False, ret_im=False, bargs={}, **kwargs)[source]¶
Creates farm layout figure.
- Parameters:
color_by (str, optional) – Set scatter color by variable results. Use “mean_REWS” etc for means, also min, max, sum. All wrt states
fontsize (int, optional) – Size of the turbine numbers
figsize (tuple, optional) – The figsize for plt.Figure
annotate (int, optional) – Turbine index printing, Choices: 0 = No annotation 1 = Turbine indices 2 = Turbine names
title (str, optional) – The plot title, or None for automatic
fig (matplotlib.pyplot.Figure, optional) – The figure object to which to add
ax (matplotlib.pyplot.Axis, optional) – The axis object, to which to add
normalize_D (bool) – Normalize x, y wrt rotor diameter
ret_im (bool) – Flag for returned image object
bargs (dict) – Arguments for boundary plotting
kwargs (dict, optional) – Parameters forwarded to matplotlib.pyplot.scatter
- Returns:
ax (matplotlib.pyplot.Axis) – The axis object
im (matplotlib.pyplot.PathCollection, optional) – The image object
- get_layout_data()[source]¶
Returns wind farm layout.
- Returns:
The wind farm layout, shape: (n_turbines, 3) where the 3 represents x, y, h
- Return type:
- get_layout_dict()[source]¶
Returns wind farm layout.
- Returns:
The wind farm layout in dict format, as in json output
- Return type:
- classmethod new(model_type, **kwargs)¶
Run-time output model factory.
- Parameters:
model_type (string) – The selected derived class name
- classmethod print_models()¶
Prints all model names.
- classmethod write(file_path, data, format_col2var={}, format_dict={}, **kwargs)¶
Writes data to file via pandas.
The kwargs are forwarded to the underlying pandas writing function.
- Parameters:
- write_csv(file_path=None)[source]¶
Writes csv layout file.
- Parameters:
file_path (str) – The file into which to plot, or None for default
- write_json(file_path=None)[source]¶
Writes xyh layout file.
- Parameters:
file_path (str) – The file into which to plot, or None for default