brightwind.analyse.shear.Shear.Average¶
-
class
brightwind.analyse.shear.Shear.
Average
(wspds, heights, min_speed=3, calc_method='power_law', plot_both=False, max_plot_height=None)¶ Calculates alpha, using the power law, or the roughness coefficient, using the log law, based on the average wind speeds of each supplied time series.
- Parameters
wspds (pandas.DataFrame, list of pandas.Series or list.) – pandas.DataFrame, list of pandas.Series or list of wind speeds to be used for calculating shear.
heights (list) – List of anemometer heights
min_speed (float) – Only speeds higher than this would be considered for calculating shear, default is 3.
calc_method (str) – method to use for calculation, either ‘power_law’ (returns alpha) or ‘log_law’ (returns the roughness coefficient).
max_plot_height (float) – height to which the wind profile plot is extended.
- Returns
Average object containing calculated alpha/roughness coefficient values, a plot and other data.
- Return type
Average object
Example usage
import brightwind as bw import pprint # Load anemometer data to calculate exponents data = bw.load_csv(C:\Users\Stephen\Documents\Analysis\demo_data) anemometers = data[['Spd80mS', 'Spd60mS','Spd40mS']] heights = [80, 60, 40] # Using with a DataFrame of wind speeds average_power_law = bw.Shear.Average(anemometers, heights) average_log_law = bw.Shear.Average(anemometers, heights, calc_method='log_law', max_plot_height=120) # Get the alpha or roughness values calculated average_power_law.alpha average_log_law.roughness # View plot average_power_law.plot average_log_law.plot # View input data average_power_law.wspds average_log_law.wspds # View other information pprint.pprint(average_power_law.info) pprint.pprint(average_log_law.info)
-
__init__
(wspds, heights, min_speed=3, calc_method='power_law', plot_both=False, max_plot_height=None)¶ Calculates alpha, using the power law, or the roughness coefficient, using the log law, based on the average wind speeds of each supplied time series.
- Parameters
wspds (pandas.DataFrame, list of pandas.Series or list.) – pandas.DataFrame, list of pandas.Series or list of wind speeds to be used for calculating shear.
heights (list) – List of anemometer heights
min_speed (float) – Only speeds higher than this would be considered for calculating shear, default is 3.
calc_method (str) – method to use for calculation, either ‘power_law’ (returns alpha) or ‘log_law’ (returns the roughness coefficient).
max_plot_height (float) – height to which the wind profile plot is extended.
- Returns
Average object containing calculated alpha/roughness coefficient values, a plot and other data.
- Return type
Average object
Example usage
import brightwind as bw import pprint # Load anemometer data to calculate exponents data = bw.load_csv(C:\Users\Stephen\Documents\Analysis\demo_data) anemometers = data[['Spd80mS', 'Spd60mS','Spd40mS']] heights = [80, 60, 40] # Using with a DataFrame of wind speeds average_power_law = bw.Shear.Average(anemometers, heights) average_log_law = bw.Shear.Average(anemometers, heights, calc_method='log_law', max_plot_height=120) # Get the alpha or roughness values calculated average_power_law.alpha average_log_law.roughness # View plot average_power_law.plot average_log_law.plot # View input data average_power_law.wspds average_log_law.wspds # View other information pprint.pprint(average_power_law.info) pprint.pprint(average_log_law.info)
Methods
__init__
(wspds, heights[, min_speed, …])Calculates alpha, using the power law, or the roughness coefficient, using the log law, based on the
apply
(wspds, height, shear_to)Applies average shear calculated to a wind speed time series to scale wind speed from one height to another.
Attributes
alpha
roughness