snowprofilePro: Construct snowprofile object from PRO file

snowprofileProR Documentation

Construct snowprofile object from PRO file

Description

Read .pro files from SNOWPACK model output

Usage

snowprofilePro(
  Filename,
  ProfileDate = NA,
  tz = "UTC",
  remove_soil = TRUE,
  consider_SH_surface = TRUE,
  suppressWarnings = FALSE
)

Arguments

Filename

path to pro file

ProfileDate

read specific profiles from file either by individual date or a vector of dates (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?

consider_SH_surface

boolean switch to read the special PRO field 0514–SH at surface (this will produce NA for many unknown layer properties except gsize, density, hardness, gtype, height)

suppressWarnings

boolean switch

Details

Several SNOWPACK model output formats exist see SNOWPACK documentation

Definitions of PRO files are provided at https://snowpack.slf.ch/doc-release/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 or a snowprofileSet (list of multiple snowprofile objects) depending on whether multiple or single dates are being read. If several ProfileDates are being given, but only one of the dates contains snow, a snowprofileSet of length 1 is returned.

Author(s)

shorton, dmauracher

See Also

snowprofilePrf, scanProfileDates, snowprofileSno

Examples


## 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')

## Read several specific dates and plot
specificDates <- Dates[2:3]
Profiles <- snowprofilePro(Filename, ProfileDate = specificDates)
plot(Profiles)

sarp.snowprofile documentation built on Jan. 14, 2026, 9:06 a.m.