API Docs for: 0.0.1
Show:

Profile Class

Defined in: lib/profile.js:33
Module: niviz

A Snow Profile.

Constructor

Profile

()

Defined in lib/profile.js:33

Methods

add

(
  • type
  • layers
)
chainable

Defined in lib/profile.js:354

Add feature values to this profile.

Parameters:

  • type String

    feature type

  • layers Array

    values for each layer

addfeature

(
  • type
)
chainable

Defined in lib/profile.js:332

Add a feature without layers

Parameters:

addlayer

(
  • type
  • values
)
chainable

Defined in lib/profile.js:447

Add a layer to one of the features present

Parameters:

adjust

() chainable

Defined in lib/profile.js:385

Adjust top and bottom value by looping through all features

atheight

(
  • [height]
  • [fromtop]
)
Number

Defined in lib/features.js:309

Retrieve value at certain depth/height of snowpack layer

Parameters:

  • [height] Number optional

    depth or height of the desired layer

  • [fromtop] Boolean optional

    true if height is to be interpreted as depth

Returns:

Number:

The value of the desired layer or null

average

() Number

Defined in lib/features.js:289

Calculate average of the values of all layers, weighting according to layer thickness.

Returns:

Number:

The average value over all layers or undefined if not available

concat

(
  • values
)
chainable

Defined in lib/features.js:449

Adds a list of layer values.

Parameters:

editlayer

(
  • i
  • values
)
chainable

Defined in lib/features.js:249

Edit a certain layer

Parameters:

editlayer

(
  • type
  • i
  • values
)
chainable

Defined in lib/profile.js:503

Edit a layer of one of the features present

Parameters:

has

(
  • feature
)
Boolean

Defined in lib/profile.js:553

Whether or not the profile has the given feature.

Parameters:

Returns:

index

(
  • top
)
Int

Defined in lib/features.js:464

Find layer closest to height passed in cm

Parameters:

  • top Float

    in cm

Returns:

Int:

Index of closest layer

layerflags

(
  • UNKNOWN
  • UNKNOWN
  • UNKNOWN
)
Object static

Defined in lib/profile.js:99

Calculate the yellow flags within a layer, given the hand hardness, grainsize and grainshape values.

Parameters:

  • UNKNOWN Hardness
  • UNKNOWN Grainsize
  • UNKNOWN Grainshape

Returns:

Object:

An object containing the layer flags and the grainsize average

layerheight

() Number

Defined in lib/features.js:277

Returns:

Number:

The sum of all layer heights

push

(
  • top
  • [value]
  • [bottom]
)
chainable

Defined in lib/features.js:341

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!

Parameters:

  • top Number,Object,Array

    or top/value/bottom object

  • [value] Object optional
  • [bottom] Number optional

register

(
  • type
  • definition
)
static chainable

Defined in lib/features.js:117

Registers a feature definition. A definition should contain a name, a symbol and, optionally, a Constructor function to create new values.

Parameters:

rmfeature

(
  • type
  • ielement
)
chainable

Defined in lib/profile.js:422

Delete certain Feature from a present FeatureSet

Parameters:

rmlayer

(
  • i
)
chainable

Defined in lib/features.js:233

Delete a certain layer

Parameters:

rmlayer

(
  • type
  • i
)
chainable

Defined in lib/profile.js:471

Delete a layer of one of the features present

Parameters:

showsoil

(
  • enable
)
chainable

Defined in lib/features.js:421

Toggle whether to expose all layers or just the ones above the ground, i. e. with a top value > 0.

Parameters:

  • enable Boolean

    true = expose all layers, false = hide soil layers

showsoil

(
  • enable
)
chainable

Defined in lib/profile.js:532

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 Boolean

    true = expose all layers, false = hide soil layers

sort

() chainable

Defined in lib/features.js:403

Sorts the layers according to top

Properties

bottom

Number

Defined in lib/features.js:181

bottom

Number

bottom

Number

Defined in lib/profile.js:55

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

Defined in lib/profile.js:40

definition

Object

Defined in lib/features.js:139

definition

Object

elements

Array

The features stack. Primary features should be at index 0

features

Array

Defined in lib/profile.js:78

A list of all avaialable features for this profile. The list is updated automatically when adding features using the .add method.

flags

Feature

Defined in lib/profile.js:209

Accessor to the yellow flags feature, which is calculated on the fly

gradient

Feature

Defined in lib/profile.js:270

Accessor to the temperature gradient feature, which is calculated on the fly

height

Number

Defined in lib/features.js:198

height

Number

height

Number

Defined in lib/profile.js:142

The height of the snow profile.

hs

Number

Defined in lib/profile.js:152

Snow height is the total snow height or 0 if snow height is unknown

info

Object

Defined in lib/features.js:79

Observations and metadata regarding this profile, such as comments, type of profile, method of measurement

info

Object

info

Object

Defined in lib/profile.js:65

Observations and metadata regarding this profile, such as comments, sky conditions, air temperature, etc.

layers

Array

Defined in lib/features.js:54

The features value stack. Values are assumed to be stacked from the bottom to top.

layers

Array

The values stack. Legacy compatibility

max

Number

Defined in lib/features.js:63

Max numeric value. Managed by .push.

meta

Object

Defined in lib/features.js:211

All relevant metadata in one object

meta

Object

Defined in lib/profile.js:303

Collect all relevant metadata in one object

min

Number

Defined in lib/features.js:71

Min numeric value. Managed by .push.

name

String

Defined in lib/features.js:147

name

String

profile

Profile

Defined in lib/features.js:39

Reference to the profile, this is necessary because some features need to have access to dynamic properties such as snow height

stability

Array.

Defined in lib/profile.js:187

Accessor for the stability features: CT, ECT, RB, SF and Saw.

stratigraphic

Array.

Defined in lib/profile.js:91

All features that make up the stratigraphic features

swe

Number

Defined in lib/profile.js:168

Snow water equivalent calculated by: SWE [mm] = Snow Depth [m] * Density [kg / m³]

symbol

String

Defined in lib/features.js:155

symbol

String

Defined in lib/features.js:163

symbol

String

symbol

String

top

Number

Defined in lib/features.js:171

top

Number

top

Number

Defined in lib/profile.js:46

The height at the top of the topmost layer in the profile, measured from the ground.

type

String

Defined in lib/features.js:48

type

Object static

Defined in lib/features.js:98

type

String

type

Object static

types

Array static

Defined in lib/features.js:107