Title: | Calculate and Visualize 'SNOTEL' Snow Data and Seasonality |
---|---|
Description: | Programmatic interface to the 'SNOTEL' snow data (<https://www.nrcs.usda.gov/programs-initiatives/sswsf-snow-survey-and-water-supply-forecasting-program>). Provides easy downloads of snow data into your R work space or a local directory. Additional post-processing routines to extract snow season indexes are provided. |
Authors: | Koen Hufkens [aut, cre] , BlueGreen Labs [cph, fnd] |
Maintainer: | Koen Hufkens <[email protected]> |
License: | AGPL-3 |
Version: | 1.5.2 |
Built: | 2024-11-25 16:37:52 UTC |
Source: | CRAN |
Dowloads snotel data based upon a subset of the sno-tel info as provided by snotel_info()
snotel_download( site_id, network = "sntl", path = tempdir(), metric = TRUE, internal = FALSE )
snotel_download( site_id, network = "sntl", path = tempdir(), metric = TRUE, internal = FALSE )
site_id |
subset of the sites listed by snotel_info() |
network |
network list to query (default = sntl, for SNOTEL) |
path |
where to save downloaded files (default = tempdir()) |
metric |
return metric values, |
internal |
return data to workspace, |
## Not run: # download data for SNOTEL site 429 and 1287, returning data to # the R workspace df <- snotel_download(site_id = c(429,1287), internal = TRUE) # list a few first rows head(df) ## End(Not run)
## Not run: # download data for SNOTEL site 429 and 1287, returning data to # the R workspace df <- snotel_download(site_id = c(429,1287), internal = TRUE) # list a few first rows head(df) ## End(Not run)
Start the SNOTEL shiny interface
snotel_explorer()
snotel_explorer()
# snotel_explorer()
# snotel_explorer()
Downloads a SNOTEL site listing for further processing
snotel_info(network = "sntl", path)
snotel_info(network = "sntl", path)
network |
network list to query (default = sntl, for SNOTEL) |
path |
path where to save the snotel information (site list) |
## Not run: # download the meta-data from the SNOTEL server meta_data <- snotel_info() # show a couple of lines head(meta_data) ## End(Not run)
## Not run: # download the meta-data from the SNOTEL server meta_data <- snotel_info() # show a couple of lines head(meta_data) ## End(Not run)
Data is read from either a snotel data frame and returned as such.
snotel_metric(df)
snotel_metric(df)
df |
snotel data frame |
By default the conversion is done upon download. This function might serve some a purpose in processing of data grabbed straight from the server rather than through the package.
This is an internal function only. Hence, no examples are given.
a data frame with imperial values converted to metric ones
First snow melt, first continuous snow melt, first snow accumulation and continous snow accumulation are reported.
snotel_phenology(df, threshold = 0, offset = 180)
snotel_phenology(df, threshold = 0, offset = 180)
df |
a snotel data file or data frame |
threshold |
threshold for mapping continuous snow cover |
offset |
offset of the year relative to January first (DOY 1) |
Be sure to execute this code on individual sites when loading a combined tidy data frame containing data for multiple sites.
## Not run: # download one of the longer time series df <- snotel_download(site_id = 670, internal = TRUE) # calculate the snow phenology phenology <- snotel_phenology(df) # show a couple of lines head(phenology) ## End(Not run)
## Not run: # download one of the longer time series df <- snotel_download(site_id = 670, internal = TRUE) # calculate the snow phenology phenology <- snotel_phenology(df) # show a couple of lines head(phenology) ## End(Not run)