foxes.output.flow_plots_2d.FlowPlots2D

class foxes.output.flow_plots_2d.FlowPlots2D[source]

Bases: Output

Class for horizontal or vertical 2D flow plots

Parameters:
  • algo (foxes.Algorithm) – The algorithm for point calculation

  • farm_results (xarray.Dataset) – The farm results

algo

The algorithm for point calculation

Type:

foxes.Algorithm

farm_results

The farm results

Type:

xarray.Dataset

__init__(algo, farm_results)[source]

Methods

__init__(algo, farm_results)

gen_states_fig_xy(var, resolution[, xmin, ...])

Generates 2D farm flow figure in a horizontal xy-plane.

gen_states_fig_xz(var, resolution[, ...])

Generates 2D farm flow figure in a vertical xz-plane.

gen_states_fig_yz(var, resolution[, ...])

Generates 2D farm flow figure in a plane.

get_mean_fig_xy(var, resolution[, xmin, ...])

Generates 2D farm flow figure in a horizontal xy-plane.

get_mean_fig_xz(var, resolution[, ...])

Generates 2D farm flow figure in a vertical xz-plane.

get_mean_fig_yz(var, resolution[, ...])

Generates 2D farm flow figure in a vertical yz-plane.

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.

__init__(algo, farm_results)[source]
gen_states_fig_xy(var, resolution, xmin=None, ymin=None, xmax=None, ymax=None, xlabel='x [m]', ylabel='y [m]', z=None, xspace=500.0, yspace=500.0, levels=None, var_min=None, var_max=None, figsize=None, normalize_xy=None, normalize_var=None, title=None, vlabel=None, fig=None, ax=None, add_bar=True, cmap=None, quiver_n=None, quiver_pars={}, verbosity=0, ret_state=False, ret_im=False, **kwargs)[source]

Generates 2D farm flow figure in a horizontal xy-plane.

Parameters:
  • var (str) – The variable name

  • resolution (float) – The resolution in m

  • xmin (float) – The min x coordinate, or None for automatic

  • ymin (float) – The min y coordinate, or None for automatic

  • xmax (float) – The max x coordinate, or None for automatic

  • ymax (float) – The max y coordinate, or None for automatic

  • xlabel (str) – The x axis label

  • ylabel (str) – The y axis label

  • z (float) – The z coordinate of the plane

  • xspace (float) – The extra space in x direction, before and after wind farm

  • yspace (float) – The extra space in y direction, before and after wind farm

  • levels (int) – The number of levels for the contourf plot, or None for pure image

  • var_min (float) – Minimum variable value

  • var_max (float) – Maximum variable value

  • figsize (tuple) – The figsize for plt.Figure

  • normalize_xy (float, optional) – Divide x and y by this value

  • normalize_var (float, optional) – Divide the variable by this value

  • title (str, optional) – The title

  • vlabel (str, optional) – The variable label

  • fig (plt.Figure, optional) – The figure object

  • ax (plt.Axes, optional) – The figure axes

  • add_bar (bool, optional) – Add a color bar

  • cmap (str, optional) – The colormap

  • quiver_n (int, optional) – Place a vector at each `n`th point

  • quiver_pars (dict, optional) – Parameters for plt.quiver

  • verbosity (int, optional) – The verbosity level

  • ret_state (bool, optional) – Flag for state index return

  • ret_im (bool, optional) – Flag for image return

  • kwargs (dict, optional) – Parameters forwarded to the algorithm’s calc_points function.

Yields:
  • fig (matplotlib.Figure) – The figure object

  • si (int, optional) – The state index

  • im (matplotlib.collections.QuadMesh or matplotlib.QuadContourSet, optional) – The image object

gen_states_fig_xz(var, resolution, x_direction=270.0, xmin=None, zmin=0.0, xmax=None, zmax=None, xlabel='x [m]', zlabel='z [m]', y=None, xspace=500.0, zspace=500.0, levels=None, var_min=None, var_max=None, figsize=None, normalize_x=None, normalize_z=None, normalize_var=None, title=None, vlabel=None, fig=None, ax=None, add_bar=True, cmap=None, quiver_n=None, quiver_pars={}, verbosity=0, ret_state=False, ret_im=False, **kwargs)[source]

