Profile Class
A Snow Profile.
Constructor
Profile
()
Item Index
Methods
Methods
add
-
type
-
layers
Add feature values to this profile.
addlayer
-
type
-
values
Add a layer to one of the features present
adjust
()
chainable
Adjust top and bottom value by looping through all features
atheight
-
[height]
-
[fromtop]
Retrieve value at certain depth/height of snowpack layer
Parameters:
Returns:
The value of the desired layer or null
average
()
Number
Calculate average of the values of all layers, weighting according to layer thickness.
Returns:
The average value over all layers or undefined if not available
editlayer
-
i
-
values
Edit a certain layer
editlayer
-
type
-
i
-
values
Edit a layer of one of the features present
has
-
feature
Whether or not the profile has the given feature
.
Parameters:
-
feature
String
Returns:
index
-
top
Find layer closest to height passed in cm
Parameters:
-
top
Floatin cm
Returns:
Index of closest layer
layerflags
-
UNKNOWN
-
UNKNOWN
-
UNKNOWN
Calculate the yellow flags within a layer, given the hand hardness, grainsize and grainshape values.
Parameters:
-
UNKNOWN
Hardness -
UNKNOWN
Grainsize -
UNKNOWN
Grainshape
Returns:
An object containing the layer flags and the grainsize average
push
-
top
-
[value]
-
[bottom]
Adds a new layer value.
Note: This method assumes that layers are pushed in no particular order; it used to assume that layers are pushed either from top to bottom, or bottom to top!
register
-
type
-
definition
Registers a feature definition. A definition should
contain a name
, a symbol
and, optionally, a
Constructor
function to create new values.
rmfeature
-
type
-
ielement
Delete certain Feature from a present FeatureSet
rmlayer
-
type
-
i
Delete a layer of one of the features present
showsoil
-
enable
Toggle whether to expose all layers or just the ones above the ground, i. e. with a top value > 0.
Parameters:
-
enable
Booleantrue = expose all layers, false = hide soil layers
showsoil
-
enable
Toggle whether to expose all layers of all features present or just the ones above the ground, i. e. with a top value > 0.
Parameters:
-
enable
Booleantrue = expose all layers, false = hide soil layers
sort
()
chainable
Sorts the layers according to top
Properties
bottom
Number
The height at the bottom of the lowest layer in the profile, measured from the ground. Not all values have a bottom value, thus initialization with undefined.
date
Moment
features
ArrayA list of all avaialable features for this profile.
The list is updated automatically when adding
features using the .add
method.
flags
Feature
Accessor to the yellow flags feature, which is calculated on the fly
gradient
Feature
Accessor to the temperature gradient feature, which is calculated on the fly
info
Object
Observations and metadata regarding this profile, such as comments, type of profile, method of measurement
info
Object
Observations and metadata regarding this profile, such as comments, sky conditions, air temperature, etc.
profile
Profile
Reference to the profile, this is necessary because some features need to have access to dynamic properties such as snow height
stability
Array.Accessor for the stability features: CT, ECT, RB, SF and Saw.
stratigraphic
Array.All features that make up the stratigraphic features