chooseICavg {sarp.snowprofile.alignment}R Documentation

Get index of appropriate initial condition average profile

Description

To average a set of snow profiles, dbaSP requires a snow profile as initial condition (IC) to start the algorithm. To prevent persistent weak layers (PWLs) and crusts from being averaged-out during the call to dbaSP, it is advised to start the algorithm with a best-guess IC. This best guess IC contains a large number of PWLs and crusts to ensure that the most prevalent ones actually make their way into the final average profile. This function helps to choose meaningful IC profiles. See Details or (better) the source code for how this function picks the profiles.

Usage

chooseICavg(
  set,
  n,
  classifyPWLs,
  classifyCRs,
  nPWL = round((2 * n/3) + 0.001),
  sm = summary(set)
)

Arguments

set

a snowprofileSet

n

number of profile indices to be picked (i.e., returned)

classifyPWLs

an argument list for a function call to sarp.snowprofile::findPWL which returns relevant PWLs for identifying initial conditions

classifyCRs

an argument list for a function call to sarp.snowprofile::findPWL which returns relevant CR(ust)s for identifying initial conditions

nPWL

number of profile indices to be picked from profiles that have many PWLs in many different vertical levels; an analogous nCR will be the difference n - nPWL.

sm

a (precomputed) summary of the set

Details

This function first computes how many PWLs and how many crusts are in the profiles that have a close to median total snow height HS. Each of these profile is then divided into several vertical levels (by numberOfPWLsPerVerticalLevel). nPWL and nCR profiles are then randomly picked from the profiles that have PWLs or CR in most vertical levels and additionally have a rather large number of PWLs/CR overall. The larger n, the more profiles with decreasing number of PWLs/CR in different levels are also returned. Note that this function is best applied to large profile sets to obtain semi-random results. For small sets, the indices returned can actually be deterministic since the pool of relevant profiles is too small.

Value

n number of indices that correspond to profiles in the set

Author(s)

fherla

See Also

sarp.snowprofile::findPWL, averageSP

Examples

plot(SPgroup, SortMethod = "unsorted", TopDown = TRUE,
     xticklabels = "originalIndices", main = "entire profile set")
IC_ids_pwl <- chooseICavg(SPgroup, n = 4, nPWL = 4,
                          classifyPWLs = list(pwl_gtype = c("SH", "DH")),
                          classifyCRs = NULL)
plot(SPgroup[IC_ids_pwl], SortMethod = "unsorted", hardnessResidual = 0, TopDown = TRUE,
     xticklabels = IC_ids_pwl, main = "sample of profiles with rather many and distributed PWLs")


[Package sarp.snowprofile.alignment version 1.2.2 Index]