FlowMap

class py_wake.flow_map.FlowMap(simulationResult, X, Y, localWind_j, WS_eff_jlk, TI_eff_jlk, plane)[source]

power_xylk([with_wake_loss])

aep_xylk([normalize_probabilities, ...])

Anual Energy Production of a potential wind turbine at all grid positions (x,y) for all wind directions (l) and wind speeds (k) in GWh.

aep_xy([normalize_probabilities, with_wake_loss])

Anual Energy Production of a potential wind turbine at all grid positions (x,y) (sum of all wind directions and wind speeds) in GWh.

plot_windturbines([normalize_with, ax])

plot_wake_map([levels, cmap, plot_colorbar, ...])

Plot effective wind speed contourf map

plot_ti_map([levels, cmap, plot_colorbar, ...])

Plot effective turbulence intensity contourf map

aep_xy(normalize_probabilities=False, with_wake_loss=True, **wt_kwargs)[source]

Anual Energy Production of a potential wind turbine at all grid positions (x,y) (sum of all wind directions and wind speeds) in GWh.

see aep_xylk

aep_xylk(normalize_probabilities=False, with_wake_loss=True, **wt_kwargs)[source]

Anual Energy Production of a potential wind turbine at all grid positions (x,y) for all wind directions (l) and wind speeds (k) in GWh.

Parameters
  • normalize_propabilities (Optional bool, defaults to False) –

    In case only a subset of all wind speeds and/or wind directions is simulated, this parameter determines whether the returned AEP represents the energy produced in the fraction of a year where these flow cases occurs or a whole year of northern wind. If for example, wd=[0], then - False means that the AEP only includes energy from the faction of year

    with northern wind (359.5-0.5deg), i.e. no power is produced the rest of the year. - True means that the AEP represents a whole year of northen wind. default is False

  • with_wake_loss (Optional bool, defaults to True) –

    If True, wake loss is included, i.e. power is calculated using local effective wind speed

    If False, wake loss is neglected, i.e. power is calculated using local free flow wind speed

  • wt_type (Optional arguments) – Additional required/optional arguments needed by the WindTurbines to computer power, e.g. type, Air_density

all(dim=None, **kwargs)

Reduce this FlowMap’s data by applying all along some dimension(s).

Parameters
  • dim (str or sequence of str, optional) – Dimension(s) over which to apply all. By default all is applied over all dimensions.

  • keep_attrs (bool, optional) – If True, the attributes (attrs) will be copied from the original object to the new one. If False (default), the new object will be returned without attributes.

  • **kwargs (dict) – Additional keyword arguments passed on to the appropriate array function for calculating all on this object’s data.

Returns

reduced – New FlowMap object with all applied to its data and the indicated dimension(s) removed.

Return type

FlowMap

any(dim=None, **kwargs)

Reduce this FlowMap’s data by applying any along some dimension(s).

Parameters
  • dim (str or sequence of str, optional) – Dimension(s) over which to apply any. By default any is applied over all dimensions.

  • keep_attrs (bool, optional) – If True, the attributes (attrs) will be copied from the original object to the new one. If False (default), the new object will be returned without attributes.

  • **kwargs (dict) – Additional keyword arguments passed on to the appropriate array function for calculating any on this object’s data.

Returns

reduced – New FlowMap object with any applied to its data and the indicated dimension(s) removed.

Return type

FlowMap

count(dim=None, **kwargs)

Reduce this FlowMap’s data by applying count along some dimension(s).

Parameters
  • dim (str or sequence of str, optional) – Dimension(s) over which to apply count. By default count is applied over all dimensions.

  • keep_attrs (bool, optional) – If True, the attributes (attrs) will be copied from the original object to the new one. If False (default), the new object will be returned without attributes.

  • **kwargs (dict) – Additional keyword arguments passed on to the appropriate array function for calculating count on this object’s data.

Returns

reduced – New FlowMap object with count applied to its data and the indicated dimension(s) removed.

Return type

FlowMap

