ropensci / clifro

Easily download and visualise climate data from CliFlo
https://docs.ropensci.org/clifro
27 stars 12 forks source link

why windRose plot low speed wind on outcircle #35

Open quancui999 opened 1 year ago

quancui999 commented 1 year ago

Hello,

I have noticed several differences with the current windRose function:

1) The argument calm_wind is requested but not used in the function. I would expect that this value would be automatically added as one speed cut, and that windspeeds less than calm_wind would be shown as a transparent bin in the windrose plot.

2) In the windRose plot, low-speed winds are shown as the outer circle and high-speed winds are shown as the inner circle. Is this specific to New Zealand? Could this be made customizable for users? I have attempted to adjust the speed cut from larger to smaller numbers, but it did not affect how the plot was displayed.

3) The available color options are limited to those in the RColorBrewer package. Could the colors be made customizable like in any ggplot2 plots? This would allow for the use of user-defined colors and other packages that provide additional color schemes.

Thank you for your attention to these concerns. I appreciate any assistance you can provide in addressing these issues.

blasee commented 1 year ago

Hi @quancui999,

Thanks for helping to improve clifro!

  1. I've updated the documentation for the calm_wind argument in the windrose function. This argument is actually referencing the direction of winds that are considered calm. By default, I follow the National Weather Service convention where winds with a direction of 0 are considered calm. This is also the approach taken in the circular R package.
  2. I've updated clifro. The new (dev) version now has the low-speed winds near the center:
library(clifro)
wind_df = data.frame(wind_speeds = c(rweibull(80, 2, 4), rweibull(20, 3, 9)),
                     wind_dirs = c(rnorm(80, 135, 55), rnorm(20, 315, 35)) %% 360,
                     station = rep(rep(c("Station A", "Station B"), 2),
                                   rep(c(40, 10), each = 2)))

# Plot a simple windrose using all the defaults, ignoring any facet variable
with(wind_df, windrose(wind_speeds, wind_dirs))

image

  1. Thanks for letting me know user-defined colours would be useful. I'll open up another issue for this.