Type: Package
Title: Download and Process Oklahoma Mesonet Data
Version: 0.0.1
Date: 2025-07-24
Maintainer: Phillip D. Alderman <phillip.alderman@okstate.edu>
Description: A collection of functions to download and process weather data from the Oklahoma Mesonet https://mesonet.org. Functions are available for downloading station metadata, downloading Mesonet time series (MTS) files, importing MTS files into R, and converting soil temperature change measurements into soil matric potential and volumetric soil moisture.
License: GPL-2
Encoding: UTF-8
RoxygenNote: 7.3.2
Suggests: tinytest
Imports: methods, stats, units
Depends: R (≥ 4.2.0)
NeedsCompilation: no
Packaged: 2025-07-25 17:46:54 UTC; palderman
Author: Phillip D. Alderman [aut, cre]
Repository: CRAN
Date/Publication: 2025-07-28 19:00:02 UTC

Calculate soil matric potential for Oklahoma Mesonet data

Description

Calculate soil matric potential from delta-T soil temperature change data from the Oklahoma Mesonet using the equation from Zhang et al (2019) <doi:10.2136/sssaj2018.12.0481>: MP = 2083/(1+ exp(-3.35*(Tref-3.17))) where Tref is the measured delta-T data

Usage

mnet_calc_mp(data)

Arguments

data

a data frame that contains columns for delta-T temperature change data (i.e. TR05, TR25, TR60, TR75)

Value

a data frame containing new columns with matric potential (kPa) for each column of delta-T temperature change data.

Examples


mesonet_data <- data.frame(TR05 = 3.17, TR25 = 2.17, TR60 = 2.0, TR75 = 1.0)

mnet_calc_mp(mesonet_data)


Calculate soil volumteric water content for Oklahoma Mesonet data

Description

Calculate soil volumetric water content from delta-T soil temperature change data from the Oklahoma Mesonet using mnet_calc_mp to calculate matric potential and mnet_van_genuchten to calculate the corresponding volumetric water content using parameters provided by mnet_site_info.

Usage

mnet_calc_vwc(data, site_info = NULL)

Arguments

data

a data frame that contains a column of Mesonet station identifier codes (i.e. STID) and columns for delta-T temperature change data (i.e. TR05, TR25, TR60, TR75)

site_info

a data frame with site and soil information for each Oklahoma Mesonet station as returned by mnet_site_info. If NULL, mnet_site_info will be used to download this information internally

Value

a data frame containing new columns with volumetric water content for each column of delta-T temperature change data.

Examples




# Create example dataset
mesonet_data <- data.frame(STID = "ACME", DATE = as.POSIXct("2025-01-01"),
                           TR05 = 3.17, TR25 = 2.17, TR60 = 2.0, TR75 = 1.0)

mnet_calc_vwc(mesonet_data)




Concatenate subdaily Oklahoma Mesonet records for multiple dates or stations.

Description

Concatenate subdaily Oklahoma Mesonet records for multiple dates or stations.

Usage

mnet_concatenate(
  stid = NULL,
  start_date = NULL,
  end_date = NULL,
  site_info = NULL,
  file_cache = NULL
)

Arguments

stid

a character vector of four-digit station identifiers for the Mesonet stations from which to download data

start_date

the first date for which to download data specified in Central Standard Time (i.e. "America/Costa_Rica") zone as a Date or POSIXt object or a string with the format YYYY-MM-DD, where YYYY is the four-digit year, MM is the two-digit numeric month and DD is the two-digit day of month

end_date

the final date for which to download data specified in Central Standard Time (i.e. "America/Costa_Rica") zone as a Date or POSIXt object or a string with the format YYYY-MM-DD, where YYYY is the four-digit year, MM is the two-digit numeric month and DD is the two-digit day of month

site_info

a data frame with site and soil information for each Oklahoma Mesonet station as returned by mnet_site_info. If NULL, mnet_site_info will be used to download this information internally

file_cache

a character string providing a path to the local Mesonet file cache. If NULL, the function will search for the local file cache and if not found will prompt the user to create one.

Value

A data frame with Oklahoma Mesonet data. See below for a list of variables including column ID, name, unit and description:

