# \donttest{
folder <- file.path(tempdir(), "EDGARv8.1")
dir.create(folder)
url <- "https://jeodpp.jrc.ec.europa.eu/ftp/jrc-opendata/EDGAR/datasets"
dataset <- "v81_FT2022_AP_new/NOx/TOTALS/flx_nc"
file <- "v8.1_FT2022_AP_NOx_2022_TOTALS_flx_nc.zip"
download.file(paste0(url,"/",dataset,"/",file), paste0(folder,"/",file))
unzip(paste0(folder,"/",file),exdir = folder)
nox <- read(file = dir(path=folder, pattern="flx\\.nc", full.names=TRUE),
version = "EDGARv8",
spec = c(E_NO = 0.9 , # 90% of NOx is NO
E_NO2 = 0.1 )) # 10% of NOx is NO2
# creating a color scale
cor <- colorRampPalette(colors = c(c("#031057", "#0522FC",
"#7E0AFA", "#EF0AFF",
"#FFA530", "#FFF957")))
raster::plot(nox$E_NO, xlab="Latitude", ylab="Longitude",
col = cor(12),zlim = c(-6.5e-7,1.4e-5),
main="TOTAL NO emissions from EDGARv8.1 (in g / m2 s)")
d1 <- gridInfo(paste(system.file("extdata", package = "EmissV"),"/wrfinput_d01",sep=""))
NO <- emission(grid = d1, inventory = nox$E_NO, pol = "NO", mm = 30.01,plot = TRUE)
# }
Run the code above in your browser using DataLab