-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.R
99 lines (81 loc) · 3.22 KB
/
test.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
rm(list = ls())
library(bcsnowdata)
#bcdata::bcdc_search("snow")
time_start <- Sys.time()
test_3 <- get_aswe_databc(station_id = "3A28P",
get_year = "All",
parameter = "swe",
timestep = "daily")
time <- Sys.time() - time_start
time_start <- Sys.time()
test_3 <- get_aswe_databc(station_id = c("2F05P", "2F08P", "2F18P", "2F19P"),
get_year = "All",
parameter = "swe",
timestep = "daily")
time <- Sys.time() - time_start
time_start <- Sys.time()
test_3 <- get_aswe_databc(station_id = "All",
get_year = "All",
parameter = "swe",
timestep = "hourly")
time <- Sys.time() - time_start
time_start <- Sys.time()
test_4 <- get_aswe_databc(station_id = "All",
get_year = "All",
parameter = "swe",
timestep = "daily")
time <- Sys.time() - time_start
# test over all
# swe - hourly: OK
# swe - daily: OK
# snow_depth - hourly: OK
# snow_depth - daily: OK
# precipitation - hourly: OK
# precipitation: Daily: OK
# temperature- hourly: OK
# "3B26P"
test_multiple <- c("2F05P", "2F08P", "2F18P", "2F19P")
time_start <- Sys.time()
test_4 <- get_aswe_databc(station_id = test_multiple,
get_year = "all",
parameter = "swe",
timestep = "hourly")
time <- Sys.time() - time_start
test <- get_aswe_databc(station_id = snow_auto_location()$LOCATION_ID[31],
get_year = "All",
parameter = "temperature",
timestep = "daily")
test_function <- function(station_id, get_year, parameter, timestep) {
print(paste0(station_id, " I = ", match(station_id, snow_auto_location()$LOCATION_ID)))
get_aswe_databc(station_id, get_year, parameter, timestep)
}
time_start <- Sys.time()
t_all <- lapply(snow_auto_location()$LOCATION_ID, test_function,
get_year = "All",
parameter = "temperature",
timestep = "hourly")
time <- Sys.time() - time_start
time_start <- Sys.time()
manual_test <- get_manual_swe(station_id = snow_manual_location()$LOCATION_ID[1],
get_year = "All",
survey_period = "All")
time <- Sys.time() - time_start
test_function <- function(station_id, get_year, survey_period) {
print(paste0(station_id, " I = ", match(station_id, snow_manual_location()$LOCATION_ID)))
get_manual_swe(station_id, get_year, survey_period)
}
time_start <- Sys.time()
t_all <- lapply(snow_manual_location()$LOCATION_ID, test_function,
get_year = "All",
survey_period = "All")
time <- Sys.time() - time_start
# Test the get data function
test_bchydro_new <- get_snow(id = "2C09Q",
get_year = "All",
parameter = "swe",
timestep = "hourly")
test_BC <- test_bchydro_new$aswe
manual_data <- bcsnowdata::snow_manual_location()
manual_test <- get_manual_swe(station_id = "2C04",
survey_period = "All",
get_year = "All")