Skip to content

Commit

Permalink
iss #386 added examples in docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
BiancaMorandi committed May 22, 2023
1 parent d1addfd commit 1df19dd
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion brightwind/analyse/analyse.py
Original file line number Diff line number Diff line change
Expand Up @@ -1153,12 +1153,23 @@ def freq_table(var_series, direction_series, var_bin_array=np.arange(-0.5, 41, 1
display(rose)
display(freq_table)
# To get the plot and the freq table imposing a coverage_threshold of 0.5.
rose, freq_table = bw.freq_table(data.Spd40mN, data.Dir38mS, return_data=True, coverage_threshold=0.5)
display(rose)
display(freq_table)
# Apply seasonal adjustment and coverage threshold of 70%
rose, freq_table = bw.freq_table(data.Spd40mN, data.Dir38mS, return_data=True, seasonal_adjustment=True,
coverage_threshold=0.7)
display(rose)
display(freq_table)
# Apply seasonal adjustment and set coverage_threshold to 0 to not filter out data.
rose, freq_table = bw.freq_table(data.Spd40mN, data.Dir38mS, return_data=True, seasonal_adjustment=True,
coverage_threshold=0)
display(rose)
display(freq_table)
# To use 3 bins for wind speed [0,8), [8, 14), [14, 41) and label them as ['low', 'mid', 'high'].
# Can be used for variables other than wind speed too
rose, freq_table = bw.freq_table(data.Spd40mN, data.Dir38mS, var_bin_array=[0,8,14,41],
Expand Down Expand Up @@ -1252,7 +1263,6 @@ def freq_table(var_series, direction_series, var_bin_array=np.arange(-0.5, 41, 1
sectors=sectors, direction_bin_array=direction_bin_array,
direction_bin_labels=None, aggregation_method=agg_method
).replace(np.nan, 0.0)
text_msg_out = None

if target_freq_table_mean is None:
k = -1
Expand Down

0 comments on commit 1df19dd

Please sign in to comment.