Ogimet - download and visualize wind patterns over Svalbard
- Downloading hourly data from the Ogimet repository for the defined
time frame (2018/01/01-2018/12/31); chosen station: Svalbard
Lufthavn
- Using external package ‘openair’ to visualize the downloaded
results
## 01008
## | | | 0%
## /tmp/RtmpZURyXi/file1b4231c10c80
## | |====== | 8%
## /tmp/RtmpZURyXi/file1b424ff064c8
## | |============ | 17%
## /tmp/RtmpZURyXi/file1b421d148a73
## | |================== | 25%
## /tmp/RtmpZURyXi/file1b42754388fe
## | |======================= | 33%
## /tmp/RtmpZURyXi/file1b425af61e2e
## | |============================= | 42%
## /tmp/RtmpZURyXi/file1b425a55d06a
## | |=================================== | 50%
## /tmp/RtmpZURyXi/file1b4244dc6a54
## | |========================================= | 58%
## /tmp/RtmpZURyXi/file1b42161dabf3
## | |=============================================== | 67%
## /tmp/RtmpZURyXi/file1b422bc5edcf
## | |==================================================== | 75%
## /tmp/RtmpZURyXi/file1b4223cd8ec1
## | |========================================================== | 83%
## /tmp/RtmpZURyXi/file1b4236069884
## | |================================================================ | 92%
## /tmp/RtmpZURyXi/file1b424376a87b
## | |======================================================================| 100%
## /tmp/RtmpZURyXi/file1b42508ad4b1
## Error in get(paste0(generic, ".", class), envir = get_method_env()) :
## object 'type_sum.accel' not found
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(openair) # external package for plotting wind roses
# converting wind direction from character into degress required by most
wdir <- data.frame(ddd = c("CAL","N","NNE","NE","ENE","E","ESE","SE","SSE",
"S","SSW","SW","WSW","W","WNW","NW","NNW"),
dir = c(NA, 0:15 * 22.5), stringsAsFactors = FALSE)
# changing date column to the format required by openair package:
df$Date <- as.POSIXct(df$Date, tz = "UTC")
df$date <- df$Date
df <- left_join(df, wdir)
## Joining with `by = join_by(ddd)`
df$ws <- df$ffkmh / 3.6 # conversion to m/s from km/h
df$gust <- df$Gustkmh / 3.6 # conversion to m/s from km/h
windRose(mydata = df, ws = "ws", wd = "dir", type = "season", paddle = FALSE,
main = "Svalbard Lufthavn (2018)", ws.int = 3, dig.lab = 3, layout = c(4, 1))
# do we miss any data?
summaryPlot(df[ ,c("date", "TC", "ws", "gust")])
# which sectors are responsible for warm/cold air mass advection:
polarPlot(df, pollutant = "TC", x = "ws", wd = "dir", k = 50, force.positive = FALSE,
type = "season", layout = c(4, 1), resolution = "fine", normalise = FALSE)