Generates 2D farm flow figure in a vertical xz-plane.

Parameters:
  • var (str) – The variable name

  • resolution (float) – The resolution in m

  • x_direction (float) – The direction of the x axis, 0 = north

  • xmin (float) – The min x coordinate, or None for automatic

  • zmin (float) – The min z coordinate

  • xmax (float) – The max x coordinate, or None for automatic

  • zmax (float) – The max z coordinate, or None for automatic

  • xlabel (str) – The x axis label

  • zlabel (str) – The z axis label

  • y (float) – The y coordinate of the plane

  • xspace (float) – The extra space in x direction, before and after wind farm

  • zspace (float) – The extra space in z direction, below and above wind farm

  • levels (int) – The number of levels for the contourf plot, or None for pure image

  • var_min (float) – Minimum variable value

  • var_max (float) – Maximum variable value

  • figsize (tuple) – The figsize for plt.Figure

  • normalize_x (float, optional) – Divide x by this value

  • normalize_z (float, optional) – Divide z by this value

  • normalize_var (float, optional) – Divide the variable by this value

  • title (str, optional) – The title

  • vlabel (str, optional) – The variable label

  • fig (plt.Figure, optional) – The figure object

  • ax (plt.Axes, optional) – The figure axes

  • add_bar (bool, optional) – Add a color bar

  • cmap (str, optional) – The colormap

  • quiver_n (int, optional) – Place a vector at ech `n`th point

  • quiver_pars (dict, optional) – Parameters for plt.quiver

  • verbosity (int, optional) – The verbosity level

  • ret_state (bool, optional) – Flag for state index return

  • ret_im (bool, optional) – Flag for image return

  • kwargs (dict, optional) – Parameters forwarded to the algorithm’s calc_points function.

Yields:
  • fig (matplotlib.Figure) – The figure object

  • si (int, optional) – The state index

  • im (matplotlib.collections.QuadMesh or matplotlib.QuadContourSet, optional) – The image object

gen_states_fig_yz(var, resolution, x_direction=270.0, ymin=None, zmin=0.0, ymax=None, zmax=None, ylabel='y [m]', zlabel='z [m]', x=None, yspace=500.0, zspace=500.0, levels=None, var_min=None, var_max=None, figsize=None, normalize_y=None, normalize_z=None, normalize_var=None, title=None, vlabel=None, fig=None, ax=None, add_bar=True, cmap=None, quiver_n=None, quiver_pars={}, verbosity=1, ret_state=False, ret_im=False, **kwargs)[source]

Generates 2D farm flow figure in a plane.

Parameters:
  • var (str) – The variable name

  • resolution (float) – The resolution in m

  • x_direction (float) – The direction of the x axis, 0 = north

  • ymin (float) – The min y coordinate, or None for automatic

  • zmin (float) – The min z coordinate

  • ymax (float) – The max y coordinate, or None for automatic

  • zmax (float) – The max z coordinate, or None for automatic

  • ylabel (str) – The y axis label

  • zlabel (str) – The z axis label

  • x (float) – The x coordinate of the plane

  • yspace (float) – The extra space in y direction, left and right of wind farm

  • zspace (float) – The extra space in z direction, below and above wind farm

  • levels (int) – The number of levels for the contourf plot, or None for pure image

  • var_min (float) – Minimum variable value

  • var_max (float) – Maximum variable value

  • figsize (tuple) – The figsize for plt.Figure

  • normalize_y (float, optional) – Divide y by this value

  • normalize_z (float, optional) – Divide z by this value

  • normalize_var (float, optional) – Divide the variable by this value

  • title (str, optional) – The title

  • vlabel (str, optional) – The variable label

  • fig (plt.Figure, optional) – The figure object

  • ax (plt.Axes, optional) – The figure axes

  • add_bar (bool, optional) – Add a color bar

  • cmap (str, optional) – The colormap

  • quiver_n (int, optional) – Place a vector at ech `n`th point

  • quiver_pars (dict, optional) – Parameters for plt.quiver

  • verbosity (int, optional) – The verbosity level

  • ret_state (bool, optional) – Flag for state index return

  • ret_im (bool, optional) – Flag for image return

  • kwargs (dict, optional) – Parameters forwarded to the algorithm’s calc_points function.

