Get evaporative stress index (ESI) from SERVIR Global
via ClimateSERV API Client. ESI is available every four
(or twelve) weeks from 2001 to present.
The dataset may contain cloudy data which is returned as NA
s.
ClimateSERV works with geojson of type 'Polygon'. The input object
is
then transformed into polygons with a small buffer area around the point.
get_esi(object, dates, operation = 5, period = 1, ...) # S3 method for default get_esi(object, dates, operation = 5, period = 1, ...) # S3 method for sf get_esi(object, dates, operation = 5, period = 1, as.sf = FALSE, ...) # S3 method for geojson get_esi(object, dates, operation = 5, period = 1, as.geojson = FALSE, ...)
object | input, an object of class |
---|---|
dates | a character of start and end dates in that order in the format "YYYY-MM-DD" |
operation | optional, an integer that represents which type of statistical operation to perform on the dataset |
period | an integer value for the period of ESI data, four weeks period = 1, twelve weeks = 2 |
... | further arguments passed to |
as.sf | logical, returns an object of class |
as.geojson | logical, returns an object of class |
A data frame of ESI data:
the index for the rows in object
the dates from which ESI was requested
the longitude as provided in object
the latitude as provided in object
the ESI value
operation: supported operations are:
operation | value | |
max | = | 0 |
min | = | 1 |
median | = | 2 |
sum | = | 4 |
average | = | 5 (default value) |
dist: numeric, buffer distance for each object
coordinate
nQuadSegs: integer, number of segments per buffer quadrant
get_esi may return some warning messages given by
sf
, please look sf documentation for
possible issues.
ClimateSERV https://climateserv.servirglobal.net
# \donttest{ lonlat <- data.frame(lon = c(-55.0281,-54.9857), lat = c(-2.8094, -2.8756)) dates <- c("2017-12-15","2018-06-20") # by default the function set a very small buffer around the points # which can return NAs due to cloudiness in ESI data dt <- get_esi(lonlat, dates = dates)#># the argument dist passed through sf increase the buffer area dt <- get_esi(lonlat, dates = dates, dist = 0.1)#># }