cumprod(dim=None, skipna=None, **kwargs)

Apply cumprod along some dimension of FlowMap.

Parameters
  • dim (str or sequence of str, optional) – Dimension over which to apply cumprod.

  • axis (int or sequence of int, optional) – Axis over which to apply cumprod. Only one of the ‘dim’ and ‘axis’ arguments can be supplied.

  • skipna (bool, optional) – If True, skip missing values (as marked by NaN). By default, only skips missing values for float dtypes; other dtypes either do not have a sentinel missing value (int) or skipna=True has not been implemented (object, datetime64 or timedelta64).

  • keep_attrs (bool, optional) – If True, the attributes (attrs) will be copied from the original object to the new one. If False (default), the new object will be returned without attributes.

  • **kwargs (dict) – Additional keyword arguments passed on to cumprod.

Returns

cumvalue – New FlowMap object with cumprod applied to its data along the indicated dimension.

Return type

FlowMap

cumsum(dim=None, skipna=None, **kwargs)

Apply cumsum along some dimension of FlowMap.

Parameters
  • dim (str or sequence of str, optional) – Dimension over which to apply cumsum.

  • axis (int or sequence of int, optional) – Axis over which to apply cumsum. Only one of the ‘dim’ and ‘axis’ arguments can be supplied.

  • skipna (bool, optional) – If True, skip missing values (as marked by NaN). By default, only skips missing values for float dtypes; other dtypes either do not have a sentinel missing value (int) or skipna=True has not been implemented (object, datetime64 or timedelta64).

  • keep_attrs (bool, optional) – If True, the attributes (attrs) will be copied from the original object to the new one. If False (default), the new object will be returned without attributes.

  • **kwargs (dict) – Additional keyword arguments passed on to cumsum.

Returns

cumvalue – New FlowMap object with cumsum applied to its data along the indicated dimension.

Return type

FlowMap

max(dim=None, skipna=None, **kwargs)

Reduce this FlowMap’s data by applying max along some dimension(s).

Parameters
  • dim (str or sequence of str, optional) – Dimension(s) over which to apply max. By default max is applied over all dimensions.

  • skipna (bool, optional) – If True, skip missing values (as marked by NaN). By default, only skips missing values for float dtypes; other dtypes either do not have a sentinel missing value (int) or skipna=True has not been implemented (object, datetime64 or timedelta64).

  • keep_attrs (bool, optional) – If True, the attributes (attrs) will be copied from the original object to the new one. If False (default), the new object will be returned without attributes.

  • **kwargs (dict) – Additional keyword arguments passed on to the appropriate array function for calculating max on this object’s data.

Returns

reduced – New FlowMap object with max applied to its data and the indicated dimension(s) removed.

Return type

FlowMap

mean(dim=None, skipna=None, **kwargs)

Reduce this FlowMap’s data by applying mean along some dimension(s).

Parameters
  • dim (str or sequence of str, optional) – Dimension(s) over which to apply mean. By default mean is applied over all dimensions.

  • skipna (bool, optional) – If True, skip missing values (as marked by NaN). By default, only skips missing values for float dtypes; other dtypes either do not have a sentinel missing value (int) or skipna=True has not been implemented (object, datetime64 or timedelta64).

  • keep_attrs (bool, optional) – If True, the attributes (attrs) will be copied from the original object to the new one. If False (default), the new object will be returned without attributes.

  • **kwargs (dict) – Additional keyword arguments passed on to the appropriate array function for calculating mean on this object’s data.

Returns

reduced – New FlowMap object with mean applied to its data and the indicated dimension(s) removed.

Return type

FlowMap

median(dim=None, skipna=None, **kwargs)

Reduce this FlowMap’s data by applying median along some dimension(s).

