Skip to content

Commit

Permalink
data(obs_10min): rm duplicates
Browse files Browse the repository at this point in the history
fixes  #5
  • Loading branch information
dimfalk committed Jul 4, 2024
1 parent 7c7cc35 commit 7d498e9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: HPBdata
Title: Meteorological observations at 'Hohenpeißenberg' site (Bavaria, Germany)
Version: 0.1.1
Date: 2024-06-24
Version: 0.1.2
Date: 2024-07-04
Authors@R:
person("Dimitri", "Falk", , "falk.dimitri@eglv.de", role = c("aut", "cre"))
Description: Historical quality-assured meteorological observation data at
Expand Down
4 changes: 2 additions & 2 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#' Data: 10-minutely meteorological observations for 02290 'Hohenpeißenberg' site (Bavaria, Germany)
#'
#' Historical observations of various parameters encompassing the period 1993-12-09 14:50 UTC to 2023-12-31 23:40 UTC \cr
#' Historical observations of various parameters encompassing the period 1993-12-09 13:50 UTC to 2023-12-31 23:40 UTC \cr
#' Y = 47.8009° N; X = 11.0108° E; Z = 977 m a.s.l. \cr \cr
#' <https://opendata.dwd.de/climate_environment/CDC/observations_germany/climate/10_minutes/air_temperature/meta_data/>
#'
Expand All @@ -34,7 +34,7 @@
#' \item{RWS_10}{xts object. Precipitation depth \code{[mm]}.}
#' }
#' @source <https://opendata.dwd.de/climate_environment/CDC/observations_germany/climate/10_minutes/air_temperature/historical/>
#' @note Last access: 2024-06-21
#' @note Last access: 2024-07-04
#' @description <https://opendata.dwd.de/climate_environment/CDC/observations_germany/climate/10_minutes/air_temperature/DESCRIPTION_obsgermany_climate_10min_air_temperature_en.pdf>
#' @note License: CC BY 4.0
#' @note Copyright: Deutscher Wetterdienst 2024
Expand Down
15 changes: 10 additions & 5 deletions data-raw/obs_10min.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## code to prepare `obs_10min` dataset goes here

library(timeseriesIO)
#> 0.7.80
#> 0.7.98

obs_10min <- list()

Expand All @@ -15,9 +15,10 @@ dirs <- c("air_temperature",
# get all available data for defined station
for (dir_i in dirs) {

station <- get_cdc_stations(res = "10_minutes",
par = dir_i,
q = "historical") |> dplyr::filter(stations_id == "02290")
station <- timeseriesIO::get_cdc_stations(res = "10_minutes",
par = dir_i,
q = "historical") |>
dplyr::filter(stations_id == "02290")

paste0("-------------------- ", dir_i, " --------------------") |> print()

Expand All @@ -27,7 +28,7 @@ for (dir_i in dirs) {

xtslist <- purrr::map(fnames, timeseriesIO::read_cdc_txt, station)

xtslist_merge <- timeseriesIO::xtslist_rbind_all(xtslist)
xtslist_merge <- timeseriesIO::xtslist_rbind_all(xtslist, tzone = "UTC")

obs_10min <- append(obs_10min, xtslist_merge)

Expand All @@ -42,6 +43,10 @@ obs_10min <- obs_10min[pars]
# shift reference timestamps to the left side of the interval
obs_10min <- purrr::map(obs_10min, timeseriesIO::idx_shift, side = "left")

# remove duplicated wind values due to overlap in time series
obs_10min[["FF_10"]] <- obs_10min[["FF_10"]] |> timeseriesIO::xts_rm_duplicated()
obs_10min[["DD_10"]] <- obs_10min[["DD_10"]] |> timeseriesIO::xts_rm_duplicated()

# subset to period
obs_10min <- timeseriesIO::xtslist_subset(obs_10min, "2020")

Expand Down
Binary file modified data/obs_10min.rda
Binary file not shown.
4 changes: 2 additions & 2 deletions man/obs_10min.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7d498e9

Please sign in to comment.