atmoschem / EmissV

Compare 25dc1ad ... +0 ... ac46e9a

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.


@@ -6,8 +6,6 @@
Loading
6 6
#' @return Matrix or raster
7 7
#'
8 8
#' @param file file name or names (variables are summed)
9 -
#' @param coef coefficients to merge different sources (file) into one emission
10 -
#' @param spec numeric speciation vector to split emission into different species
11 9
#' @param version Character; One of  of the following:
12 10
#' \tabular{lllll}{
13 11
#'   \strong{argument}\tab \strong{tested}\tab \strong{region}\tab \strong{resolution}\tab \strong{projection}\cr
@@ -18,6 +16,8 @@
Loading
18 16
#'   MACCITY\tab 2010 \tab Global \tab 0.5 x 0.5 °  \tab  longlat\cr
19 17
#'   VULCAN\tab 3.0 \tab US \tab 1 x 1 Km \tab  lcc\cr
20 18
#'}
19 +
#' @param coef coefficients to merge different sources (file) into one emission
20 +
#' @param spec numeric speciation vector to split emission into different species
21 21
#' @param month the desired month of the inventory (only for MACCITY)
22 22
#' @param year scenario index (only for GAINS)
23 23
#' @param categories considered categories (for MACCITY/GAINS variable names), empty for use all
@@ -65,33 +65,28 @@
Loading
65 65
#' folder <- setwd(file.path(tempdir(), "EDGARv432"))
66 66
#'
67 67
#' url <- "http://jeodpp.jrc.ec.europa.eu/ftp/jrc-opendata/EDGAR/datasets/v432_AP/NOx"
68 -
#' file1 <- 'v432_NOx_2012_IPCC_1A1a.0.1x0.1.zip'
69 -
#' file2 <- 'v432_NOx_2012_IPCC_1A2.0.1x0.1.zip'
70 -
#' file3 <- 'v432_NOx_2012_IPCC_1A3b.0.1x0.1.zip'
68 +
#' file <- 'v432_NOx_2012.0.1x0.1.zip'
71 69
#'
72 -
#' download.file(paste0(url,'/ENE/',file1), file1)
73 -
#' download.file(paste0(url,'/IND/',file2), file2)
74 -
#' download.file(paste0(url,'/TRO/',file3), file3)
70 +
#' download.file(paste0(url,'/TOTALS/',file), file)
75 71
#'
76 -
#' unzip('v432_NOx_2012_IPCC_1A1a.0.1x0.1.zip')
77 -
#' unzip('v432_NOx_2012_IPCC_1A2.0.1x0.1.zip')
78 -
#' unzip('v432_NOx_2012_IPCC_1A3b.0.1x0.1.zip')
72 +
#' unzip('v432_NOx_2012.0.1x0.1.zip')
79 73
#'
80 -
#' nox    <- read(file = dir(pattern = '.nc'),version = 'EDGAR')
74 +
#' nox  <- read(file    = dir(pattern = '.nc'),
75 +
#'              version = 'EDGAR',
76 +
#'              spec    = c(E_NO  = 0.9 ,   # 90% of NOx is NO
77 +
#'                          E_NO2 = 0.1 ))  # 10% of NOx is NO2
81 78
#' setwd(folder)
82 79
#'
83 -
#' sp::spplot(nox, scales = list(draw=TRUE), xlab="Lat", ylab="Lon",main="NOx emissions from EDGAR")
80 +
#' sp::spplot(nox$E_NO, scales = list(draw=TRUE),
81 +
#'            xlab="Lat", ylab="Lon",
82 +
#'            main="NO emissions from EDGAR (in g / m2 s)")
84 83
#'
85 -
#' d1     <- gridInfo(paste(system.file("extdata", package = "EmissV"),"/wrfinput_d01",sep=""))
86 -
#' d2     <- gridInfo(paste(system.file("extdata", package = "EmissV"),"/wrfinput_d02",sep=""))
87 -
#' nox_d1 <- rasterSource(nox,d1)
88 -
#' nox_d2 <- rasterSource(nox,d2)
89 -
#' image(nox_d1, axe = FALSE, main = "NOx emissions from transport-energy-industry for d1 (2012)")
90 -
#' image(nox_d2, axe = FALSE, main = "NOx emissions from transport-energy-industry for d2 (2012)")
84 +
#' d1  <- gridInfo(paste(system.file("extdata", package = "EmissV"),"/wrfinput_d01",sep=""))
85 +
#' NO  <- emission(grid = d1, inventory = nox$E_NO, pol = "NO", mm = 30.01, plot = TRUE)
91 86
#'}
92 87
93 -
read <- function(file = file.choose(), coef = rep(1,length(file)), spec = NULL,
94 -
                 version = NA, month = 1, year = 1, categories,
88 +
read <- function(file = file.choose(), version = NA, coef = rep(1,length(file)),
89 +
                 spec = NULL, month = 1, year = 1, categories,
95 90
                 as_raster = TRUE, skip_missing = FALSE, verbose = TRUE){
96 91
97 92
  if(is.na(version)){                 # nocov start

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
R 100.00%
Project Totals (13 files) 100.00%
Loading