ID Name Unit Description
PRES Station Atmospheric Pressure kPa 5-minute averaged atmospheric pressure.
RAIN Precipitation millimeters Liquid precipitation accumulation since previous 5-min record. Frozen precipitation cannot be recorded until it melts; therefore, precipitation from snow may not be recorded until several days after the snow event.
RELH Relative Humidity percent 5-minute averaged relative humidity at 1.5m.
SRAD Solar Radiation watts per square meter 5-minute averaged downwelling global solar radiation.
STID Station ID Station ID
STNM Station Number Station Number
TA9M Air Temperature at 9m degrees Celsius 5-minute averaged air temperature at 9m
TAIR Air Temperature degrees Celsius 5-minute averaged air temperature at 1.5m.
TB05 Temperature Under Bare Soil at 5cm degrees Celsius 15-minute averaged temperature under bare soil at 5cm. This variable is only available prior to December 1, 2013.
TB10 Temperature Under Bare Soil at 10cm degrees Celsius 15-minute averaged temperature under bare soil at 10cm.
TIME Time minutes after base time Minutes after base time (typically 0000 UTC)
TR05 Soil Moisture Calibrated Delta-T at 5cm degrees Celsius 30-minute calibrated change in temperature of soil over time after a heat pulse is introduced. Used to calculate soil water potential, fractional water index, or volumetric water.
TR25 Soil Moisture Calibrated Delta-T at 25cm degrees Celsius 30-minute calibrated change in temperature of soil over time after a heat pulse is introduced. Used to calculate soil water potential, fractional water index, or volumetric water.
TR60 Soil Moisture Calibrated Delta-T at 60cm degrees Celsius 30-minute calibrated change in temperature of soil over time after a heat pulse is introduced. Used to calculate soil water potential, fractional water index, or volumetric water.
TR75 Soil Moisture Calibrated Delta-T at 75cm degrees Celsius 30-minute calibrated change in temperature of soil over time after a heat pulse is introduced. Used to calculate soil water potential, fractional water index, or volumetric water.
TS05 Temperature Under Native Vegetation at 5cm degrees Celsius 15-minute averaged temperature under native vegetation at 5cm.
TS10 Temperature Under Native Vegetation at 10cm degrees Celsius 15-minute averaged temperature under native vegetation at 10cm.
TS25 Temperature Under Native Vegetation at 25cm degrees Celsius 15-minute averaged temperature under native vegetation at 25cm. This variable is only available after and including December 1, 2013.
TS30 Temperature Under Native Vegetation at 30cm degrees Celsius 15-minute averaged temperature under native vegetation at 30cm. This variable is only available prior to December 1, 2013.
TS45 Temperature Under Native Vegetation at 45cm degrees Celsius 15-minute averaged temperature under native vegetation at 45cm.
TS60 Temperature Under Native Vegetation at 60cm degrees Celsius 15-minute averaged temperature under native vegetation at 60cm. This variable is only available after and including December 1, 2013.
VW05 Volumetric soil water Under Native Vegetation at 5cm cm^3^ cm^-3^ 5-minute averaged volumetric soil water under native vegetation at 5cm.
VW25 Volumetric soil water Under Native Vegetation at 25cm cm^3^ cm^-3^ 5-minute averaged volumetric soil water under native vegetation at 25cm.
VW45 Volumetric soil water Under Native Vegetation at 45cm cm^3^ cm^-3^ 5-minute averaged volumetric soil water under native vegetation at 45cm.
WDIR Wind Direction degrees 5-minute averaged wind direction at 10m.
WDSD Wind Direction Standard Deviation degrees Standard deviation of wind direction during the 5-minute interval.
WMAX Maximum Wind Speed meters per second Highest 3-second wind speed at 10m sample.
WS2M 2m Wind Speed meters per second 5-minute averaged wind speed at 2m
WSPD Wind Speed meters per second 5-minute averaged wind speed at 10m.
WSSD Wind Speed Standard Deviation meters per second Standard deviation of wind speed during the 5-minute interval.
WVEC Wind Vector meters per second 5-minute averaged wind velocity (speed and direction accounted for) at 10m.

Examples




mnet_concatenate(stid = "ACME",
                 start_date = "1994-01-01",
                 end_date = "1994-01-05")




Download Mesonet Time Series files

Description

Downloads Mesonet Time Series (MTS) files from the Oklahoma Mesonet for a given set of station identifiers and date range

Usage

mnet_download_mts(
  stid,
  start_date = NULL,
  end_date = NULL,
  root_url = mnet_root_url(),
  site_info = NULL,
  file_cache = NULL,
  ask = !silent,
  silent = FALSE
)

Arguments

stid

a character vector of four-digit station identifiers for the Mesonet stations from which to download data

start_date

the first date for which to download data specified in Central Standard Time (i.e. "America/Costa_Rica") zone as a Date or POSIXt object or a string with the format YYYY-MM-DD, where YYYY is the four-digit year, MM is the two-digit numeric month and DD is the two-digit day of month

end_date

the final date for which to download data specified in Central Standard Time (i.e. "America/Costa_Rica") zone as a Date or POSIXt object or a string with the format YYYY-MM-DD, where YYYY is the four-digit year, MM is the two-digit numeric month and DD is the two-digit day of month

root_url

the root url from which to download MTS files (see mnet_root_url)

site_info

a data frame with site and soil information for each Oklahoma Mesonet station as returned by mnet_site_info. If NULL, mnet_site_info will be used to download this information internally

file_cache

a character string providing a path to the local Mesonet file cache. If NULL, the function will search for the local file cache and if not found will prompt the user to create one.

ask

whether or not to ask about creating a local Mesonet file cache

silent

whether to suppress output to terminal (TRUE) or allow output to terminal (FALSE)

Value

invisibly returns a character vector of the URLs for the downloaded files

Examples



mnet_download_mts("ACME",
                  start_date = "1994-01-01",
                  end_date = "1994-01-05")



Drop units from all columns of Oklahoma Mesonet data frame

Description

Drop units from all columns of Oklahoma Mesonet data frame

Usage

mnet_drop_units(df)

Arguments

df

a data frame with units columns

Value

A data frame with identical data, but without units

Examples


mesonet_data <- data.frame(
    DATE = as.POSIXct(757382400, tz = "UTC")) |>
  within({
  RELH = units::set_units(31, "percent")
  TAIR = units::set_units(NA_real_, "Celsius")
  WSPD = units::set_units(4.6, "m/s")
  WVEC = units::set_units(4.5, "m/s")
  WDIR = units::set_units(182, "degrees")
  RAIN = units::set_units(0, "mm")
  PRES = units::set_units(97.939, "kPa")
  SRAD = units::set_units(0, "W/m^2")
  TA9M = units::set_units(14.1, "Celsius")
  WS2M = units::set_units(4, "m/s")
  STID = "ACME"
 })

mnet_drop_units(mesonet_data)


Read an Oklahoma Mesonet time series file

Description

Read an Oklahoma Mesonet time series file

Usage

mnet_read_mts(file_path)

Arguments

file_path

file path to a single Oklahoma Mesonet time series (MTS) file

Value

A data frame with Oklahoma Mesonet data. See mnet_variable_definition() or the table below for the ID, variable name, unit and description for each column.

