View source: R/assignDatetags.R
| assignDatetags | R Documentation |
This routine assigns each layer of simulated snow profiles to precomputed datetags. Conceptually, each datetag represents a date when the surface layers get buried by new snow. To assign layers to datetags, the routine chooses the closest datetag that is older than the layer formation date. This routine needs precomputed datetags, which are currently computed based on precipitation patterns by functions in other packages. Once layers are assigned to datetags, layers from different locations or times can easily be grouped by their datetags.
assignDatetags(
x,
potentialDatetags,
vdate = NULL,
adjust_bdates = FALSE,
computeBDate = TRUE,
checkMonotonicity = ifelse(computeBDate, TRUE, FALSE),
...
)
## S3 method for class 'snowprofileSet'
assignDatetags(
x,
potentialDatetags,
vdate = NULL,
adjust_bdates = FALSE,
computeBDate = TRUE,
checkMonotonicity = ifelse(computeBDate, TRUE, FALSE),
...
)
## S3 method for class 'snowprofile'
assignDatetags(
x,
potentialDatetags,
vdate = NULL,
adjust_bdates = FALSE,
computeBDate = TRUE,
checkMonotonicity = ifelse(computeBDate, TRUE, FALSE),
...
)
## S3 method for class 'snowprofileLayers'
assignDatetags(
x,
potentialDatetags,
vdate,
adjust_bdates = FALSE,
computeBDate = TRUE,
checkMonotonicity = ifelse(computeBDate, TRUE, FALSE),
...
)
x |
a snowprofileSet, snowprofile or snowprofileLayers object |
potentialDatetags |
a character or Date array of all potential datetags of the season. This array is currently provided by
|
vdate |
date when the profile and layer information is valid (i.e., |
adjust_bdates |
boolean switch to compute bdates that are more similar to human interpretation. Deprecated and not recommeneded, see Details. |
computeBDate |
compute burial dates ( |
checkMonotonicity |
check ascending order of layers. This acts as a check for whether multiple layers objects are stacked, which is not allowed. |
... |
passed on to subsequent methods |
As a side effect and to issue warnings when layers might not be assigned to meaningful datetags,
the routine also computes the exact burial dates (bdates) of layers, which is the ddate of the overlying layer.
For snowpack simulations with thin layer
resolution, this approach yields very similar ddates and bdates for most layers, since most layers form and
instantly get buried by another layer of the same storm. Before implementing the aforementioned approach of pre-computing datetags
based on weather patterns, this routine attempted to make bdates more similar to human interpretation by adjusting
bdates, so that (similar) layers with the same ddate (i.e., same storm) inherit the same bdate
(similar means: identical gtype & hardness). This feature is still available by setting adjust_bdates to TRUE, which is not
recommended, though.
The input object will be returned with the columns datetag and bdate added to the profile layers
assignDatetags(snowprofileSet): for snowprofileSets
assignDatetags(snowprofile): for snowprofiles
assignDatetags(snowprofileLayers): for snowprofileLayers
fherla
deriveBDate, guessDatetagsSimple
## TODO: create a meaningful example!
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.