This vignette creates a link between the methods described in the paper
Herla, F., Haegeli, P., and Mair, P.: A data exploration tool for averaging and accessing large data sets of snow stratigraphy profiles useful for avalanche forecasting, The Cryosphere, 16, 3149–3162, https://doi.org/10.5194/tc-16-3149-2022, 2022.
and this companion R package. While the basic workflow of matching layers between pairs of snow stratigraphy profiles and thereby aligning them is described in the vignette Basic workflow, this vignette describes how larger groups of profiles can be aggregated into a representative summary profile (average profile) and how underlying distributions of layer or profile properties can be queried through the average profile.
library(sarp.snowprofile.alignment)
#> Loading required package: sarp.snowprofile
To demonstrate how useful aggregations and distributions of snow
profiles can be computed with our R package, we use two very simplistic
and brief example data sets of snow profiles: SPgroup2
and
SPspacetime
. While the results of these simplified examples
will not look overly interesting, these examples teach you how to apply
our tools to your own more challenging data sets.
As detailed in the reference paper, this package includes two different averaging algorithms for snow profiles, one that can be applied to any group of profiles (default algorithm) and one that can be applied to seasonal data sets of profiles (timeseries algorithm).
The default averaging algorithm can be accessed conveniently through
the function averageSP
and is implemented exactly as
described in the reference paper. You can also consult the documentation
(?averageSP
) for more details.
## compute the average profile (here with default settings)
<- averageSP(SPgroup2)
avgSP ## plot profile set and resulting average profile
plot(SPgroup2, SortMethod = 'hs', xticklabels = 'originalIndices')
plot(avgSP$avg)
Note: To speed up the computation in this vignette, the above figure was not computed with default settings in the background, but with a limited number of initial conditions. The displayed result might not represent the optimal average profile, so recompute it yourself with the default settings displayed above, or experiment with other settings!
It might be worthwhile to reflect on which layers you consider weak
layers. With the function argument classifyPWLs
you can
make the averaging algorithm consider your perspective on weak layers
and make them more likely to get included in the resulting profile. One
approach (the default) could be to consider all surface/depth hoar
layers as weak layers. Another approach could be to consider all
persistent grain types that have one particular stability index above or
below a certain threshold. Or you can also consider multiple different
stability indices. Make sure to consult the documentation for some more
details and tips.
Since all layers of all individual profiles are matched against the layers of the average profile, we can backtrack each layer of the average profile to obtain all underlying layers that were matched against it. This allows us to compute various layer distributions or profile distributions as visualized in Figure 2 of the reference paper: