brightwind.analyse.analyse.sector_ratio¶
-
brightwind.analyse.analyse.
sector_ratio
(wspd_1, wspd_2, wdir, sectors=72, min_wspd=3, direction_bin_array=None, boom_dir_1=-1, boom_dir_2=-1, return_data=False)¶ Calculates the wind speed ratio of two wind speed time series and plots this ratio, averaged by direction sector, in a polar plot using a wind direction time series. The averaged ratio by sector can be optionally returned in a pd.DataFrame.
If boom directions are specified, these will be overlaid on the plot. A boom direction of ‘-1’ assumes top mounted and so doesn’t plot.
- Parameters
wspd_1 – First wind speed time series. This is divisor.
wspd_2 – Second wind speed time series, dividend.
wdir (pandas.Series) – Series of wind directions
sectors (int) – Set the number of direction sectors. Usually 12, 16, 24, 36 or 72.
min_wspd – Minimum wind speed to be used.
direction_bin_array – (Optional) Array of numbers where adjacent elements of array form a bin. This overwrites the sectors.
boom_dir_1 (float) – Boom direction in degrees of wspd_1. If top mounted leave default as -1.
boom_dir_2 (float) – Boom direction in degrees of wspd_2. If top mounted leave default as -1.
return_data (bool) – Set to True if you want the data returned.
- Type
wspd_1: pandas.Series
- Type
wspd_2: pandas.Series
- Type
min_wpd: float
- Returns
A wind speed ratio plot showing the average ratio by sector and scatter of individual data points.
- Return type
plot, pandas.DataFrame
Example usage
import brightwind as bw data = bw.load_csv(bw.datasets.demo_data) #For plotting both booms bw.sector_ratio(data.Spd80mN, data.Spd80mS, wdir=data.Dir78mS, boom_dir_1=0, boom_dir_2=180) #For plotting no booms bw.sector_ratio(data.Spd80mN, data.Spd80mS, wdir=data.Dir78mS) #If one boom is top mounted, say Spd80mS bw.sector_ratio(data.Spd80mN, data.Spd80mS, wdir=data.Dir78mS, boom_dir_2=180) #To use your custom direction bins, for example (0-45), (45-135), (135-180), (180-220), (220-360) bw.sector_ratio(data.Spd80mN, data.Spd80mS, wdir=data.Dir78mS, direction_bin_array=[0, 45, 135, 180, 220, 360], boom_dir_1=0, boom_dir_2=180)