-
Notifications
You must be signed in to change notification settings - Fork 0
/
analysis_metrics.R
executable file
·32 lines (19 loc) · 1.05 KB
/
analysis_metrics.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: TopoCliF
# Script purpose: Deriving metrics
# Date: Mo Mar 19, 2019
# Author: Arne Thiemann
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ---- General metrics ----
# Detailed definitions are documented in the README.
index$m_area_absolute_glacier[i] <- nrow(temp_ras_data) * prod(res(temp_ras))
index$m_elevation_min[i] <- minValue(temp_ras[["elev_absolute"]])
index$m_elevation_max[i] <- maxValue(temp_ras[["elev_absolute"]])
index$m_elevation_range[i] <- maxValue(temp_ras[["elev_absolute"]]) -
minValue(temp_ras[["elev_absolute"]])
index$m_elevation_mean[i] <- cellStats(temp_ras[["elev_absolute"]], "mean")
index$m_elevation_sd[i] <- cellStats(temp_ras[["elev_absolute"]], "sd")
index$m_ela_calculated[i] <- ela_calculated
index$m_glacier_skewness[i] <- e1071::skewness(temp_ras_data$elev_absolute, type = 3)
# ---- Plateau detection-derived metrics ----
# Plateau metrics are retrieved in `analysis_pleateaus.R` within two loops.