luftlyr_get.R 1.87 KB
Newer Older
1
#' luftlyr_get_data
2

3
#' luftlyr_get_data
4
#' @param x request object
Jean-Marie Lepioufle's avatar
Jean-Marie Lepioufle committed
5
6
#' @param username username
#' @param password password
7
8
9
10
#' @keywords luftlyr
#' @export
#' @examples
#' \dontrun{
11
#' luftlyr_get_data()
12
#' }
Jean-Marie Lepioufle's avatar
Jean-Marie Lepioufle committed
13
luftlyr_get_data <- function(x,username,password) {
jml's avatar
jml committed
14
15
  fromDateTime <- as.character(x$timeObj$fromDateTime()+3600) #UTC+1, no summer time
  toDateTime <- as.character(x$timeObj$toDateTime()+3600) #UTC+1, no summer time
Jean-Marie Lepioufle's avatar
Jean-Marie Lepioufle committed
16

jml's avatar
jml committed
17
18
19
  res <- luftkvalr::luft_data(stationIDs=x$stationObj$station_id,west=x$stationObj$west,south=x$stationObj$south,east=x$stationObj$east,north=x$stationObj$north,
                   componentName=x$elementObj$element_id,fromDateTime,toDateTime,username,password)
  return(res)
Jean-Marie Lepioufle's avatar
Jean-Marie Lepioufle committed
20
}
Jean-Marie Lepioufle's avatar
Jean-Marie Lepioufle committed
21

22
23
24
25
26
27
28
29
30
31
32
33
34
35
#' luftlyr_get_qa

#' luftlyr_get_qa
#' @param x request object
#' @param username username
#' @param password password
#' @keywords luftlyr
#' @export
#' @examples
#' \dontrun{
#' luftlyr_get_qa()
#' }
luftlyr_get_qa <- function(x,username,password) {

jml's avatar
jml committed
36
37
38
39
40
41
  fromDateTime <- as.character(x$timeObj$fromDateTime()+3600) #UTC+1, no summer time
  toDateTime <- as.character(x$timeObj$toDateTime()+3600) #UTC+1, no summer time

  res <- luftkvalr::luft_qa(stationIDs=x$stationObj$station_id,west=x$stationObj$west,south=x$stationObj$south,east=x$stationObj$east,north=x$stationObj$north,
                   componentName=x$elementObj$element_id,fromDateTime,toDateTime,username,password)
  return(res)
42
43
}

44
#' luftlyr_get_meta
Jean-Marie Lepioufle's avatar
Jean-Marie Lepioufle committed
45
46
47

#' luftlyr_getmeta
#' @param x request object
Jean-Marie Lepioufle's avatar
Jean-Marie Lepioufle committed
48
49
#' @param username username
#' @param password password
Jean-Marie Lepioufle's avatar
Jean-Marie Lepioufle committed
50
51
52
53
#' @keywords luftlyr
#' @export
#' @examples
#' \dontrun{
54
#' luftlyr_get_meta()
Jean-Marie Lepioufle's avatar
Jean-Marie Lepioufle committed
55
#' }
Jean-Marie Lepioufle's avatar
Jean-Marie Lepioufle committed
56
luftlyr_get_meta <- function(x,username,password) {
jml's avatar
jml committed
57
58
59
  res <- luftkvalr::luft_meta(stationIDs=x$stationObj$station_id,west=x$stationObj$west,south=x$stationObj$south,east=x$stationObj$east,north=x$stationObj$north,
                   componentName=x$elementObj$element_id,username,password)
  return(res)
Jean-Marie Lepioufle's avatar
Jean-Marie Lepioufle committed
60
}