Parameters
  • dim (str or sequence of str, optional) – Dimension(s) over which to apply median. By default median is applied over all dimensions.

  • skipna (bool, optional) – If True, skip missing values (as marked by NaN). By default, only skips missing values for float dtypes; other dtypes either do not have a sentinel missing value (int) or skipna=True has not been implemented (object, datetime64 or timedelta64).

  • keep_attrs (bool, optional) – If True, the attributes (attrs) will be copied from the original object to the new one. If False (default), the new object will be returned without attributes.

  • **kwargs (dict) – Additional keyword arguments passed on to the appropriate array function for calculating median on this object’s data.

Returns

reduced – New FlowMap object with median applied to its data and the indicated dimension(s) removed.

Return type

FlowMap

min(dim=None, skipna=None, **kwargs)

Reduce this FlowMap’s data by applying min along some dimension(s).

Parameters
  • dim (str or sequence of str, optional) – Dimension(s) over which to apply min. By default min is applied over all dimensions.

  • skipna (bool, optional) – If True, skip missing values (as marked by NaN). By default, only skips missing values for float dtypes; other dtypes either do not have a sentinel missing value (int) or skipna=True has not been implemented (object, datetime64 or timedelta64).

  • keep_attrs (bool, optional) – If True, the attributes (attrs) will be copied from the original object to the new one. If False (default), the new object will be returned without attributes.

  • **kwargs (dict) – Additional keyword arguments passed on to the appropriate array function for calculating min on this object’s data.

Returns

reduced – New FlowMap object with min applied to its data and the indicated dimension(s) removed.

Return type

FlowMap

plot(data, clabel, levels=100, cmap=None, plot_colorbar=True, plot_windturbines=True, normalize_with=1, ax=None)[source]

Plot data as contouf map

Parameters
  • data (array_like) – 2D data array to plot

  • clabel (str) – colorbar label

  • levels (int or array-like, default 100) – Determines the number and positions of the contour lines / regions. If an int n, use n data intervals; i.e. draw n+1 contour lines. The level heights are automatically chosen. If array-like, draw contour lines at the specified levels. The values must be in increasing order.

  • cmap (str or Colormap, defaults 'Blues_r'.) – A Colormap instance or registered colormap name. The colormap maps the level values to colors.

  • plot_colorbar (bool, default True) – if True (default), colorbar is drawn

  • plot_windturbines (bool, default True) – if True (default), lines/circles showing the wind turbine rotors are plotted

  • ax (pyplot or matplotlib axes object, default None) –

plot_ti_map(levels=100, cmap=None, plot_colorbar=True, plot_windturbines=True, ax=None)[source]

Plot effective turbulence intensity contourf map

Parameters
  • levels (int or array-like, default 100) – Determines the number and positions of the contour lines / regions. If an int n, use n data intervals; i.e. draw n+1 contour lines. The level heights are automatically chosen. If array-like, draw contour lines at the specified levels. The values must be in increasing order.

  • cmap (str or Colormap, defaults 'Blues'.) – A Colormap instance or registered colormap name. The colormap maps the level values to colors.

  • plot_colorbar (bool, default True) – if True (default), colorbar is drawn

  • plot_windturbines (bool, default True) – if True (default), lines/circles showing the wind turbine rotors are plotted

  • ax (pyplot or matplotlib axes object, default None) –

plot_wake_map(levels=100, cmap=None, plot_colorbar=True, plot_windturbines=True, normalize_with=1, ax=None)[source]

Plot effective wind speed contourf map

Parameters
  • levels (int or array-like, default 100) – Determines the number and positions of the contour lines / regions. If an int n, use n data intervals; i.e. draw n+1 contour lines. The level heights are automatically chosen. If array-like, draw contour lines at the specified levels. The values must be in increasing order.

  • cmap (str or Colormap, defaults 'Blues_r'.) – A Colormap instance or registered colormap name. The colormap maps the level values to colors.

  • plot_colorbar (bool, default True) – if True (default), colorbar is drawn

  • plot_windturbines (bool, default True) – if True (default), lines/circles showing the wind turbine rotors are plotted

  • ax (pyplot or matplotlib axes object, default None) –

prod(dim=None, skipna=None, **kwargs)

Reduce this FlowMap’s data by applying prod along some dimension(s).