ID Name Unit Description
PRES Station Atmospheric Pressure kPa 5-minute averaged atmospheric pressure.
RAIN Precipitation millimeters Liquid precipitation accumulation since 0000 UTC. Frozen precipitation cannot be recorded until it melts; therefore, precipitation from snow may not be recorded until several days after the snow event.
RELH Relative Humidity percent 5-minute averaged relative humidity at 1.5m.
SRAD Solar Radiation watts per square meter 5-minute averaged downwelling global solar radiation.
STID Station ID Station ID
STNM Station Number Station Number
TA9M Air Temperature at 9m degrees Celsius 5-minute averaged air temperature at 9m
TAIR Air Temperature degrees Celsius 5-minute averaged air temperature at 1.5m.
TB05 Temperature Under Bare Soil at 5cm degrees Celsius 15-minute averaged temperature under bare soil at 5cm. This variable is only available prior to December 1, 2013.
TB10 Temperature Under Bare Soil at 10cm degrees Celsius 15-minute averaged temperature under bare soil at 10cm.
TIME Time minutes after base time Minutes after base time (typically 0000 UTC)
TR05 Soil Moisture Calibrated Delta-T at 5cm degrees Celsius 30-minute calibrated change in temperature of soil over time after a heat pulse is introduced. Used to calculate soil water potential, fractional water index, or volumetric water.
TR25 Soil Moisture Calibrated Delta-T at 25cm degrees Celsius 30-minute calibrated change in temperature of soil over time after a heat pulse is introduced. Used to calculate soil water potential, fractional water index, or volumetric water.
TR60 Soil Moisture Calibrated Delta-T at 60cm degrees Celsius 30-minute calibrated change in temperature of soil over time after a heat pulse is introduced. Used to calculate soil water potential, fractional water index, or volumetric water.
TR75 Soil Moisture Calibrated Delta-T at 75cm degrees Celsius 30-minute calibrated change in temperature of soil over time after a heat pulse is introduced. Used to calculate soil water potential, fractional water index, or volumetric water.
TS05 Temperature Under Native Vegetation at 5cm degrees Celsius 15-minute averaged temperature under native vegetation at 5cm.
TS10 Temperature Under Native Vegetation at 10cm degrees Celsius 15-minute averaged temperature under native vegetation at 10cm.
TS25 Temperature Under Native Vegetation at 25cm degrees Celsius 15-minute averaged temperature under native vegetation at 25cm. This variable is only available after and including December 1, 2013.
TS30 Temperature Under Native Vegetation at 30cm degrees Celsius 15-minute averaged temperature under native vegetation at 30cm. This variable is only available prior to December 1, 2013.
TS45 Temperature Under Native Vegetation at 45cm degrees Celsius 15-minute averaged temperature under native vegetation at 45cm.
TS60 Temperature Under Native Vegetation at 60cm degrees Celsius 15-minute averaged temperature under native vegetation at 60cm. This variable is only available after and including December 1, 2013.
VW05 Volumetric soil water Under Native Vegetation at 5cm cm^3^ cm^-3^ 5-minute averaged volumetric soil water under native vegetation at 5cm.
VW25 Volumetric soil water Under Native Vegetation at 25cm cm^3^ cm^-3^ 5-minute averaged volumetric soil water under native vegetation at 25cm.
VW45 Volumetric soil water Under Native Vegetation at 45cm cm^3^ cm^-3^ 5-minute averaged volumetric soil water under native vegetation at 45cm.
WDIR Wind Direction degrees 5-minute averaged wind direction at 10m.
WDSD Wind Direction Standard Deviation degrees Standard deviation of wind direction during the 5-minute interval.
WMAX Maximum Wind Speed meters per second Highest 3-second wind speed at 10m sample.
WS2M 2m Wind Speed meters per second 5-minute averaged wind speed at 2m
WSPD Wind Speed meters per second 5-minute averaged wind speed at 10m.
WSSD Wind Speed Standard Deviation meters per second Standard deviation of wind speed during the 5-minute interval.
WVEC Wind Vector meters per second 5-minute averaged wind velocity (speed and direction accounted for) at 10m.

Examples


# Create example file cache
local_cache <- mnet_test_cache(mts_files = TRUE)

example_file <- file.path(local_cache, "mts/1994/01/01/19940101acme.mts")

# Read data from example file
mnet_read_mts(example_file)

# Clean up example file cache
unlink(local_cache, recursive = TRUE)


Calculate a requisition list for Oklahoma Mesonet MTS files

Description

Calculate a requisition list of Mesonet Time Series (MTS) files from the Oklahoma Mesonet for given stations and dates

Usage

mnet_requisition_list(
  stid = NULL,
  start_date = NULL,
  end_date = NULL,
  site_info = NULL,
  file_cache = NULL,
  ask = TRUE
)

Arguments

stid

a character vector of four-digit station identifiers for the Mesonet stations from which to download data

start_date

the first date for which to download data specified in Central Standard Time (i.e. "America/Costa_Rica") zone as a Date or POSIXt object or a string with the format YYYY-MM-DD, where YYYY is the four-digit year, MM is the two-digit numeric month and DD is the two-digit day of month

end_date

the final date for which to download data specified in Central Standard Time (i.e. "America/Costa_Rica") zone as a Date or POSIXt object or a string with the format YYYY-MM-DD, where YYYY is the four-digit year, MM is the two-digit numeric month and DD is the two-digit day of month

site_info

a data frame with site and soil information for each Oklahoma Mesonet station as returned by mnet_site_info. If NULL, mnet_site_info will be used to download this information internally

file_cache

a character string providing a path to the local Mesonet file cache. If NULL, the function will search for the local file cache and if not found will prompt the user to create one.

ask

whether or not to ask about creating a local Mesonet file cache

Value

a data frame containing paths for the MTS files required for the requested stations and dates

Examples




mnet_requisition_list("ACME",
                      start_date = "1994-01-01",
                      end_date = "1994-01-05")




Retrieve Oklahoma Mesonet subdaily data

Description

Retrieves data from the Oklahoma Mesonet for a given set of station identifiers and date range

Usage

mnet_retrieve(
  stid,
  start_date = NULL,
  end_date = NULL,
  root_url = mnet_root_url(),
  site_info = NULL,
  file_cache = NULL,
  ask = !silent,
  silent = FALSE
)

Arguments

stid

a character vector of four-digit station identifiers for the Mesonet stations from which to download data

start_date

the first date for which to download data specified in Central Standard Time (i.e. "America/Costa_Rica") zone as a Date or POSIXt object or a string with the format YYYY-MM-DD, where YYYY is the four-digit year, MM is the two-digit numeric month and DD is the two-digit day of month

end_date

