windrose
windrose copied to clipboard
Handling "Calms"
Is there a way to treat 'calms' differently within datasets? For example, in the dataset I'm attempting to create windroses for, calms are denoted as Wd=0.0 and Ws=0.0 (whereas North winds are denoted as Wd=360.0). It seems like in this case they are currently lumped in with North winds.
Maybe you could simply remove these data from your input data For example using a Pandas DataFrame and boolean indexing
df = df[df["Ws"] > 0.1]
I have started removing the calms from the dataframes prior to passing to the windrose bar function similar to the way you suggested. What I was hoping is that there is some way to replicate the typical calms representation within other windroses (i.e. a circle in the center, from which the sector "petals" emanate) as the example below shows:
Pinging @LionelR
It should be possible to compute the calms frequency in the histogram method and initialise the offset plots methods variable accordingly after drawing a centered circle. I don't have a computer right now but I can try something tomorrow if you can't in the mean time.
I found a way to get around this. Its not the most elegant solution, but it works. The pyplot.text() allows us to place text at a coordinate of our choosing. And you can get this nice circle smack in the middle of the polar plot. Here is the sample code:
plt.text(0., 0., "Calm", size=18, ha="center", va="center", bbox=dict(boxstyle="circle") )
This was implemented in https://github.com/python-windrose/windrose/pull/102