brightwind.analyse.shear.Shear.TimeSeries¶
-
class
brightwind.analyse.shear.Shear.
TimeSeries
(wspds, heights, min_speed=3, calc_method='power_law', max_plot_height=None, maximise_data=False)¶ Calculates alpha, using the power law, or the roughness coefficient, using the log law, for each timestamp of a wind 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.
maximise_data (Boolean) – If maximise_data is True, calculations will be carried out on all data where two or more anemometers readings exist for a timestamp. If False, calculations will only be carried out on timestamps where readings exist for all anemometers.
- :return TimeSeries object containing calculated alpha/roughness coefficient values, a plot
and other data.
:rtype TimeSeries 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 timeseries_power_law = bw.Shear.TimeSeries(anemometers, heights, maximise_data=True) timeseries_log_law = bw.Shear.TimeSeries(anemometers, heights, calc_method='log_law', max_plot_height=120) # Get the alpha or roughness values calculated timeseries_power_law.alpha timeseries_log_law.roughness # View plot timeseries_power_law.plot timeseries_log_law.plot # View input anemometer data timeseries_power_law.wspds timeseries_log_law.wspds # View other information pprint.pprint(timeseries_power_law.info) pprint.pprint(timeseries_log_law.info)
-
__init__
(wspds, heights, min_speed=3, calc_method='power_law', max_plot_height=None, maximise_data=False)¶ Calculates alpha, using the power law, or the roughness coefficient, using the log law, for each timestamp of a wind 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.
maximise_data (Boolean) – If maximise_data is True, calculations will be carried out on all data where two or more anemometers readings exist for a timestamp. If False, calculations will only be carried out on timestamps where readings exist for all anemometers.
- :return TimeSeries object containing calculated alpha/roughness coefficient values, a plot
and other data.
:rtype TimeSeries 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 timeseries_power_law = bw.Shear.TimeSeries(anemometers, heights, maximise_data=True) timeseries_log_law = bw.Shear.TimeSeries(anemometers, heights, calc_method='log_law', max_plot_height=120) # Get the alpha or roughness values calculated timeseries_power_law.alpha timeseries_log_law.roughness # View plot timeseries_power_law.plot timeseries_log_law.plot # View input anemometer data timeseries_power_law.wspds timeseries_log_law.wspds # View other information pprint.pprint(timeseries_power_law.info) pprint.pprint(timeseries_log_law.info)
Methods
__init__
(wspds, heights[, min_speed, …])Calculates alpha, using the power law, or the roughness coefficient, using the log law, for each timestamp
apply
(wspds, height, shear_to)”
Attributes
alpha
roughness