Open wseis opened 3 months ago
Thanks @wseis for pointing this out. If you provide the parameter include_raw_time = TRUE
, the columns timestamp_raw
and timestamp_corr
both show 00:00
. As all datetime
values of Wasserportal Berlin are provided in CET (see Zeitangaben
https://wasserportal.berlin.de/erlaeuterungen.php), this leads to this offset during CEST season. So I don't know if filtering afterwards is sufficient (see below) or should this be solved directly within wasserportal::read_wasserportal()
@hsonne ?
remotes::install_github("kwb-r/wasserportal")
#> Using github PAT from envvar GITHUB_PAT. Use `gitcreds::gitcreds_set()` and unset GITHUB_PAT in .Renviron (or elsewhere) if you want to use the more secure git credential store instead.
#> Skipping install of 'wasserportal' from a github remote, the SHA1 (40777f16) has not changed since last install.
#> Use `force = TRUE` to force installation
# Reading stations from Wasserportal
stations <- wasserportal::get_stations()
#> Importing 10 station overviews from Wasserportal Berlin ... ok. (4.34 secs)
# Assigning crosstab variable
crosstab <- stations$crosstable
# Defining today
today <- Sys.Date()
# requesting data from Wasserportal
request <- wasserportal::read_wasserportal( station = "5803200",
variables = "odf",
from_date = today,
type = "single",
include_raw_time = TRUE,
stations_crosstable = crosstab)
#> Reading 'variable_odf' for station 5803200 (station_5803200) ... ok. (1.12 secs)
knitr::kable(request[1:5,])
timestamp_raw | timestamp_corr | LocalDateTime | UTCOffset | surface_water.flow |
---|---|---|---|---|
04.06.2024 00:00 | 04.06.2024 00:00 | 2024-06-04 01:00:00 | 2 | 13.3 |
04.06.2024 00:15 | 04.06.2024 00:15 | 2024-06-04 01:15:00 | 2 | 13.9 |
04.06.2024 00:30 | 04.06.2024 00:30 | 2024-06-04 01:30:00 | 2 | -777.0 |
04.06.2024 00:45 | 04.06.2024 00:45 | 2024-06-04 01:45:00 | 2 | -777.0 |
04.06.2024 01:00 | 04.06.2024 01:00 | 2024-06-04 02:00:00 | 2 | -777.0 |
request_today <- wasserportal::read_wasserportal( station = "5803200",
variables = "odf",
from_date = today - 1,
type = "single",
include_raw_time = TRUE,
stations_crosstable = crosstab)
#> Reading 'variable_odf' for station 5803200 (station_5803200) ... ok. (0.13 secs)
request_today <- dplyr::filter(request_today,
LocalDateTime >= lubridate::as_datetime(today, tz = "CET"))
knitr::kable(request_today[1:5,])
timestamp_raw | timestamp_corr | LocalDateTime | UTCOffset | surface_water.flow |
---|---|---|---|---|
03.06.2024 23:00 | 03.06.2024 23:00 | 2024-06-04 00:00:00 | 2 | 14.2 |
03.06.2024 23:15 | 03.06.2024 23:15 | 2024-06-04 00:15:00 | 2 | 13.3 |
03.06.2024 23:30 | 03.06.2024 23:30 | 2024-06-04 00:30:00 | 2 | 12.8 |
03.06.2024 23:45 | 03.06.2024 23:45 | 2024-06-04 00:45:00 | 2 | 13.0 |
04.06.2024 00:00 | 04.06.2024 00:00 | 2024-06-04 01:00:00 | 2 | 13.3 |
Created on 2024-06-04 with reprex v2.1.0
within
read_wasserportal()
. When I want to get single values from yesterday, I write:`
` The resulting data start at 01:00 and increase by steps of 15 min. However, it should start at 00:00.