coastalNCEP | R Documentation |
Calculates coastal effects from NCEP data
coastalNCEP(
landsea,
ncephourly,
steps = 8,
use.raster = T,
zmin = 0,
plot.progress = T,
tidyr = F
)
landsea |
a SpatRaster object with NAs (representing sea) or any non-NA value and a projection system defined. |
ncephourly |
a dataframe of hourly climate data as returned by |
steps |
an optional integer. Coastal effects are calculated in specified directions upwind. Steps defines the total number of directions used. If the default 8 is specified, coastal effects are calculated at 45º intervals. |
use.raster |
an optional logical value indicating whether to mask the output values by |
zmin |
optional assumed sea-level height. Values below this are set to zmin |
plot.progress |
logical value indicating whether to produce plots to track progress. |
tidyr |
logical value indicating whether to download 30m resolution digital elevation data
and use these data to improve the assignment of land and sea pixels in |
coastalNCEP downloads digital elevation and varying resolutions to calculate
coastal effects by applying a variant of invls()
over a greater extent then that specified by landsea, but the resulting outputs are
cropped to the same extent as landsea. Land temperatyres as a function of coastal exposure
and sea-surface temperature data are then calculated. Sea surface temperature data are
automatically downloaded from the NOAA.
a three-dimension array of hourly temperature values for each pixel of landsea
library(terra)
# Download NCEP data
ll <- latlongfromraster(rast(dtm100m))
tme <-as.POSIXlt(c(0:31) * 3600 * 24, origin = "2015-03-15", tz = "GMT")
ncephourly<-hourlyNCEP(NA, ll$lat, ll$long, tme)
aout <- coastalNCEP(rast(dtm100m), ncephourly)
# Calculate mean temperature and convert to raster
mtemp <- if_raster(apply(aout, c(1, 2), mean), dtm100m)
plot(mtemp, main = "Mean temperature")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.