Retrieve Current and Historical Upper Air Soundings Data from the University of Wyoming
The University of Wyoming maintains a server (http://weather.uwyo.edu/upperair/sounding.html) that provides an interface to query current and historical upper air soundings data. Tools are provided to query this service and retrieve the data.
Ref:
The following functions are implemented:
get_region_codes
: Retrive region names and codesget_sounding_data
: Get sounding data for a stationrbind_soundings
: Turn a list of soundings data frames into a single data framedevtools::install_github("hrbrmstr/unsound")
options(width=120)
library(unsound) library(magick) library(tidyverse) # overkill since it's just for data frame pretty printing # current verison packageVersion("unsound")
get_region_codes()
# get the start/end range startDate <- as.Date("01-11-17", format="%d-%m-%y") endDate <- as.Date("31-01-18",format="%d-%m-%y") # make a sequence days <- seq(startDate, endDate, "1 day") lapply(days[1:4], function(day) { Sys.sleep(3) # be kind to their servers get_sounding_data( region = "seasia", date = day, from_hr = "00", to_hr = "00", station_number = "48657" ) }) -> soundings_48657 # Notice there's missing data for one day str(soundings_48657) # make one big data frame soundings_48657 <- rbind_soundings(soundings_48657) glimpse(soundings_48657) soundings_48657
get_sounding_map( station_number = "48657", date = Sys.Date()-1, map_type = "skewt", map_format = "gif", region = "seasia", from_hr = "00", to_hr = "00" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.