snowprofilePrf: Construct snowprofile object from PRF file

View source: R/snowprofilePrf.R

snowprofilePrfR Documentation

Construct snowprofile object from PRF file

Description

Read .prf files from SNOWPACK model output

Usage

snowprofilePrf(Filename, ProfileDate = NA, tz = "UTC")

Arguments

Filename

path to prf 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 PRF files are provided at https://models.slf.ch/docserver/snowpack/html/prf_format.html

PRF 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

snowprofilePro, scanProfileDates, snowprofileSno

Examples


## Path to example prf file
Filename <- system.file('extdata', 'example.prf', package = 'sarp.snowprofile')

## Scan dates in file
Dates <- scanProfileDates(Filename)
print(Dates)

## Read a single profile by date and plot
ProfileDate <- Dates[3]
Profile <- snowprofilePrf(Filename, ProfileDate = ProfileDate)
plot(Profile)

## Read entire time series and plot
Profiles <- snowprofilePrf(Filename)
plot(Profiles, main = 'Timeseries read from example.prf')


sarp.snowprofile documentation built on March 31, 2023, 5:17 p.m.