snowprofilePro: Construct snowprofile object from PRO file

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/snowprofilePro.R

Description

Read .pro files from SNOWPACK model output

Usage

1
snowprofilePro(Filename, ProfileDate = NA, tz = "UTC")

Arguments

Filename

path to pro file

ProfileDate

read a single profile from file (default = NA will read all profiles)

tz

time zone (default = 'UTC')

Details

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.

Value

a single snowprofile object of list of multiple snowprofile objects

Author(s)

shorton

See Also

snowprofilePrf, scanProfileDates, snowprofileSno

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## 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')

sarp.snowprofile documentation built on July 25, 2020, 5:06 p.m.