the final date for which to download data specified in Central Standard Time (i.e. "America/Costa_Rica") zone as a Date or POSIXt object or a string with the format YYYY-MM-DD, where YYYY is the four-digit year, MM is the two-digit numeric month and DD is the two-digit day of month

root_url

the root url from which to download MTS files (see mnet_root_url)

site_info

a data frame with site and soil information for each Oklahoma Mesonet station as returned by mnet_site_info. If NULL, mnet_site_info will be used to download this information internally

file_cache

a character string providing a path to the local Mesonet file cache. If NULL, the function will search for the local file cache and if not found will prompt the user to create one.

ask

whether or not to ask about creating a local Mesonet file cache

silent

whether to suppress output to terminal (TRUE) or allow output to terminal (FALSE)

Value

A data frame with Oklahoma Mesonet data. See below for a list of variables including column ID, name, unit and description:

ID Name Unit Description
PRES Station Atmospheric Pressure kPa 5-minute averaged atmospheric pressure.
RAIN Precipitation millimeters Liquid precipitation accumulation since previous 5-min record. Frozen precipitation cannot be recorded until it melts; therefore, precipitation from snow may not be recorded until several days after the snow event.
RELH Relative Humidity percent 5-minute averaged relative humidity at 1.5m.
SRAD Solar Radiation watts per square meter 5-minute averaged downwelling global solar radiation.
STID Station ID Station ID
STNM Station Number Station Number
TA9M Air Temperature at 9m degrees Celsius 5-minute averaged air temperature at 9m
TAIR Air Temperature degrees Celsius 5-minute averaged air temperature at 1.5m.
TB05 Temperature Under Bare Soil at 5cm degrees Celsius 15-minute averaged temperature under bare soil at 5cm. This variable is only available prior to December 1, 2013.
TB10 Temperature Under Bare Soil at 10cm degrees Celsius 15-minute averaged temperature under bare soil at 10cm.
TIME Time minutes after base time Minutes after base time (typically 0000 UTC)
TR05 Soil Moisture Calibrated Delta-T at 5cm degrees Celsius 30-minute calibrated change in temperature of soil over time after a heat pulse is introduced. Used to calculate soil water potential, fractional water index, or volumetric water.
TR25 Soil Moisture Calibrated Delta-T at 25cm degrees Celsius 30-minute calibrated change in temperature of soil over time after a heat pulse is introduced. Used to calculate soil water potential, fractional water index, or volumetric water.
TR60 Soil Moisture Calibrated Delta-T at 60cm degrees Celsius 30-minute calibrated change in temperature of soil over time after a heat pulse is introduced. Used to calculate soil water potential, fractional water index, or volumetric water.
TR75 Soil Moisture Calibrated Delta-T at 75cm degrees Celsius 30-minute calibrated change in temperature of soil over time after a heat pulse is introduced. Used to calculate soil water potential, fractional water index, or volumetric water.
TS05 Temperature Under Native Vegetation at 5cm degrees Celsius 15-minute averaged temperature under native vegetation at 5cm.
TS10 Temperature Under Native Vegetation at 10cm degrees Celsius 15-minute averaged temperature under native vegetation at 10cm.
TS25 Temperature Under Native Vegetation at 25cm degrees Celsius 15-minute averaged temperature under native vegetation at 25cm. This variable is only available after and including December 1, 2013.
TS30 Temperature Under Native Vegetation at 30cm degrees Celsius 15-minute averaged temperature under native vegetation at 30cm. This variable is only available prior to December 1, 2013.
TS45 Temperature Under Native Vegetation at 45cm degrees Celsius 15-minute averaged temperature under native vegetation at 45cm.
TS60 Temperature Under Native Vegetation at 60cm degrees Celsius 15-minute averaged temperature under native vegetation at 60cm. This variable is only available after and including December 1, 2013.
VW05 Volumetric soil water Under Native Vegetation at 5cm cm^3^ cm^-3^ 5-minute averaged volumetric soil water under native vegetation at 5cm.
VW25 Volumetric soil water Under Native Vegetation at 25cm cm^3^ cm^-3^ 5-minute averaged volumetric soil water under native vegetation at 25cm.
VW45 Volumetric soil water Under Native Vegetation at 45cm cm^3^ cm^-3^ 5-minute averaged volumetric soil water under native vegetation at 45cm.
WDIR Wind Direction degrees 5-minute averaged wind direction at 10m.
WDSD Wind Direction Standard Deviation degrees Standard deviation of wind direction during the 5-minute interval.
WMAX Maximum Wind Speed meters per second Highest 3-second wind speed at 10m sample.
WS2M 2m Wind Speed meters per second 5-minute averaged wind speed at 2m
WSPD Wind Speed meters per second 5-minute averaged wind speed at 10m.
WSSD Wind Speed Standard Deviation meters per second Standard deviation of wind speed during the 5-minute interval.
WVEC Wind Vector meters per second 5-minute averaged wind velocity (speed and direction accounted for) at 10m.

Examples




mnet_retrieve(stid = "ACME",
                 start_date = "1994-01-02",
                 end_date = "1994-01-03")




Root url for Oklahoma Mesonet Time Series files

Description

Root url for Oklahoma Mesonet Time Series files

Usage

mnet_root_url(data_source = "mesonet")

Arguments

data_source

the data source for which to provide the url: "mesonet" for the Oklahoma Mesonet, "fcars" for the USDA ARS station network in the Fort Cobb watershed, or "ars" for the USDA ARS station network in the Little Washita watershed

Value

a character string with the root URL for the desired Mesonet data source

Examples


mnet_root_url()

mnet_root_url("fcars")


Download Mesonet site and soil information for all Mesonet sites

Description

Downloads a table of Mesonet site and soil information from the Oklahoma Mesonet website.

Usage

mnet_site_info(
  url = "https://api.mesonet.org/index.php/export/station_location_soil_information",
  file_cache = NULL,
  clear_cache = FALSE
)

Arguments

url

the url to the page on the Oklahoma Mesonet website where site and soil information are stored

file_cache

a character string providing a path to the local Mesonet file cache. If NULL, the function will search for the local file cache and if not found will prompt the user to create one.

