View source: R/snowprofilePro.R
snowprofilePro | R Documentation |
Read .pro files from SNOWPACK model output
snowprofilePro(
Filename,
ProfileDate = NA,
tz = "UTC",
remove_soil = TRUE,
suppressWarnings = FALSE
)
Filename |
path to pro file |
ProfileDate |
read a single profile from file (default = NA will read all profiles) |
tz |
time zone (default = 'UTC') |
remove_soil |
if soil layers are present in PRO file, remove them from snowprofile objects? |
suppressWarnings |
boolean switch |
Several SNOWPACK model output formats exist see SNOWPACK documentation
Definitions of PRO files are provided at https://models.slf.ch/docserver/snowpack/html/pro_format.html and an example file is available at niViz
PRO files typically contain profiles from the same station at multiple time steps. If a specific ProfileDate
is provided a single snowprofile object is returned (search available dates with scanProfileDates
), otherwise all profiles are read and a list of snowprofile objects is returned.
a single snowprofile object of list of multiple snowprofile objects
shorton
snowprofilePrf, scanProfileDates, snowprofileSno
## Path to example pro file
Filename <- system.file('extdata', 'example.pro', package = 'sarp.snowprofile')
## Download example pro file from niViz
#Filename <- tempfile(fileext = '.pro')
#download.file('https://niviz.org/resources/example.pro', Filename)
## Scan dates in file
Dates <- scanProfileDates(Filename)
print(Dates)
## Read a single profile by date and plot
ProfileDate <- Dates[3]
Profile <- snowprofilePro(Filename, ProfileDate = ProfileDate)
plot(Profile)
## Read entire time series and plot
Profiles <- snowprofilePro(Filename)
plot(Profiles, main = 'Timeseries read from example.pro')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.