View source: R/read_point_obs.R
read_point_obs | R Documentation |
Data are read directly from OBSTABLE files with no modification except in the case of precipitation accumulations. Where possible, observations that are not available for the given accumulation time, they are derived from observations for other accumulation times, either by subtraction or addition.
read_point_obs(
dttm,
parameter,
obs_path = ".",
obsfile_template = "obstable",
gross_error_check = TRUE,
min_allowed = NULL,
max_allowed = NULL,
stations = NULL,
vertical_coordinate = c(NA_character_, "pressure", "model", "height"),
start_date = NULL,
end_date = NULL,
by = "1h"
)
A tibble with columns for valid_dttm, SID and the parameter.
if (requireNamespace("harpData", quietly = TRUE)) {
read_point_obs(
seq_dttm(2019021700, 2019022023),
"T2m",
obs_path = system.file("OBSTABLE", package = "harpData")
)
# stations can be specified using a vector of station ID numbers
read_point_obs(
seq_dttm(2019021700, 2019022023),
"T2m",
obs_path = system.file("OBSTABLE", package = "harpData"),
stations = c(1001, 1010)
)
# Gross error checks are done automatically but the allowable values
# can be changed with min_allowed and max_allowed.
obs <- read_point_obs(
seq_dttm(2019021700, 2019022023),
"T2m",
obs_path = system.file("OBSTABLE", package = "harpData"),
min_allowed = 260,
max_allowed = 280
)
# The removed observations are stored in the attribute "bad_obs"
attr(obs, "bad_obs")
# For vertical profiles, the vertical coordinate must be specified
read_point_obs(
seq_dttm(2019021700, 2019022023),
"Z",
obs_path = system.file("OBSTABLE", package = "harpData"),
vertical_coordinate = "pressure"
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.