clear_cache

whether to clear cached copy of site and soil information and re-download

Details

Variable descriptions for Mesonet site and soil information.

Variable Description
stnm Station Number
stid Station Identifier
name Station Name
city Nearest Incorporated Town
rang Range From Town To Station
cdir Compass Direction From Town To Station
cnty County
nlat North Latitude
elon East Longitude
elev Elevation In Meters
cdiv Oklahoma Climate Division
clas Station Class
wcr05 5 cm Residual Water Content (cm3/cm3)
wcs05 5 cm Saturated Water Content (cm3/cm3)
a05 5 cm Alpha Constant (1/kPa)
n05 5 cm N Constant (dimensionless)
bulk5 5 cm Soil Bulk Density (g/cm3)
grav5 5 cm Soil Percentage Gravel
sand5 5 cm Soil Percentage Sand
silt5 5 cm Soil Percentage Silt
clay5 5 cm Soil Percentage Clay
text5 5 cm Soil Texture Class
wcr25 25 cm Residual Water Content (cm3/cm3)
wcs25 25 cm Saturated Water Content (cm3/cm3)
a25 25 cm Alpha Constant
n25 25 cm N Constant
bulk25 25 cm Soil Bulk Density
grav25 25 cm Soil Percentage Gravel
sand25 25 cm Soil Percentage Sand
silt25 25 cm Soil Percentage Silt
clay25 25 cm Soil Percentage Clay
text25 25 cm Soil Texture Class
wcr60 60 cm Residual Water Content (cm3/cm3)
wcs60 60 cm Saturated Water Content (cm3/cm3)
a60 60 cm Alpha Constant
n60 60 cm N Constant
bulk60 60 cm Soil Bulk Density
grab60 60 cm Soil Percentage Gravel
sand60 60 cm Soil Percentage Sand
silt60 60 cm Soil Percentage Silt
clay60 60 cm Soil Percentage Clay
text60 60 cm Soil Texture Class
wcr75 75 cm Residual Water Content (cm3/cm3)
wcs75 75 cm Saturated Water Content (cm3/cm3)
a75 75 cm Alpha Constant
n75 75 cm N Constant
bulk75 75 cm Soil Bulk Density
grav75 75 cm Soil Percentage Gravel
sand75 75 cm Soil Percentage Sand
silt75 75 cm Soil Percentage Silt
clay75 75 cm Soil Percentage Clay
text75 75 cm Soil Texture Class
datc Date Commissioned
datd Date De-Commissioned

Value

a data frame containing site and soil information. See Details for definition of variable descriptions.

Examples




mnet_site_info()




Produce a daily summary of Oklahoma Mesonet subdaily data

Description

Produce a daily summary of Oklahoma Mesonet subdaily data

Usage

mnet_summarize(
  sub_daily,
  tz = "Etc/GMT+6",
  interval = "1 day",
  include_qc_variables = FALSE
)

Arguments

sub_daily

a data frame with subdaily measurements from the Oklahoma Mesonet such as that produced by mnet_read_mts().

tz

a length-one character vector specifying which time zone to use for daily summary. Use base::OlsonNames() to obtain a listing of valid available time zones.

interval

the interval over which to summarize data. May be defined as a difftime object (see base::difftime()) or a character value compatible with units::as_units(). Tested intervals include "1 day" (the default), "30 min", and "1 hour", although other intervals may work (e.g. "3 hours").

include_qc_variables

a length-one logical vector specifying whether or or not to include quality control variables (e.g. number of errant observations) in the output

Value

A data frame with daily summaries of Oklahoma Mesonet data. See mnet_variable_definition() or the table below for the ID, variable name, unit and description for each column.

