foxes.output.rose_plot.StatesRosePlotOutput

class foxes.output.rose_plot.StatesRosePlotOutput[source]

Bases: RosePlotOutput

Class for rose plot creation directly from states

Parameters:
  • states (foxes.core.States) – The states from which to compute the wind rose

  • point (numpy.ndarray) – The evaluation point, shape: (3,)

  • mbook (foxes.models.ModelBook, optional) – The model book

__init__(states, point, mbook=None, ws_var='AMB_REWS')[source]

Methods

__init__(states, point[, mbook, ws_var])

get_data(sectors, var, var_bins[, wd_var, ...])

Get pandas DataFrame with wind rose data.

get_data_info(dname)

Returns default description for a variable.

get_figure(sectors, var, var_bins[, wd_var, ...])

Creates px figure object

new(model_type, **kwargs)

Run-time output model factory.

print_models()

Prints all model names.

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

Writes data to file via pandas.

write_figure(file_name, sectors, var, var_bins)

Write rose plot to file

__init__(states, point, mbook=None, ws_var='AMB_REWS')[source]
get_data(sectors, var, var_bins, wd_var='AMB_WD', turbine=None, point=None, legend=None)

Get pandas DataFrame with wind rose data.

Parameters:
  • sectors (int) – The number of wind direction sectors

  • var (str) – The data variable name

  • var_bins (list of float) – The variable bin seperation values

  • wd_var (str, optional) – The wind direction variable name

  • turbine (int, optional) – Only relevant in case of farm results. If None, mean over all turbines. Else, data from a single turbine

  • point (int, optional) – Only relevant in case of point results. If None, mean over all points. Else, data from a single point

  • legend (str, optional) – The data legend string

Returns:

The wind rose data

Return type:

pd.DataFrame

classmethod get_data_info(dname)

Returns default description for a variable.

Parameters:

dname (str) – The variable name

Returns:

  • title (str) – The long name of the variable

  • legend (str) – The legend/axis text

get_figure(sectors, var, var_bins, wd_var='AMB_WD', turbine=None, point=None, cmap='Turbo', title=None, legend=None, layout_dict={}, title_dict={})

Creates px figure object

Parameters:
  • sectors (int) – The number of wind direction sectors

  • var (str) – The data variable name

  • var_bins (list of float) – The variable bin seperation values

  • wd_var (str, optional) – The wind direction variable name

  • turbine (int, optional) – Only relevant in case of farm results. If None, mean over all turbines. Else, data from a single turbine

  • point (int, optional) – Only relevant in case of point results. If None, mean over all points. Else, data from a single point

  • legend (str, optional) – The data legend string

  • layout_dict (dict, optional) – Optional parameters for the px figure layout

  • title_dict (dict, optional) – Optional parameters for the px title layout

Returns:

The rose plot figure

Return type:

px.Figure

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:
  • 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

write_figure(file_name, sectors, var, var_bins, wd_var='AMB_WD', turbine=None, point=None, cmap='Turbo', title=None, legend=None, layout_dict={}, title_dict={})

Write rose plot to file

Parameters:
  • file_name (str) – Path to the output file

  • sectors (int) – The number of wind direction sectors

  • var (str) – The data variable name

  • var_bins (list of float) – The variable bin seperation values

  • wd_var (str, optional) – The wind direction variable name

  • turbine (int, optional) – Only relevant in case of farm results. If None, mean over all turbines. Else, data from a single turbine

  • point (int, optional) – Only relevant in case of point results. If None, mean over all points. Else, data from a single point

  • legend (str, optional) – The data legend string

  • layout_dict (dict, optional) – Optional parameters for the px figure layout

  • title_dict (dict, optional) – Optional parameters for the px title layout