-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrun_all_times_series.R
54 lines (45 loc) · 2.22 KB
/
run_all_times_series.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
####################################################################################
############## Running BFAST Spatial ##############
############## contributors: Yelena Finegold, Sabina Rosca ##############
############## Remi d'Annunzio, Erik Lindquist ##############
############## FAO Open Foris SEPAL project ##############
############## yelena.finegold@fao.org | sabina.rosca@wur.nl ##############
############## Script 1: set parameters and run ##############
####################################################################################
####################################################################################
## Last update: 2017/10/31
####################################################################################
## input data for BFAST scripts
# set data directory
data_dir <- '/ram/laura_uganda_safe_TS/' # timeseries directory
# beginning of historical period
historical_year_beg <- 2010
# beginning of monitoring period
monitoring_year_beg <- 2014
# end of monitoring period
monitoring_year_end <- 2018
##############################################
## OPTIONAL SETTING ########
## do you want to use a forest mask? ########
##############################################
# 1 = use a forest mask
# 0 = do not use a forest mask
mask_data <- 0
# set forest mask directory
mask_dir <- "~/runBFAST/example/mask/"
# Forest mask, 1 is forest and 0 is nonforest
# forest mask file name
forestmask_file <- 'sieved_LC_2010_forestmask.tif'
#################################
# Run R scripts
#################################
## if you runBFAST folder is not saved in your home directory, change the file path for these scripts to coorspond where you cloned the scripts
# process input data
source("~/runBFAST/Rscripts/input_data_times_series.R")
# run BFAST with 4 different parameters
# source("~/runBFAST/Rscripts/example_1.R")
source("~/runBFAST/Rscripts/example_2.R")
source("~/runBFAST/Rscripts/example_3.R")
source("~/runBFAST/Rscripts/example_5.R")
# compare reference data from the study area to the magnitude of change
# source("~/BFAST_test/Rscripts/reference_data.R")