ID Variable Name Unit Description
2AVG Average Wind Speed at 2m meters per second Average of all 5-minute 2m wind speed observations each day.
2BAD Number of Errant 2m Wind Speed Observations number of 5-minute observations Number of errant 5-minute 2m wind speed observations each day.
2DEV Standard Deviation of Wind Speed at 2m meters per second Standard deviation of the wind speed at 2m during a 5-minute observation period.
2MAX Maximum 2m Wind Speed meters per second Highest 5-minute averaged 2m wind speed measurement each day.
2MIN Minimum 2m Wind Speed meters per second Lowest 5-minute averaged 2m wind speed measurement each day.
9AVG Average Air Temperature at 9m degrees Celsius Average of all 5-minute averaged 9-m air temperature observations each day.
9BAD Number of Errant 9m Air Temperature Observations number of 5-minute observations Number of errant 5-minute 9m air temperature observations each day.
ABAD Number of Errant Solar Radiation Observations number of 5-minute observations Number of errant 5-minute solar radiation observations each day.
AMAX Maximum Solar Radiation Watts per square meter Highest 5-minute averaged solar radiation measurement each day.
AMAXO Maximum Solar Radiation Observation Number 5-minute observation number Daily observation number that measured highest 5-minute averaged solar radiation value each day
ATOT Total Solar Radiation mega Joules per square meter Daily accumulation of solar radiation each day.
B5AV Average Temperature Under Bare Soil at 5cm degrees Celsius Average of all 15-minute averaged soil temperature observations each day.
B5BD Number of Errant Temperature Under Bare Soil at 5cm Observations number of 15-minute observations Number of errant 15-minute temperature under bare soil at 5cm observations each day. This variable is only available prior to December 1, 2013.
B5MN Minimum Temperature Under Bare Soil at 5cm degrees Celsius Lowest 15-minute averaged soil temperature observation each day. This variable is only available prior to December 1, 2013.
B5MNO Minimum Temperature Under Bare Soil at 5cm Observation Number 15-minute observation number Daily 15-minute observation number that measured minimum temperature under bare soil at 5cm each day. This variable is only available prior to December 1, 2013.
B5MX Maximum Temperature Bare Soil at 5cm degrees Celsius Highest 15-minute averaged soil temperature observation each day. This variable is only available prior to December 1, 2013.
B5MXO Maximum Temperature Under Bare Soil at 5cm Observation Number 15-minute observation number Daily 15-minute observation number that measured maximum temperature under bare soil at 5cm each day. This variable is only available prior to December 1, 2013.
BAVG Average Temperature Under Bare Soil at 10cm degrees Celsius Average of all 15-minute averaged soil temperature observations each day. This variable is only available prior to December 1, 2013.
BBAD Number of Errant Temperature Under Bare Soil at 10cm Observations number of 15-minute observations Number of errant 15-minute temperature under bare soil at 10cm observations each day.
BMAX Maximum Temperature Bare Soil at 10cm degrees Celsius Highest 15-minute averaged soil temperature observation each day.
BMAXO Maximum Temperature Under Bare Soil at 10cm Observation Number 15-minute observation number Daily 15-minute observation number that measured maximum temperature under bare soil at 10cm each day.
BMIN Minimum Temperature Under Native Vegetation at 10cm degrees Celsius Lowest 15-minute averaged soil temperature observation each day.
BMINO Minimum Temperature Under Bare Soil at 10cm Observation Number 15-minute observation number Daily 15-minute observation number that measured minimum temperature under bare soil at 10cm each day.
CDEG Cooling Degree Days degrees Celsius Number of degrees Celsius that the average daily air temperature is greater than 65 degrees Celsius .
DATE Date of summary in Central Standard Time
DAVG Average Dewpoint Temperature degrees Celsius Average of all 5-minute averaged dewpoint temperatures each day. Dewpoint temperature is derived from 1.5m air temperature and the corresponding humidity value.
DBAD Number of Errant Dewpoint Temperature Observations number of 5-minute observations Number of errant 5-minute dewpoint temperature observations each day.
DMAX Maximum Dewpoint Temperature degrees Celsius Highest 5-minute averaged dewpoint temperature each day. Dewpoint temperature is derived from 1.5m air temperature and the corresponding humidity value.
DMAXO Maximum Daily Dewpoint Temperature Observation Number 5-minute observation number Daily observation number that measured highest 5-minute averaged dewpoint temperature each day.
DMIN Minimum Dewpoint Temperature degrees Celsius Lowest 5-minute averaged dewpoint temperature each day. Dewpoint temperature is derived from 1.5m air temperature and the corresponding humidity value.
DMINO Minimum Daily Dewpoint Temperature Observation Number 5-minute observation number Daily observation number that measured lowest 5-minute averaged dewpoint temperature each day.
HAVG Average Humidity percent Average of all 5-minute averaged humidity observations each day.
HBAD Number of Errant Humidity Observations number of 5-minute observations Number of errant 5-minute humidity observations each day.
HDEG Heating Degree Days degrees Celsius Number of degrees Celsius that the average daily air temperature is less than 18.3 degrees Celsius.
HMAX Maximum Humidity percent Highest 5-minute averaged humidity observation reported each day.
HMAXO Maximum Daily Humidity Observation Number 5-minute observation number Daily observation number that measured highest 5-minute averaged humidity each day.
HMIN Minimum Humidity percent Lowest 5-minute averaged humidity observation reported each day.
HMINO Minimum Daily Humidity Observation Number 5-minute observation number Daily observation number that measured lowest 5-minute averaged humidity each day.
HTBAD Number of Errant Heat Index Observations number of 5-minute observations Number of errant 5-minute heat index observations each day.
HTMX Maximum Heat Index Temperature degrees Celsius Largest 5-minute averaged heat index observation each day. Derived using 5-minute averaged air temperature and corresponding 5-minute averaged humidity observation.
HTMXO Maximum Daily Heat Index Observation Number 5-minute observation number Daily observation number that measured highest 5-minute averaged heat index each day.
IBAD Number of Errant Wind Direction Observations number of 5-minute observations Number of errant 5-minute 10m wind direction observations each day.
MSLP Mean Sea Level Pressure inches of mercury Average of all 5-minute averaged station air pressure observations adjusted for station elevation each day.
PAVG Average Station Pressure inches of mercury Average of all 5-minute averaged station air pressure observations each day.
PBAD Number of Errant Station Pressure Observations number of 5-minute observations Number of errant 5-minute station pressure observations each day.
PDFQ Primary Wind Direction Frequency percentage Frequency of observations in the given wind direction category.
PDIR Primary Wind Direction 16-point cardinal direction Most common wind direction for the day based on 16-point compass heading (i.e., 0 is N; 1 is NNE; 15 is NNW).
PMAX Maximum Station Pressure inches of mercury Highest 5-minute averaged station air pressure observation each day.
PMAXO Maximum Daily Station Pressure Observation Number 5-minute observation number Daily observation number that measured highest 5-minute averaged station pressure each day.
PMIN Minimum Station Pressure inches of mercury Lowest 5-minute averaged station air pressure observation each day.
PMINO Minimum Daily Station Pressure Observation Number 5-minute observation number Daily observation number that measured lowest 5-minute averaged station pressure each day.
R05BD Number of Errant Soil Moisture Calibrated Delta-T at 5cm Observations number of 30-minute observations Number of errant 30-minute calibrated delta-t at 5cm observations.
R25BD Number of Errant Soil Moisture Calibrated Delta-T at 25cm Observations number of 30-minute observations Number of errant 30-minute calibrated delta-t at 25cm observations.
R60BD Number of Errant Soil Moisture Calibrated Delta-T at 60cm Observations number of 30-minute observations Number of errant 30-minute calibrated delta-t at 60cm observations.
R75BD Number of Errant Soil Moisture Calibrated Delta-T at 75cm Observations number of 30-minute observations *Decommissioned March 2012. Number of errant 30-minute calibrated delta-t at 75cm observations.
RAIN Rain inches Liquid precipitation measured each day. Frozen precipitation cannot be recorded until it melts; therefore, precipitation from snow may not be recorded until several days after the snow event.
RBAD Number of Errant 5-minute Rain Observations number of 5-minute observations Number of errant 5-minute rain observations each day.
RMAX Maximum 5-minute Rainfall Rate inches per hour Highest 5-minute averaged rainfall rate each day.
RNUM Number of 5-minute Rainy Periods number of 5-minute observations Number of 5-minute observations in which precipitation increased. Frozen precipitation cannot be recorded until it melts; therefore precipitation from snow may not be recorded until several days after the snow event.
S25AV Average Temperature Under Native Vegetation at 25cm degrees Celsius Average of all 15-minute averaged soil temperature observations each day. This variable is only available after and including December 1, 2013.
S25BD Number of Errant Temperature Under Native Vegetation at 25cm Observations number of 15-minute observations Number of errant 15-minute temperature under native vegetation at 25cm observations each day. This variable is only available after and including December 1, 2013.
S25MN Minimum Temperature Under Native Vegetation at 25cm degrees Celsius Lowest 15-minute averaged soil temperature observation each day. This variable is only available after and including December 1, 2013.
S25MX Maximum Temperature Under Native Vegetation at 25cm degrees Celsius Highest 15-minute averaged soil temperature observation each day. This variable is only available after and including December 1, 2013.
S25NO Minimum Temperature Under Native Vegetation at 25cm Observation Number 15-minute observation number Daily 15-minute observation number that measured minimum temperature under native vegetation at 25cm each day. This variable is only available after and including December 1, 2013.
S25XO Maximum Temperature Under Native Vegetation at 25cm Observation Number 15-minute observation number Daily 15-minute observation number that measured maximum temperature under native vegetation at 25cm each day. This variable is only available after and including December 1, 2013.
S3AV Average Temperature Under Native Vegetation at 30cm degrees Celsius Average of all 15-minute averaged soil temperature observations each day. This variable is only available prior to December 1, 2013.
S3BD Number of Errant Temperature Under Native Vegetation at 30cm Observations number of 15-minute observations Number of errant 15-minute temperature under native vegetation at 30cm observations each day. This variable is only available prior to December 1, 2013.
S3MN Minimum Temperature Under Native Vegetation at 30cm degrees Celsius Lowest 15-minute averaged soil temperature observation each day. This variable is only available prior to December 1, 2013.
S3MNO Minimum Temperature Under Native Vegetation at 30cm Observation Number 15-minute observation number Daily 15-minute observation number that measured minimum temperature under native vegetation at 30cm each day. This variable is only available prior to December 1, 2013.
S3MX Maximum Temperature Under Native Vegetation at 30cm degrees Celsius Highest 15-minute averaged soil temperature observation each day. This variable is only available prior to December 1, 2013.
S3MXO Maximum Temperature Under Native Vegetation at 30cm Observation Number 15-minute observation number Daily 15-minute observation number that measured maximum temperature under native vegetation at 30cm each day. This variable is only available prior to December 1, 2013.
S5AV Average Temperature Under Native Vegetation at 5cm degrees Celsius Average of all 15-minute averaged soil temperature observations each day.
S5BD Number of Errant Temperature Under Native Vegetation at 5cm Observations number of 15-minute observations Number of errant 15-minute temperature under native vegetation at 5cm observations each day.
S5MN Minimum Temperature Under Native Vegetation at 5cm degrees Celsius Lowest 15-minute averaged soil temperature observation each day.
S5MNO Minimum Temperature Under Native Vegetation at 5cm Observation Number 15-minute observation number Daily 15-minute observation number that measured minimum temperature under native vegetation at 5cm each day.
S5MX Maximum Temperature Under Native Vegetation at 5cm degrees Celsius Highest 15-minute averaged soil temperature observation each day.
S5MXO Maximum Temperature Under Native Vegetation at 5cm Observation Number 15-minute observation number Daily 15-minute observation number that measured maximum temperature under native vegetation at 5cm each day.
S60AV Average Temperature Under Native Vegetation at 60cm degrees Celsius Average of all 15-minute averaged soil temperature observations each day. This variable is only available after and including December 1, 2013.
S60BD Number of Errant Temperature Under Native Vegetation at 60cm Observations number of 15-minute observations Number of errant 15-minute temperature under native vegetation at 60cm observations each day. This variable is only available after and including December 1, 2013.
S60MN Minimum Temperature Under Native Vegetation at 60cm degrees Celsius Lowest 15-minute averaged soil temperature observation each day. This variable is only available after and including December 1, 2013.
S60MX Maximum Temperature Under Native Vegetation at 60cm degrees Celsius Highest 15-minute averaged soil temperature observation each day. This variable is only available after and including December 1, 2013.
S60NO Minimum Temperature Under Native Vegetation at 60cm Observation Number 15-minute observation number Daily 15-minute observation number that measured minimum temperature under native vegetation at 60cm each day. This variable is only available after and including December 1, 2013.
S60XO Maximum Temperature Under Native Vegetation at 60cm Observation Number 15-minute observation number Daily 15-minute observation number that measured maximum temperature under native vegetation at 60cm each day. This variable is only available after and including December 1, 2013.
SAVG Average Temperature Under Native Vegetation at 10cm degrees Celsius Average of all 15-minute averaged soil temperature observations each day.
SBAD Number of Errant Temperature Under Native Vegetation at 10cm Observations number of 15-minute observations Number of errant 15-minute temperature under native vegetation at 10cm observations each day.
SDFQ Secondary Wind Direction Frequency percentage Frequency of observations in the given wind direction category.
SDIR Secondary Wind Direction 16-point cardinal direction Second most common wind direction for the day based on 16-point compass heading.
SMAX Maximum Temperature Under Native Vegetation at 10cm degrees Celsius Highest 15-minute averaged soil temperature observation each day.
SMAXO Maximum Temperature Under Native Vegetation at 10cm Observation Number 15-minute observation number Daily 15-minute observation number that measured maximum temperature under native vegetation at 10cm each day.
SMIN Minimum Temperature Under Native Vegetation at 10cm degrees Celsius Lowest 15-minute averaged soil temperature observation each day.
SMINO Minimum Temperature Under Native Vegetation at 10cm Observation Number 15-minute observation number Daily 15-minute observation number that measured minimum temperature under native vegetation at 10cm each day.
STID Station ID Station ID
TAVG Average Air Temperature degrees Celsius Average of all 5-minute averaged temperature observations each day.
TBAD Number of Errant 1.5m Air Temperature Observations number of 5-minute observations Number of errant 5-minute averaged 1.5m air temperature observations each day.
TMAX Maximum Daily Air Temperature degrees Celsius Highest 5-minute averaged temperature observation reported each day.
TMAXO Maximum Daily Air Temperature Observation Number 5-minute observation number Daily observation number that measured highest 5-minute averaged 1.5 m air temperature each day.
TMIN Minimum Daily Air Temperature degrees Celsius Lowest 5-minute averaged temperature observation reported each day.
TMINO Minimum Daily Air Temperature Observation Number 5-minute observation number Daily observation number that measured lowest 5-minute averaged 1.5 m air temperature each day.
TR05 Soil Moisture Calibrated Delta-T at 5cm degrees Celsius Calibrated change in temperature of soil over time after a heat pulse is introduced. Used to calculate soil water potential, fractional water index, or volumetric water.
TR25 Soil Moisture Calibrated Delta-T at 25cm degrees Celsius Calibrated change in temperature of soil over time after a heat pulse is introduced. Used to calculate soil water potential, fractional water index, or volumetric water.
TR60 Soil Moisture Calibrated Delta-T at 60cm degrees Celsius Calibrated change in temperature of soil over time after a heat pulse is introduced. Used to calculate soil water potential, fractional water index, or volumetric water.
TR75 Soil Moisture Calibrated Delta-T at 75cm degrees Celsius *Decommissioned March 2012. Calibrated change in temperature of soil over time after a heat pulse is introduced. Used to calculate soil water potential, fractional water index, or volumetric water.
VDEF Average Daily Vapor Deficit millibars Average of all 5-minute averaged vapor deficit estimates each day.
WBAD Number of Errant Wind Speed Observations number of 5-minute observations Number of errant 5-minute 10m wind speed observations each day.
WCBAD Number of Errant Wind Chill Observations number of 5-minute observations Number of errant 5-minute wind chill observations each day.
WCMN Minimum Wind Chill Index Temperature degrees Celsius Lowest 5-minute averaged wind chill observation each day. Derived using 5-minute averaged air temperature and corresponding 5-minute averaged 10-m wind speed observation.
WCMNO Minimum Daily Wind Chill Observation Number 5-minute observation number Daily observation number that measured lowest 5-minute averaged wind chill each day.
WDEV Standard Deviation of Wind Speed at 10m meters per second Standard deviation of the wind speed at 10m during a 5-minute observation period.
WMAX Maximum Wind Gust meters per second Highest 3-second wind speed measurement each day.
WMAXO Maximum Wind Gust Observation Number 5-minute observation number Daily 5-minute observation number that measured maximum wind gust each day.
WSMN Minimum Wind Speed meters per second Lowest 5-minute averaged 10m wind speed measurement each day.
WSMNO Minimum Wind Speed Observation Number 5-minute observation number Daily 5-minute observation number that measured minimum wind speed at 10m each day.
WSMX Maximum Wind Speed meters per second Highest 5-minute averaged 10m wind speed measurement each day.
WSMXO Maximum Wind Speed Observation Number 5-minute observation number Daily 5-minute observation number that measured maximum wind speed at 10m each day.
WSPD Average Wind Speed meters per second Average of all 5-minute wind speed observations each day.

