# \donttest{
dir.create(file.path(tempdir(), "EDGARv432"))
folder <- setwd(file.path(tempdir(), "EDGARv432"))
url <- "http://jeodpp.jrc.ec.europa.eu/ftp/jrc-opendata/EDGAR/datasets/v432_AP/NOx"
file <- 'v432_NOx_2012.0.1x0.1.zip'
download.file(paste0(url,'/TOTALS/',file), file)
unzip('v432_NOx_2012.0.1x0.1.zip')
nox <- read(file = dir(pattern = '.nc'),
version = 'EDGAR',
spec = c(E_NO = 0.9 , # 90% of NOx is NO
E_NO2 = 0.1 )) # 10% of NOx is NO2
setwd(folder)
# creating a color scale
cor <- colorRampPalette(colors = c(c("#031057", "#0522FC",
"#7E0AFA", "#EF0AFF",
"#FFA530", "#FFF957")))
raster::plot(nox$E_NO,xlab="Lat", ylab="Lon",
col = cor(12),zlim = c(-6.5e-7,1.4e-5),
main="NO emissions from EDGAR (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