Yields:
  • fig (matplotlib.Figure) – The figure object

  • si (int, optional) – The state index

  • im (matplotlib.collections.QuadMesh or matplotlib.QuadContourSet, optional) – The image object

get_mean_fig_xy(var, resolution, xmin=None, ymin=None, xmax=None, ymax=None, xlabel='x [m]', ylabel='y [m]', z=None, xspace=500.0, yspace=500.0, levels=None, var_min=None, var_max=None, figsize=None, normalize_xy=None, normalize_var=None, title='States mean', vlabel=None, fig=None, ax=None, add_bar=True, cmap=None, weight_turbine=0, verbosity=0, ret_state=False, ret_im=False, **kwargs)[source]

Generates 2D farm flow figure in a horizontal xy-plane.

Parameters:
  • var (str) – The variable name

  • resolution (float) – The resolution in m

  • xmin (float) – The min x coordinate, or None for automatic

  • ymin (float) – The min y coordinate, or None for automatic

  • xmax (float) – The max x coordinate, or None for automatic

  • ymax (float) – The max y coordinate, or None for automatic

  • xlabel (str) – The x axis label

  • ylabel (str) – The y axis label

  • z (float) – The z coordinate of the plane

  • xspace (float) – The extra space in x direction, before and after wind farm

  • yspace (float) – The extra space in y direction, before and after wind farm

  • levels (int) – The number of levels for the contourf plot, or None for pure image

  • var_min (float) – Minimum variable value

  • var_max (float) – Maximum variable value

  • figsize (tuple) – The figsize for plt.Figure

  • normalize_xy (float, optional) – Divide x and y by this value

  • normalize_var (float, optional) – Divide the variable by this value

  • title (str, optional) – The title

  • vlabel (str, optional) – The variable label

  • fig (plt.Figure, optional) – The figure object

  • ax (plt.Axes, optional) – The figure axes

  • add_bar (bool, optional) – Add a color bar

  • cmap (str, optional) – The colormap

  • weight_turbine (int, optional) – Index of the turbine from which to take the weight

  • verbosity (int, optional) – The verbosity level

  • ret_state (bool, optional) – Flag for state index return

  • ret_im (bool, optional) – Flag for image return

  • kwargs (dict, optional) – Parameters forwarded to the algorithm’s calc_points function.

Yields:
  • fig (matplotlib.Figure) – The figure object

  • si (int, optional) – The state index

  • im (matplotlib.collections.QuadMesh or matplotlib.QuadContourSet, optional) – The image object

get_mean_fig_xz(var, resolution, x_direction=270, xmin=None, zmin=0.0, xmax=None, zmax=None, xlabel='x [m]', zlabel='z [m]', y=None, xspace=500.0, zspace=500.0, levels=None, var_min=None, var_max=None, figsize=None, normalize_x=None, normalize_z=None, normalize_var=None, title=None, vlabel=None, fig=None, ax=None, add_bar=True, cmap=None, weight_turbine=0, verbosity=0, ret_state=False, ret_im=False, **kwargs)[source]

Generates 2D farm flow figure in a vertical xz-plane.