Examples




# Retrieve some data to summarize:
mesonet_data <- mnet_retrieve(stid = "ACME",
                              start_date = "1994-01-02",
                              end_date = "1994-01-03")

# Interval is 1 day by default:
mnet_summarize(mesonet_data)

# Summarize to hourly:
mnet_summarize(mesonet_data,
               interval = "1 hour")




Create example local mesonet file cache

Description

Create an example local mesonet file cache for running tests and examples

Usage

mnet_test_cache(
  file_cache,
  site_info = FALSE,
  mts_files = FALSE,
  rds_files = FALSE
)

Arguments

file_cache

an optional character string that provides a path to the directory to use for the local mesonet file cache. If missing, a new directory will be created within the temporary directory for the current session.

site_info

a logical value indicating whether to create an example version of the site_info.csv file in the local file cache

mts_files

a logical value indicating whether to create example versions of Mesonet Time Series (MTS) files in the local file cache

rds_files

a logical value indicating whether to create example versions of processed Mesonet data in the form of R data serialized (RDS) files in the local file cache

Value

Invisibly returns the full path to the test file cache

Examples


# Create test cache directory and write site info file
test_cache <- mnet_test_cache(site_info = TRUE)

# Create test cache directory and write MTS and RDS files
test_cache <- mnet_test_cache(mts_files = TRUE,
                              rds_files = TRUE)

