简体   繁体   中英

Include windspeed and pollution in pollutionrose

I would like to include the wind speed and the pollution variable together in one pollutionrose or windrose. The function windrose() or pollutionrose() only enables to include data series instead of wind speed.

The graph should show the pollution concentration by coluor, the wind direction by direction and the wind speed by radius like in the image.

pollutionRose(data, ws="ws", wd="wd", pollutant = "PM1", 
              breaks = c(0, 10, 20, 30, 40, 50, 60, 70))

windRose(data, ws = "ws", wd = "wd", pollutant = "PM1", 
         breaks = c(0, 10, 20, 30, 40, 50, 60, 70))

How it should looks like在此处输入图片说明

You can use the polarplot function in openAir to generate a plot which shows the variation in concentration by wind speed and wind direction. I've provided a code sample with output for you below, where Mock_Data can be substitued with your input file.

library(openair)
library(truncnorm)

#Mock data set providing three sites with 1,000 measurements of wind direction
#wind speed and concentrations of a pollutant, in this case, PM10
Site <- c(rep("Site_A",1000), rep("Site_B", 1000), rep("Site_C", 1000))
ws <- rtruncnorm(n=3000, a=0, b=7, mean=2.5, sd=1.75)
wd <- rtruncnorm(n=3000, a=0, b=359, mean=220, sd=50)
PM10 <- rtruncnorm(n=3000, a=0.00, b=7.50, mean=2.5, sd=0.85)  
Mock_Data <- data.frame(Site, ws, wd, PM10)     

#Polar plot function
polarPlot(Mock_Data,pollutant= "PM10",
      type = "Site", col = "jet",
      key.position= "right",key.header= "mean PM10 (ug/m3)", key.footer=NULL)

Giving this output -- 使用 openAir 生成的极坐标图 Now, to emphasize here, use of this mock data set isn't the best to replicate what actually happens in the field. There, prevailing wind directions occur, wind speeds vary by said prevailing wind directions, and pollution sources are present which means you can point out particular areas which have higher concentrations of the pollutant you may be investigating. Neverthless, this is merely an example of the function at work, and with your own data present, should replicate the image that you have attached.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM