Dynamic Time Warping can be used to automate the alignment of two snow profiles. We call those two profiles query and reference. A first intermediate step is to compute the alignment maps that link layers in the query profile to layers in the reference profile (drawn in dashed grey lines between the corresponding layers – every line corresponds to one layer). With the aid of those alignment maps, the query profile can be warped and then represented as the warped query. The warped query contains all layer information of the query, but its layers have been stretched and compressed to match the corresponding reference height. In a second step, the alignment maps are exploited to compute a similarity measure between the profiles. This measure is a scalar value, that represents the similarity between the two profiles while taking into account the structural stratigraphy of the snowpack.
Both the alignment maps and the similarity measure serve as the basis for snow profile aggregation and clustering: A group of profiles will be aligned to compute the group’s representative profile, whereas the similarity measure can be used to distinguish between different groups. As the method can be applied to both modeled and human profiles, more application cases can be, e.g. (i) aggregating human observations, (ii) evaluating modeled snowpack summaries against human observations.
- Load profiles (examples provided, or upload your own files: meaningful profile pairs are from the same date, but from different locations, or from the same location, but at different dates)
- Examine the alignment maps, the warped query, the similarity measure, the cost density and the warping path of the profiles using the default configuration
- Play with different settings if necessary: e.g.
- Scale profiles to equal height (default) – counterproductive when the two profiles are from different dates
- Open End alignments for when either the topmost or lowermost layers are different
- Bottom-up alignments for profiles with the same early season meteorological forcing
- Top-down alignments for profiles with a different early season meteorological forcing
- Warping window: do you want to increase the search window for corresponding layers? Contrarily, a warping window of zero (for resampled profiles) corresponds to a rigid lockstep comparison of the layers.
- Local slope constraint: P = 1 corresponds to a local layer stretching/compression limit of a factor of 2; this setting is preferred for overall comparisons between the two profiles (default). P = 10 corresponds to unlimited local stretching and compression; often superior if the question is whether a specific signature layer is apparent in the query profile. Also, this setting is often superior in conjunction with profiles that are not resampled.
- Weights: do you want to base the alignment predominantly on one layer characteristic?
- Add date information to the calculation of the alignment: see special paragraph below.
Checking the date checkbox will allow to configure how strongly the alignment is supposed to be based on the date information in relation to the grain type and hardness information. The choice of those weights is heavily dependent on the profiles at hand: A small spatial scale will allow to use date information alone, as the same meteorological processes are happening at the same time. However, the larger the spatial scale, the more importance may be given to the structural stratigraphy. Additionally to the weights, the date normalization factor needs to be specified: For example, a value of 3 indicates, that two layers that have been formed with a delay of three days, are as different as two grain types that have a similarity of zero. In other words, that factor can be interpreted as the meteorological delay, that is anticipated between the two locations of the profiles.
Also note, that
- not all layers need an associated date in order to use that information. Check out the example Human vs modeled: The uppermost surface hoar layers are wrongly aligned with grain type and hardness information alone. Including the date information (which is only available for that one specific layer – check Label deposition date) yields a correct alignment , if the date information is given enough importance (e.g. 70%).
- aligning profiles from the same location at different dates requires at least a few known layer dates in order to yield meaningful results. An alignment that is purely based on grain type and hardness usually breaks down after a new storm snow undergoes some sort of metamorphosis.
- the similarity measure can not be used to find the best hyperparameter configuration as soon as date information is included in the calculation of the alignment.