snowprofileCaaml {sarp.snowprofile}R Documentation

Read a Caaml file into a snowprofile object

Description

Note, that this function only provides a starting point for loading caaml files into R. Currently, caaml files exported from niviz.org, or snowpilot.org should be compatible with this routine. However, this routine only extracts some metadata and some of the most important layer characteristics. While a temperature profile (that is independent from the layers) is extracted, no other variables that can be written into a caaml file are currently being read (such as stability test results, etc).

Usage

snowprofileCaaml(
  caamlFile,
  sourceType = NA,
  readStabilityTests = TRUE,
  validate = TRUE
)

Arguments

caamlFile

'path/to/file.caaml'

sourceType

choose 'manual', 'modeled', 'vstation', 'aggregate' or 'whiteboard'; while this routine has some functionality built in to detect sourceTypes under certain circumstances, it needs to be provided in most cases.

readStabilityTests

boolean (this is still beta version and can throw errors sometimes)

validate

Should the resulting snowprofile object be validated by validate_snowprofile?

Details

Value

snowprofile object

Author(s)

fherla

Examples


## load example caaml file that ships with package:
caamlFile <- system.file('extdata', 'example.caaml', package = 'sarp.snowprofile')

## read caaml file:
profile <- snowprofileCaaml(caamlFile, sourceType = 'vstation')

## other file with slighlty different xml namespace, structure, etc (including stability test):
caamlFile2 <- system.file('extdata', 'example2.caaml', package = 'sarp.snowprofile')
profile2 <- snowprofileCaaml(caamlFile2, sourceType = 'manual')


[Package sarp.snowprofile version 1.3.2 Index]