This function calculates the movement of a single fire per step
time
indexes. It collects hot spots per step
time indexes, then
takes the mean or median of the longitude and latitude as the centre of the
fire.
Arguments
- result
spotoroo
object. A result of a call tohotspot_cluster()
.- cluster
Integer. The membership label of the cluster.
- step
Integer (>0). Step size used in the calculation of the fire movement.
- method
Character. Either "mean" or "median", method of the calculation of the centre of the fire.
Value
A data.frame. The fire movement.
membership
: Membership labels.lon
: Longitude of the centre of the fire.lat
: Latitude of the centre of the fire.timeID
: Time indexes.obsTime
: Observed time (approximated).ignition
: Whether or not it is a ignition point.
Examples
# \donttest{
# Time consuming functions (>5 seconds)
# Get clustering results
result <- hotspot_cluster(hotspots,
lon = "lon",
lat = "lat",
obsTime = "obsTime",
activeTime = 24,
adjDist = 3000,
minPts = 4,
minTime = 3,
ignitionCenter = "mean",
timeUnit = "h",
timeStep = 1)
#>
#> ──────────────────────────────── SPOTOROO 0.1.6 ────────────────────────────────
#>
#> ── Calling Core Function : `hotspot_cluster()` ──
#>
#> ── "1" time index = 1 hour
#> ✔ Transform observed time → time indexes
#> ℹ 970 time indexes found
#>
#> ── activeTime = 24 time indexes | adjDist = 3000 meters
#> ✔ Cluster
#> ℹ 16 clusters found (including noise)
#>
#> ── minPts = 4 hot spots | minTime = 3 time indexes
#> ✔ Handle noise
#> ℹ 6 clusters left
#> ℹ noise proportion : 0.935 %
#>
#> ── ignitionCenter = "mean"
#> ✔ Compute ignition points for clusters
#> ℹ average hot spots : 176.7
#> ℹ average duration : 131.9 hours
#>
#> ── Time taken = 0 mins 1 sec for 1070 hot spots
#> ℹ 0.001 secs per hot spot
#>
#> ────────────────────────────────────────────────────────────────────────────────
# Get fire movement of the first cluster
mov1 <- get_fire_mov(result, cluster = 1, step = 3, method = "mean")
mov1
#> membership lon lat timeID obsTime ignition
#> 1 1 149.3000 -37.77000 1 2019-12-29 13:10:00 TRUE
#> 2 1 149.3067 -37.77778 4 2019-12-29 17:00:00 FALSE
#> 3 1 149.3133 -37.77333 7 2019-12-29 19:20:00 FALSE
#> 4 1 149.3100 -37.77000 10 2019-12-29 22:50:00 FALSE
#> 5 1 149.2900 -37.77000 24 2019-12-30 12:40:00 FALSE
#> 6 1 149.2867 -37.75333 42 2019-12-31 06:50:00 FALSE
#> 7 1 149.2850 -37.75249 45 2019-12-31 09:10:00 FALSE
#> 8 1 149.2800 -37.74999 48 2019-12-31 12:40:00 FALSE
#> 9 1 149.2800 -37.74999 51 2019-12-31 15:50:00 FALSE
#> 10 1 149.2800 -37.75199 54 2019-12-31 18:10:00 FALSE
#> 11 1 149.2733 -37.76666 65 2020-01-01 05:50:00 FALSE
#> 12 1 149.2767 -37.75500 68 2020-01-01 09:00:00 FALSE
#> 13 1 149.2767 -37.74999 71 2020-01-01 12:00:00 FALSE
#> 14 1 149.2800 -37.74999 74 2020-01-01 14:50:00 FALSE
#> 15 1 149.2800 -37.74500 77 2020-01-01 17:20:00 FALSE
#> 16 1 149.2720 -37.74800 87 2020-01-02 03:20:00 FALSE
#> 17 1 149.2627 -37.75181 90 2020-01-02 07:00:00 FALSE
#> 18 1 149.2588 -37.74823 93 2020-01-02 10:00:00 FALSE
#> 19 1 149.2617 -37.74333 97 2020-01-02 14:00:00 FALSE
#> 20 1 149.2625 -37.75249 113 2020-01-03 05:40:00 FALSE
#> 21 1 149.2400 -37.75999 116 2020-01-03 08:50:00 FALSE
# Get fire movement of the second cluster
mov2 <- get_fire_mov(result, cluster = 2, step = 6, method = "median")
mov2
#> membership lon lat timeID obsTime ignition
#> 1 2 146.72 -36.84 229 2020-01-08 01:40:00 TRUE
#> 2 2 146.72 -36.84 235 2020-01-08 08:00:00 FALSE
#> 3 2 146.72 -36.82 241 2020-01-08 14:00:00 FALSE
#> 4 2 146.72 -36.82 254 2020-01-09 03:00:00 FALSE
#> 5 2 146.72 -36.80 260 2020-01-09 08:20:00 FALSE
#> 6 2 146.72 -36.84 282 2020-01-10 06:10:00 FALSE
#> 7 2 146.76 -36.86 304 2020-01-11 05:00:00 FALSE
#> 8 2 146.76 -36.86 310 2020-01-11 11:00:00 FALSE
#> 9 2 146.78 -36.90 327 2020-01-12 04:00:00 FALSE
#> 10 2 146.78 -36.90 334 2020-01-12 10:10:00 FALSE
#> 11 2 146.78 -36.89 359 2020-01-13 11:30:00 FALSE
#> 12 2 146.82 -36.86 377 2020-01-14 06:00:00 FALSE
# }