foxes.output.state_turbine_map.StateTurbineMap

class foxes.output.state_turbine_map.StateTurbineMap[source]

Bases: Output

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

Parameters:

farm_results (xarray.Dataset) – The farm results

results

The farm results

Type:

xarray.Dataset

__init__(farm_results)[source]

Methods

__init__(farm_results)

new(model_type, **kwargs)

Run-time output model factory.

plot_map(variable[, title, ax, figsize])

Plot the heat map for the selected variable.

print_models()

Prints all model names.

write(file_path, data[, format_col2var, ...])

Writes data to file via pandas.

__init__(farm_results)[source]
classmethod new(model_type, **kwargs)

Run-time output model factory.

Parameters:

model_type (string) – The selected derived class name

plot_map(variable, title=None, ax=None, figsize=None, **kwargs)[source]

Plot the heat map for the selected variable.

Parameters:
  • variable (str) – The variable to plot

  • title (str, optional) – The plot title

  • ax (pyplot.Axis, optional) – The axis

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

  • kwargs (dict, optional) – Additional parameters for plt.pcolormesh()

Returns:

ax – The plot axis

Return type:

pyplot.Axis

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:
  • file_path (string) – The path to the output file

  • data (pandas.DataFrame) – The data

  • format_col2var (dict) – Mapping from column names to flappy variables, for formatting

  • format_dict (dict) – Dictionary with format entries for columns, e.g. {FV.P: ‘{:.4f}’}. Note that the keys are flappy variables