Range Class
A range of snow profiles.
Constructor
Range
-
[profiles]
-
[height]
Parameters:
-
[profiles]
Arrayoptional an existing profiles array to use
-
[height]
Number optionalinitial height
Item Index
Methods
avgstep
-
profile
Calculate the average timestep of the range.
Parameters:
-
profile
Profile
Returns:
The average timestep in minutes
duration
-
The
Calculate the duration of the range.
Parameters:
-
The
Unitmoment unit to use (default: hours)
Returns:
The duration in the unit specified
index
-
date
Get the closest index for the given date.
Parameters:
-
date
Moment
Returns:
Number
insert
-
profile
Inserts a profile to the range and updates the range's height. NOTE: In case there is already a profile present with the same date, the profile to be inserted is ignored.
Parameters:
-
profile
Profile
matches
-
from
-
[to]
Whether or not the range matches the passed-in interval exactly.
Parameters:
-
from
Array, Moment -
[to]
Moment optionalto
Returns:
max
-
prop
Get maximal value for a certain property present in the profiles.
Parameters:
-
prop
StringProperty name
Returns:
merge
-
range
Merge two range objects by adding the profiles of the object passed.
Parameters:
-
range
Range
push
-
profile
Adds a profile to the range and updates the range's height.
Parameters:
-
profile
Profile
range
-
from
-
to
Get a sub range of profiles by index or by dates.
Note: The new range object will share profile references with the current range!
Parameters:
-
from
Number, Momentindex or date
-
to
Number, Momentindex or date
Returns:
Range
showsoil
-
enable
Toggle whether to expose all layers of all profiles 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
updateFeatures
()
chainable
If the station profiles receive an update, this function needs to be called in order to update the features array
Properties
bottom
Number
The height at the bottom of the lowest layer of all the profile, measured from the ground.