foxes.output.state_turbine_map

Classes

StateTurbineMap

Creates heat maps with turbines on one axis

Module Contents

class foxes.output.state_turbine_map.StateTurbineMap(farm_results: xarray.Dataset, **kwargs: Any)[source]

Bases: foxes.output.output.Output

Creates heat maps with turbines on one axis and states on the other axis.

Parameters:
farm_results

The farm results

kwargs

Additional parameters for the base class

get_fpath(fname: str | pathlib.Path) pathlib.Path

Gets the total file path

Parameters:
fname

The file name

Returns:
fpath

The total file path

classmethod new(output_type: str, *args: Any, **kwargs: Any) Output

Run-time output model factory.

Parameters:
output_type

The selected derived class name

args

Additional parameters for the constructor

kwargs

Additional parameters for the constructor

plot_map(variable: str, title: str | None = None, cbar_label: str | None = None, ax: matplotlib.axes.Axes | None = None, figsize: tuple[int, int] | None = None, rotate_xlabels: float | None = None, **kwargs: Any) Any[source]

Plot the heat map for the selected variable.

Parameters:
variable

The variable to plot

title

The plot title

ax

The axis

figsize

The figsize argument for plt.subplots() in case ax is not provided

rotate_xlabels

Rotate the x-labels by this number of degrees

kwargs

Additional parameters for plt.pcolormesh()

Returns:
ax

The plot axis

classmethod print_models() None

Prints all model names.

write(file_name: str, data: pandas.DataFrame, format_col2var: dict[str, str] | None = None, format_dict: dict[str, str] | None = None, **kwargs: Any) None

Writes data to file via pandas.

The kwargs are forwarded to the underlying pandas writing function.

Parameters:
file_name

The output file name

data

The data

format_col2var

Mapping from column names to foxes variables, for formatting

format_dict

Dictionary with format entries for columns, for example FV.P mapped to '{:.4f}'. Note that the keys are foxes variables.

nofig = False
out_dir = None
out_fname_fun = None
results