unsound

Retrieve Current and Historical Upper Air Soundings Data from the University of Wyoming

Description

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:

What's Inside The Tin

The following functions are implemented:

Installation

devtools::install_github("hrbrmstr/unsound")
options(width=120)

Usage

library(unsound)
library(magick)
library(tidyverse) # overkill since it's just for data frame pretty printing

# current verison
packageVersion("unsound")

Region codes

get_region_codes()

Full example (via the SO question(s))

# 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

Maps

get_sounding_map(
  station_number = "48657", 
  date = Sys.Date()-1, 
  map_type = "skewt", 
  map_format = "gif", 
  region = "seasia", 
  from_hr = "00", 
  to_hr = "00"
)


hrbrmstr/unsound documentation built on May 20, 2019, 5:42 p.m.