Parameters:
  • var (str) – The variable name

  • resolution (float) – The resolution in m

  • x_direction (float) – The direction of the x axis, 0 = north

  • xmin (float) – The min x coordinate, or None for automatic

  • zmin (float) – The min z coordinate

  • xmax (float) – The max x coordinate, or None for automatic

  • zmax (float) – The max z coordinate, or None for automatic

  • xlabel (str) – The x axis label

  • zlabel (str) – The z axis label

  • y (float) – The y coordinate of the plane

  • xspace (float) – The extra space in x direction, before and after wind farm

  • zspace (float) – The extra space in z direction, below and above wind farm

  • levels (int) – The number of levels for the contourf plot, or None for pure image

  • var_min (float) – Minimum variable value

  • var_max (float) – Maximum variable value

  • figsize (tuple) – The figsize for plt.Figure

  • normalize_x (float, optional) – Divide x by this value

  • normalize_z (float, optional) – Divide z by this value

  • normalize_var (float, optional) – Divide the variable by this value

  • title (str, optional) – The title

  • vlabel (str, optional) – The variable label

  • fig (plt.Figure, optional) – The figure object

  • ax (plt.Axes, optional) – The figure axes

  • add_bar (bool, optional) – Add a color bar

  • cmap (str, optional) – The colormap

  • weight_turbine (int, optional) – Index of the turbine from which to take the weight

  • verbosity (int, optional) – The verbosity level

  • ret_state (bool, optional) – Flag for state index return

  • ret_im (bool, optional) – Flag for image return

  • kwargs (dict, optional) – Parameters forwarded to the algorithm’s calc_points function.

Yields:
  • fig (matplotlib.Figure) – The figure object

  • si (int, optional) – The state index

  • im (matplotlib.collections.QuadMesh or matplotlib.QuadContourSet, optional) – The image object

get_mean_fig_yz(var, resolution, x_direction=270, ymin=None, zmin=0.0, ymax=None, zmax=None, ylabel='x [m]', zlabel='z [m]', x=None, yspace=500.0, zspace=500.0, levels=None, var_min=None, var_max=None, figsize=None, normalize_y=None, normalize_z=None, normalize_var=None, title=None, vlabel=None, fig=None, ax=None, add_bar=True, cmap=None, weight_turbine=0, verbosity=1, ret_state=False, ret_im=False, **kwargs)[source]

Generates 2D farm flow figure in a vertical yz-plane.

Parameters:
  • var (str) – The variable name

  • resolution (float) – The resolution in m

  • x_direction (float) – The direction of the x axis, 0 = north

  • ymin (float) – The min y coordinate, or None for automatic

  • zmin (float) – The min z coordinate

  • ymax (float) – The max y coordinate, or None for automatic

  • zmax (float) – The max z coordinate, or None for automatic

  • ylabel (str) – The y axis label

  • zlabel (str) – The z axis label

  • x (float) – The x coordinate of the plane

  • yspace (float) – The extra space in y direction, before and after wind farm

  • zspace (float) – The extra space in z direction, below and above wind farm

  • levels (int) – The number of levels for the contourf plot, or None for pure image

  • var_min (float) – Minimum variable value

  • var_max (float) – Maximum variable value

  • figsize (tuple) – The figsize for plt.Figure

  • normalize_y (float, optional) – Divide y by this value

  • normalize_z (float, optional) – Divide z by this value

  • normalize_var (float, optional) – Divide the variable by this value

  • title (str, optional) – The title

  • vlabel (str, optional) – The variable label

  • fig (plt.Figure, optional) – The figure object

  • ax (plt.Axes, optional) – The figure axes

  • add_bar (bool, optional) – Add a color bar

  • cmap (str, optional) – The colormap

  • weight_turbine (int, optional) – Index of the turbine from which to take the weight

  • verbosity (int, optional) – The verbosity level

  • ret_state (bool, optional) – Flag for state index return

  • ret_im (bool, optional) – Flag for image return

  • kwargs (dict, optional) – Parameters forwarded to the algorithm’s calc_points function.

Yields:
  • fig (matplotlib.Figure) – The figure object

  • si (int, optional) – The state index

  • im (matplotlib.collections.QuadMesh or matplotlib.QuadContourSet, optional) – The image object

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