ropenair

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 enter image description here


Solution

  • 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 -- Polar plot produced using 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.