Parameters
  • dim (str or sequence of str, optional) – Dimension(s) over which to apply prod. By default prod is applied over all dimensions.

  • skipna (bool, optional) – If True, skip missing values (as marked by NaN). By default, only skips missing values for float dtypes; other dtypes either do not have a sentinel missing value (int) or skipna=True has not been implemented (object, datetime64 or timedelta64).

  • min_count (int, default: None) – The required number of valid values to perform the operation. If fewer than min_count non-NA values are present the result will be NA. Only used if skipna is set to True or defaults to True for the array’s dtype. New in version 0.10.8: Added with the default being None. Changed in version 0.17.0: if specified on an integer array and skipna=True, the result will be a float array.

  • keep_attrs (bool, optional) – If True, the attributes (attrs) will be copied from the original object to the new one. If False (default), the new object will be returned without attributes.

  • **kwargs (dict) – Additional keyword arguments passed on to the appropriate array function for calculating prod on this object’s data.

Returns

reduced – New FlowMap object with prod applied to its data and the indicated dimension(s) removed.

Return type

FlowMap

std(dim=None, skipna=None, **kwargs)

Reduce this FlowMap’s data by applying std along some dimension(s).

Parameters
  • dim (str or sequence of str, optional) – Dimension(s) over which to apply std. By default std is applied over all dimensions.

  • skipna (bool, optional) – If True, skip missing values (as marked by NaN). By default, only skips missing values for float dtypes; other dtypes either do not have a sentinel missing value (int) or skipna=True has not been implemented (object, datetime64 or timedelta64).

  • keep_attrs (bool, optional) – If True, the attributes (attrs) will be copied from the original object to the new one. If False (default), the new object will be returned without attributes.

  • **kwargs (dict) – Additional keyword arguments passed on to the appropriate array function for calculating std on this object’s data.

Returns

reduced – New FlowMap object with std applied to its data and the indicated dimension(s) removed.

Return type

FlowMap

sum(dim=None, skipna=None, **kwargs)

Reduce this FlowMap’s data by applying sum along some dimension(s).

Parameters
  • dim (str or sequence of str, optional) – Dimension(s) over which to apply sum. By default sum is applied over all dimensions.

  • skipna (bool, optional) – If True, skip missing values (as marked by NaN). By default, only skips missing values for float dtypes; other dtypes either do not have a sentinel missing value (int) or skipna=True has not been implemented (object, datetime64 or timedelta64).

  • min_count (int, default: None) – The required number of valid values to perform the operation. If fewer than min_count non-NA values are present the result will be NA. Only used if skipna is set to True or defaults to True for the array’s dtype. New in version 0.10.8: Added with the default being None. Changed in version 0.17.0: if specified on an integer array and skipna=True, the result will be a float array.

  • keep_attrs (bool, optional) – If True, the attributes (attrs) will be copied from the original object to the new one. If False (default), the new object will be returned without attributes.

  • **kwargs (dict) – Additional keyword arguments passed on to the appropriate array function for calculating sum on this object’s data.

Returns

reduced – New FlowMap object with sum applied to its data and the indicated dimension(s) removed.

Return type

FlowMap

var(dim=None, skipna=None, **kwargs)

Reduce this FlowMap’s data by applying var along some dimension(s).

Parameters
  • dim (str or sequence of str, optional) – Dimension(s) over which to apply var. By default var is applied over all dimensions.

  • skipna (bool, optional) – If True, skip missing values (as marked by NaN). By default, only skips missing values for float dtypes; other dtypes either do not have a sentinel missing value (int) or skipna=True has not been implemented (object, datetime64 or timedelta64).

  • keep_attrs (bool, optional) – If True, the attributes (attrs) will be copied from the original object to the new one. If False (default), the new object will be returned without attributes.

  • **kwargs (dict) – Additional keyword arguments passed on to the appropriate array function for calculating var on this object’s data.

Returns

reduced – New FlowMap object with var applied to its data and the indicated dimension(s) removed.

Return type

FlowMap