warpSP: Warp one snow profile onto another one

Description Usage Arguments Details Value Author(s) Examples

View source: R/warpSP.R

Description

After the DTW alignment of two profiles, the maps between the two profiles can be used to warp one profile onto the other profile. In other words, the layer thicknesses of the warped profile are adjusted to optimally align with the corresponding layers of the other profile.

Usage

1
warpSP(alignment, whom = NA)

Arguments

alignment

DTW alignment object from dtwSP containing the two profiles (i.e., called dtwSP(..., keep.internals = TRUE))

whom

whom to warp? "query" (= "jmin"), "imin", "queryTopDown" (= "jminTopDown"), "iminTopDown", "ref"; if 'NA' the routine determines that itself from the structure of the alignment object. (see Details)

Details

After this procedure, the thickness of some layers can be zero, which leads to the layers disappearing.

This function is automatically called in dtwSP(..., keep.internals = TRUE) to warp the query profile onto the reference profile.

Whom to warp: There exist 8 different options, 4 for warping the query onto the ref and 4 for vice versa. The 4 options for warping the query onto the ref are:

For the other case, warping the ref onto the query, only the equivalent of the first option is implemented.

Value

Returns the input alignment object including the element alignment$queryWarped (or $referenceWarped), which are the warped snow profiles. The class of the alignment object is altered to "dtwSP", but still inherits "dtw".

Author(s)

fherla

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## first align profiles
alignment <- dtwSP(SPpairs$A_modeled, SPpairs$A_manual, open.end = FALSE)

## warp reference profile onto query profile:
refWarped <- warpSP(alignment, whom = "ref")$referenceWarped
opar <- par(no.readonly =TRUE)
par(mfrow = c(1, 2))
plot(alignment$query, main = "query")
plot(refWarped, main = "warped reference")
par(opar)

sarp.snowprofile.alignment documentation built on Dec. 3, 2020, 9:08 a.m.