1) If you already have two data frames, one as shown, the other with Wind_Speed 
and Wind_Dir, then you can use cbind() to join them if they have the same 
number of rows. If not, then you will have to edit one of the data frames (to 
get the same number of rows) or add column(s) so that both data frames have a 
column in common and then use something like full_join() from the dplyr package.

2) If you have roughly 44,000 wind rose plots (one for each hour, 5-years), and 
need to extract speed and direction, then you will need some automated image 
analysis program. It would be easier if you can get access to the data used to 
generate the wind rose plots, but I assume you have already tried that. This is 
more challenging if you have digital scans of printed plots where paper color, 
and ink changes over time. There may be other complications if (for example) 
the pictures are not all oriented in the same direction.
2a) If plots have speed and direction written on them then OCR might help.
2b) If plots have arrows you could focus on identifying arrow direction and 
length using image analysis.
2c) If plots show more of a distribution, then you may need an image analysis 
approach to efficiently get through all the images: train a convolutional 
neural network. Simplifying wind as speed and direction may need clarification. 
There is average [arithmetic, geometric, ...], minimum, or maximum speed and 
most frequent direction (mode, median, average direction?). The general concept 
is abundantly clear, but the details are problems.

To me, option 2c is more a Python sort of problem, but it can be done in R.

Tim

-----Original Message-----
From: R-help <r-help-boun...@r-project.org> On Behalf Of Jeff Newmiller via 
R-help
Sent: Wednesday, October 30, 2024 9:27 AM
To: r-help@r-project.org
Subject: Re: [R] Extracting wind direction and wind speed from wind rose plot

[External Email]

A wind rose plot omits time information. Your request is simply not possible.


On October 30, 2024 3:48:03 AM PDT, javad bayat <j.bayat...@gmail.com> wrote:
>Dear all;
>I am searching for a way to extract wind direction and speed from a
>wind rose plot. I have a graph and I want to make a dataframe of 5
>years with hourly intervals.
>
>> start_date <- as.POSIXct("2019-01-01 00:00:00") end_date <-
>> as.POSIXct("2023-12-31 23:00:00") time_sequence <- seq(from =
>> start_date, to = end_date, by = "hour")
>
>> df <- data.frame(
>  year = as.integer(format(time_sequence, "%Y")),
>  month = as.integer(format(time_sequence, "%m")),
>  day = as.integer(format(time_sequence, "%d")),
>  hour = as.integer(format(time_sequence, "%H"))
>)
>
>> head(df)
>  year month day hour
>1 2019     1   1    0
>2 2019     1   1    1
>3 2019     1   1    2
>4 2019     1   1    3
>5 2019     1   1    4
>6 2019     1   1    5
>
>
>And I want to add 2 more cols to this dataframe as Wind_Dir and
>Wind_Speed that the data extracted from the plot by analyzing it.
>Is there any library to do this? or any function to write for this purpose?
>I would be more than happy if you please help me to do this.
>Sincerely
>
>
>
>
>
>
>

--
Sent from my phone. Please excuse my brevity.

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide https://www.r-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide https://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to