Skip to content

Commit

Permalink
iss #309 improved display by changing font size automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
rach185 committed May 16, 2022
2 parents da23373 + f0744a4 commit 0f73906
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 6 additions & 1 deletion brightwind/analyse/analyse.py
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ def _calc_ratio(var_1, var_2, min_var=3, max_var=50):


def 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, radial_limits=None, figure_size=(10,10), **kwargs):
boom_dir_2=-1, return_data=False, radial_limits=None, figure_size=(10, 10), **kwargs):
"""
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
Expand Down Expand Up @@ -1195,6 +1195,11 @@ def sector_ratio(wspd_1, wspd_2, wdir, sectors=72, min_wspd=3, direction_bin_arr
raise ValueError('Number of anemometers does not match number of wind vanes. ' +
'Please ensure there is one direction vane per anemometer pair or ' +
'include one direcion vane only to be used for all anemometer pairs.')
if len(wd.columns) != 1:
if len(wd.columns) != len(ws_1.columns):
raise ValueError('Number of anemometers does not match number of wind vanes. ' +
'Please ensure there is one direction vane per anemometer pair or ' +
'include one direction vane only to be used for all anemometer pairs.')

keys = range(len(ws_1.columns))
sec_rats = {}
Expand Down
9 changes: 5 additions & 4 deletions brightwind/analyse/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -989,11 +989,11 @@ def plot_12x24_contours(tab_12x24, label=('Variable', 'mean'), plot=None):


def plot_sector_ratio(sec_ratio, wdir, sec_ratio_dist, col_names, boom_dir_1=-1, boom_dir_2=-1,
radial_limits=None, figure_size=(10,10), **kwargs):
radial_limits=None, figure_size=(10, 10), **kwargs):
"""
Accepts multiple ratio of anemometer pairs per sector, a wind direction, multiple distributions of anemometer ratio
pairs per sector, along with 2 anemometer names, and plots the speed ratio by sector. Optionally can include
anemometer boom directions also.
Accepts a DataFrame table or a dictionary with multiple ratio of anemometer pairs per sector, a wind direction,
multiple distributions of anemometer ratio pairs per sector, along with 2 anemometer names,
and plots the speed ratio by sector. Optionally can include anemometer boom directions also.
:param sec_ratio: Sector_ratios
:type sec_ratio: pandas.Series or dict
Expand Down Expand Up @@ -1052,6 +1052,7 @@ def plot_sector_ratio(sec_ratio, wdir, sec_ratio_dist, col_names, boom_dir_1=-1,

return fig


def _plot_sector_ratio_subplot(sec_ratio, wdir, sec_ratio_dist, col_names, boom_dir_1=-1, boom_dir_2=-1,
ax=None, radial_limits=None, figure_size=(10,10), subplot_dimension=(1,1)):
"""
Expand Down

0 comments on commit 0f73906

Please sign in to comment.