High frequency climatological data in Oklahoma, USA.

okmesonet

is a simple R package that retrieves and summarizes climatological data from the Oklahoma Mesonet. The Oklahoma Mesonet is a network of automated climate monitoring stations. Data collection began on January 01, 1994, and as of April 2012 there are 120 active stations. Measurements are recorded every five minutes, sent to the Oklahoma Climatological Survey for verification and quality control, and posted online for near real-time availability.

Source code and bug reports are on github.

Oklahoma Mesonet Stations

Installation

Version 0.1.5 is on CRAN

install.packages(“okmesonet”, dependencies=T)

Functions

okmts

is the primary function, retrieving and parsing Oklahoma Mesonet time series (MTS) files for a given station and time period. Alternatively, if latitude and longitude are provided, the closest operating station during the given time period is used.

Retrieve data for the Foraker station at The Nature Conservancy Tallgrass Prairie Preserve during the 2011 blizzard:

library(okmesonet)

fora.mts <- okmts(begintime=”2011-01-31 00:00:00”, endtime=”2011-02-05 23:55:00”, station=”fora”)

?okmts #for more information

avgokmts

summarizes MTS data by hour, day, month, or year.

Daily temperature during the blustery storm:

fora.mts.avg <- avgokmts(fora.mts, by=”day”)

?avgokmts #for more information

Example plot

Use ggplot2 and reshape to plot temperature observations and daily averages acquired above:

library(reshape)

library(ggplot2)

fora.mts.avg$TIME <- as.POSIXct(paste(fora.mts.avg$YEAR, fora.mts.avg$MONTH, fora.mts.avg$DAY, “12”, sep=””), format=”%Y%m%d%H”, tz=”America/Chicago”)

fora.tair <- melt(list(fora.mts=fora.mts, fora.mts.avg=fora.mts.avg), id.vars=”TIME”, measure.vars=”TAIR”, variable_name=”TAIR”)

ggplot(data=fora.tair, aes(TIME, value, color=L1)) + geom_point(size=2.25) + scale_x_datetime(breaks=”1 day”, “Date”) + scale_y_continuous(name=”TAIR”) + scale_color_manual(values=c(“red”,”blue”), name=”FORA temperature”, labels=c(“Observation”, “Daily avg”)) + opts(legend.text = theme_text(size = 14), legend.title=theme_text(size=14))

FORA temperature

Resources

Oklahoma Mesonet variables and units are described within the MDF/MTS Files webpage.

Data policy

Data access may be restricted by organization or location. Please refer to and follow policies found in the Oklahoma Mesonet Data Access Policy. The authors and maintainers of okmesonet assume no responsibility for the use or misuse of okmesonet.