get_n_events: Extract n rainfall events

Description Usage Arguments

View source: R/get_n_events.R

Description

This is a very inefficient way to extract a number of rainfall events for each landslide. It is inefficient because it checkes for each month if the number of rainfall events already exceeds the specified number. If not, it will start from the beginning again... Some landslides will have more events than specified, because landslides from the same dates are grouped in order to only load the rasters once into memory. And extraction of rainfall values is done for each landslide on that day until the last landslide exceeeds the specified number of rainfal events

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
get_n_events(
  point.data = NULL,
  n_dry = NULL,
  daily_threshold = NULL,
  n.events = NULL,
  ncores = 2,
  date_col = "date",
  id_col = "PIFF_ID",
  save = F,
  savePath = "/dev/null",
  path_rainfall = "/mnt/CEPH_PROJECTS/Proslide/PREC_GRIDS_updated/"
)

Arguments

point.data

sf object of landsldies

n_dry

Number of allowed dry days

daily_threshold

Daily threshold that needs to be exceeded to be considered a rainy day

n.events

how many rainfall events to extract for each landslide

ncores

Number of cores working in parallel

date_col

Character of the column that contains the dates of the landslides

id_col

Character uniquely identifying each landslide

path_rainfall

Character of where the rainfall data is saved


RobinKohrs/rainfallR documentation built on Oct. 3, 2021, 1:42 a.m.