This function calculates the Urban Heat Island (UHI) intensity based on air temperature measurements and Local Climate Zones (LCZ). More details: https://bymaxanjos.github.io/LCZ4r/articles/Introd_local_LCZ4r.html
Usage
lcz_uhi_intensity(
x,
data_frame = "",
var = "",
station_id = "",
...,
time.freq = "hour",
extract.method = "simple",
method = "LCZ",
Turban = NULL,
Trural = NULL,
by = NULL,
impute = NULL,
group = FALSE,
iplot = TRUE,
isave = FALSE,
save_extension = "png",
ylab = "Air temperature [C]",
xlab = "Time",
ylab2 = "UHI",
title = "",
caption = "LCZ4r,2024"
)
Arguments
- x
A
SpatRaster
object containing the LCZ map. The LCZ map can be obtained using thelcz_get_map()
function.- data_frame
A data frame containing air temperature measurements and station IDs. The data frame should have a date field in hourly or higher resolution format.
- var
The name of the variable in the data frame representing air temperature.
- station_id
The name of the variable in the data frame representing station IDs.
- ...
Additional arguments for the
selectByDate
function from theopenair
package. These arguments allow for flexible selection of specific time periods (year, month, day, hour). Examples of how to use these arguments include:Year(s): Numeric value(s) specifying the year(s) to select. For example,
year = 1998:2004
selects all years between 1998 and 2004 (inclusive), whileyear = c(1998, 2004)
selects only the years 1998 and 2004.Month(s): Numeric or character value(s) specifying the months to select. Numeric examples:
month = 1:6
(January to June), or character examples:month = c("January", "December")
.Day(s): Numeric value(s) specifying the days to select. For instance,
day = 1:30
selects days from 1 to 30, orday = 15
selects only the 15th day of the month.Hour(s): Numeric value(s) specifying the hours to select. For example,
hour = 0:23
selects all hours in a day, whilehour = 9
selects only the 9th hour.Start date: A string specifying the start date in either start="DD/MM/YYYY" (e.g., "1/2/1999") or "YYYY-mm-dd" format (e.g., "1999-02-01").
End date: A string specifying the start date in either end="DD/MM/YYYY" (e.g., "1/2/1999") or "YYYY-mm-dd" format (e.g., "1999-02-01").
- time.freq
The time period to average to. Default is “hour”, but can also be “day”, “week”, “month”, or “year”.
- extract.method
A character string specifying the method used to assign the LCZ class to each station point. The default is
"simple"
. Available methods are:simple: Assigns the LCZ class based on the value of the raster cell in which the point falls. It often is used in low-density observational network.
two.step: Assigns LCZs to stations while filtering out those located in heterogeneous LCZ areas. This method requires that at least 80% of the pixels within a 5 × 5 kernel match the LCZ of the center pixel (Daniel et al., 2017). Note that this method reduces the number of stations. It often is used in ultra and high-density observational network, especially in LCZ classes with multiple stations.
bilinear: Interpolates the LCZ class values from the four nearest raster cells surrounding the point.
- method
Method to calculate the UHI intensity. Options include: LCZ and manual. The LCZ method automatically identifies the LCZ build types, starting from LCZ 1 and progressing to LCZ 10, to represent the urban temperature, then it starts from LCZ natural LCZ (11-16) to represent the rural temperature. The manual method is a character string indicating the stations as references for the urban and rural areas.
- Turban
Urban station references, if the method "manual" is selected.
- Trural
Rural station references, if the method "manual" is selected.
- by
The time-series split option. Options include “year”, “season”, “seasonyear”, “month”, “monthyear”, “weekday”, “weekend”, “site”, “daylight”, or “dst” (daylight saving time). See the
type
argument in theopenair
package: https://bookdown.org/david_carslaw/openair/sections/intro/openair-package.html#the-type-option.- impute
Method to impute missing values. Options include “mean”, “median”, “knn”, or “bag”.
- group
If TRUE urban, rural and UHI - related temperatures are grouped in the same plot.
- iplot
Set to
TRUE
to return a plot. IfFALSE
, a data frame is returned.- isave
Set to
TRUE
to save all results (plot, time-series, station references) into your directory.- save_extension
A character string indicating the file format for saving the plot. Options include: “png”, “jpg”, “jpeg”, “tif”, “pdf”, “svg”. The default is “png”.
- ylab
The label for the y-axis.
- xlab
The label for the x-axis. Default is “Time”.
- ylab2
The label for the right y-axis.
- title
The title of the plot. Default is an empty string.
- caption
The source data caption.
See also
See the documentation for lcz_get_map()
to obtain an LCZ map.
Author
Max Anjos (https://github.com/ByMaxAnjos)