# Remove test cache directory
unlink(test_cache, recursive = TRUE)


Calculate volumetric soil water content with van Genuchten curve

Description

Calculate volumetric soil water content using the van Genuchten curve

Usage

mnet_van_genuchten(MP, WCr, WCs, a, n)

Arguments

MP

a vector of matric potential at which to calculate volumetric soil water content

WCr

residual water content for dry soil

WCs

saturated water content for wet soil

a

the alpha parameter for the van Genuchten equation related to the inverse of the air entry suction

n

the n parameter for the van Genuchten equation related to the pore-size distribution

Value

a vector of volumetric soil water content values

Examples


mnet_van_genuchten(-100, 0.034, 0.41, 0.273, 1.39)


Find Mesonet variable definition

Description

Provide definition of a requested set of Mesonet variables including (by default) the standard variable identifier (ID), name, unit, and description.

Usage

mnet_variable_definition(
  id,
  columns = c("ID", "Variable Name", "Unit", "Description")
)

Arguments

id

a string or regular expression to use for retrieving definitions of Mesonet variables

columns

a character vector of columns to include in the output. Possible values include any combination of "ID", "Variable Name", "Unit" or "Description"

Value

a data frame with Mesonet variable definitions filtered by the id argument

Examples


mnet_variable_definition("RAIN")

mnet_variable_definition("^2")

mnet_variable_definition("^2",
                         columns = c("ID", "Variable Name", "Unit"))