coastalTps | R Documentation |
coastalTps
uses thin-plate spline interpolation to estimate
the effects of coastal buffering of land-temperatures by the sea.
coastalTps(dT, lsw, lsa)
dT |
a coarse-resolution SpatRaster of sea - land temperatures (ºC). |
lsw |
a fine-resolution SpatRaster of coastal exposure upwind, as produced by |
lsa |
a fine-resolution SpatRaster of mean coastal exposure in all directions. |
a fine-resolution SpatRaster of sea - land temperature differences (ºC).
library(terra)
# =========================================
# Calculate land-sea temperature difference
# =========================================
temp <- tas[,,1]
sst <- 10.665
dT <- if_raster(sst - temp, dtm1km)
# ============================
# Obtain coastal exposure data
# ============================
lsw <- landsearatios[,,7] # upwind
lsa <- apply(landsearatios, c(1, 2), mean) # mean, all directions
lsw <- if_raster(lsw, dtm100m)
lsa <- if_raster(lsa, dtm100m)
# ==========================================================
# Calculate coastal effects using thin-plate spline and plot
# ==========================================================
dTf <- coastalTps(dT, lsw, lsa)
par(mfrow = c(2, 1))
plot(sst - dT, main = expression(paste("Temperature ",(~degree~C))))
plot(sst - dTf, main = expression(paste("Temperature ",(~degree~C))))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.