Giter Club home page Giter Club logo

emissv's People

Contributors

edzer avatar ibarraespinosa avatar schuch666 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

emissv's Issues

Issues with the upcoming release of units 0.8-0

Dear maintainer,

We are preparing units 0.8-0 for release in approximately a month. I'm writing to you because our revdep checks report new issues in your package with this new version (you can check them here).

These issues seem to be caused by references to the old interface to install units (this or this, deprecated since 0.7-0 in favor of the new and more intuitive interface), which may cause a mere WARNING if CRAN checks find a reference to a non-exported object, or an ERROR if some part of the package or the tests use them.

To address this, if you wish to maintain compatibility with units < 0.7-0, I suggest the approach taken in the constants package, as you can see here, to avoid direct references to non-exported objects. Otherwise, you can just substitute the old interface with the new interface and depend on units >= 0.7-0.

Restructure and extend README

(part of openjournals/joss-reviews#662)

I suggest to restructure the README file to better align with the required sections:

# EmissV

statement of need, in plain language

## Installation

### System dependencies

Ubuntu, Fedora, ...

### Package installation

devtools::...

## Using `EmissV`

[R code chunk]

## ...

[add info about contribution, code of conduct, reporting bugs, seeking support, ...]

## License

...

  • Can you provide installation instructions for Windows? The Appveyor build works, so I assume a Windows installation is possible. Possibly just mention that no specific steps are needed.
  • Regarding the "needed packages"
    • This list will at some point be out of sync with your DESCRIPTION file, which is "Good" according to the reviewer guidelines already. I suggest to only list packages here that you actually provide information about, like how/why you import them, what they are needed for - and only if it is not obvious (like sp and raster for geospatial data)
    • "The dependency of the packages spatsts, maptools and sp will be removed son." This is potentially confusing if you do not provide motivation. I suggest to remove this from README and instead create an issue stating that these packages should be removed any why.
  • For the Example, I suggest you switch to using a README.Rmd file to generate the README.md with a R code based example, see http://usethis.r-lib.org/reference/use_readme_rmd.html
  • Meta-Information related to Community guidelines are missing, check the ROpenSci GitHub org for examples (such as https://github.com/ropensci/nomisr#meta)

Units

use the package 'units' for all variables

sample.tiff missing

I get an error with this line, and can't see this file in https://github.com/atmoschem/EmissV/tree/master/inst/extdata

raster <- raster::raster(paste(system.file("extdata", package = "EmissV"),
                                "/sample.tiff",sep=""))
Error in .local(.Object, ...) : 

Error in .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer",  : 
  Cannot create a RasterLayer object from this file. (file does not exist)
> sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252   
[3] LC_MONETARY=English_Australia.1252 LC_NUMERIC=C                      
[5] LC_TIME=English_Australia.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] EmissV_0.664.5

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.17         compiler_3.5.0       git2r_0.21.0         class_7.3-14        
 [5] tools_3.5.0          ncdf4_1.16           rpart_4.1-13         digest_0.6.15       
 [9] goftest_1.1-1        memoise_1.1.0        nlme_3.1-137         lattice_0.20-35     
[13] mgcv_1.8-23          Matrix_1.2-14        DBI_1.0.0            rgdal_1.2-20        
[17] curl_3.2             spData_0.2.8.3       e1071_1.6-8          spatstat.data_1.2-0 
[21] withr_2.1.2          httr_1.3.1           raster_2.6-7         knitr_1.20          
[25] devtools_1.13.5      spatstat.utils_1.8-0 classInt_0.2-3       grid_3.5.0          
[29] data.table_1.11.2    sf_0.6-4             R6_2.2.2             foreign_0.8-70      
[33] sp_1.2-7             polyclip_1.8-7       tensor_1.5           deldir_0.1-15       
[37] udunits2_0.13        magrittr_1.5         units_0.5-1          maptools_0.9-2      
[41] abind_1.4-5          spatstat_1.55-1 

streetDist problems

This is a brilliant package that we would like to incorporate within our analyses. To do that, we would like to use the streetDist function which does not appear to work in current form. Reproducible code follows:

library (EmissV)
library (osmdata)
library (sf)
city <- "accra"
bb <- getbb (city)
dat <- opq (bbox = city) %>%
    add_osm_feature (key = "highway") %>%
    osmdata_sf (quiet = FALSE) %>%
    osmdata::osm_poly2line () %>%
    magrittr::extract2 ("osm_lines")
#saveRDS (dat, file = "accra-hw.Rds")
utm <- 32630 # for Accra

# Get a raster grid of population density to use for the emission distribution:
url <- paste0 ("https://github.com/ATFutures/who-data/releases/download/",
               "v0.0.2-worldpop-tif-gha-npl/accra.2fpopdens.2fGHA15adj_040213.tif")
download.file (url, "accra-pop.tif", mode = "wb")
ras <- raster::raster ("accra-pop.tif") %>%
    raster::crop (raster::extent (bb)) %>%
    as ("SpatialPolygons") %>%
    st_as_sf ()

#dat <- readRDS (file = "accra-hw.Rds")
dat <- dat [dat$highway %in% c ("motorway", "trunk", "primary",
                                "secondary", "teritary"), ]

s <- streetDist (emission = 1, dist = c (1, 0, 0, 0, 0), grid = ras,
                 osm = dat, epsg = utm)
# Error in fix.by(by.x, x) : 'by' must specify a uniquely valid column
# In addition: Warning message:
# attribute variables are assumed to be spatially constant throughout all geometries

Any help appreciated!


Note also the use of the osmdata package which might be of general use within this package to very easily obtain OSM street networks.

Add importsFrom in streetDist function

EmissV::streetDist should include importFrom in roxygen2 and include sf field in DESCRIPTION in imports. It is better than depending on so many packages.

color palette of EmissV?

por exemplo, EmissV.colors, or algo assim, e que vai criar a tua paleta de cores....

Me envia o RGB

chemical border conditions

Oi @Schuch666

Que tu acha de adicionar aqui, ou no eixport, colocar condições de borde com quimica no wrf_bdy?
A ideia sera ler os dados de um modelo global e mapear os poluentes para o mecanismo quimico, e adicioanr esta informação no netcdf de wrf_bdy. Abs

We need a substitute of anthro_emiss

I believe we need a substitute of anthro_emiss in EmissV. This tool would allow us to merge/speciate EDGAR and other emissions scenarios/data and use eixport::wrf_create to create wrfcheminputs

Clarify documentation

(part of openjournals/joss-reviews#662)

  • ?vehicles
    • tells me it returns "data frame with lines by vehicle category and columns for category, type, Fuel, use and a additional column for each area." - What does the value in the column for each area mean?
    • "diary use" - do you mean "average daily kilometres driven by the vehicle type" ? Recommend to be a bit more verbose here.

read EVERYTHING

Vamos fazer que EmissV leia TODOS os inventarios disponiveis.
Eu vou adicionar uma função para baixar os dados tambem.

Add automated tests

(part of openjournals/joss-reviews#662)

Strongly recommend to use testthat to add tests for the package functionality.
AFAICS the Travis and Appveyor tests only run an installation of the package, but no unit or integration tests. Pointers welcome if I'm wrong!

It is also worth having examples in the docs that actually run (I saw mostly "dontrun" code blocks).

Newer version for lineSource

There is a need of a newer version of lineSource to achieve 2 objectives:

  • Faster and simple: A new version of the code simpler and comprehensive using sf or another faster package, the current version take too long especially to implement tests;
  • To consider a wrf grid using the grid output from EmissV::gridInfo().

totalvocs

Simplify the input EF and the calculations

change the name and add better verbose (better info to user)

Re-check language of examples and comments

(part of openjournals/joss-reviews#662)

It's fun to learn some Portuguese and always refreshing to interact with different languages and cultures. However, for the code examples, I suggest to stick to English terms for clarity.

Translating some source code comments might be more welcoming to non-Portuguese contributors, e.g. https://github.com/atmoschem/EmissV/blob/master/R/plumerise.R

Error with totalEmission()

I was working through paper.md until I got to totalEmission:

TOTAL  <- totalEmission(veiculos,EF,pol = c("CO"),verbose = T)
Error: $ operator is invalid for atomic vectors 
5.
as.character.units(structure(1127549.32468524, units = structure(list(
    numerator = "t", denominator = "year"), .Names = c("numerator", 
"denominator"), class = "symbolic_units"), class = "units")) 
4.
as.character(structure(1127549.32468524, units = structure(list(
    numerator = "t", denominator = "year"), .Names = c("numerator", 
"denominator"), class = "symbolic_units"), class = "units")) 
3.
paste("Total of", pol[i], ":", sum(total_t_y), units::deparse_unit(total_t_y)) 
2.
print(paste("Total of", pol[i], ":", sum(total_t_y), units::deparse_unit(total_t_y))) at totalEmission.R#62
1.
totalEmission(veiculos, EF, pol = c("CO"), verbose = T)
> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 9 (stretch)

Matrix products: default
BLAS/LAPACK: /usr/lib/libopenblasp-r0.2.19.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=C             
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] EmissV_0.664.5

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.17         raster_2.5-8         tensor_1.5           magrittr_1.5        
 [5] maptools_0.9-2       spatstat.utils_1.7-0 units_0.5-1          spatstat_1.52-1     
 [9] lattice_0.20-35      udunits2_0.13        tools_3.4.1          grid_3.4.1          
[13] data.table_1.10.4    nlme_3.1-131         mgcv_1.8-19          DBI_0.7             
[17] deldir_0.1-14        abind_1.4-5          goftest_1.1-1        sf_0.5-4            
[21] Matrix_1.2-11        rpart_4.1-11         ncdf4_1.16           polyclip_1.6-1      
[25] sp_1.2-5             compiler_3.4.1       foreign_0.8-69      

read()

this function can work wonderfully? need testing

rgdal is retiring soon

Please protect your package from the forthcoming retirement of rgdal: https://r-spatial.org/r/2022/04/12/evolution.html

CMD check on a platform without retiring packages and with _SP_EVOLUTION_STATUS=2 has this log:
00check.log

Condition use of raster on the the availability of rgdal (raster::projectRaster fails if rgdal is not present), or preferably transition from raster to terra at your earliest convenience. terra is a re-implementation of raster but accesses GDAL directly.

EmissV vulnerable to forthcoming changes in sp and rgdal

Running revdep checks for current rgdal on R-Forge - see:

https://stat.ethz.ch/pipermail/r-sig-geo/2019-November/027801.html

shows the errors in the test failures below, related to use of PROJ&/GDAL3
and required changes to sp and rgdal. If useful find a regerence to a docker
image in this thread:

r-spatial/discuss#28

Changes will occur quite fast, and packages need to be prepared.


R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(testthat)
> library(EmissV)
> 
> test_check("EmissV")
using a example emission factor (values calculated from CETESB 2015):
                                      CO            PM
Light Duty Vehicles Gasohol  1.75 [g/km] 0.0013 [g/km]
Light Duty Vehicles Ethanol 10.04 [g/km] 0.0000 [g/km]
Light Duty Vehicles Flex     0.39 [g/km] 0.0010 [g/km]
Diesel Trucks                0.45 [g/km] 0.0612 [g/km]
Diesel Urban Busses          0.77 [g/km] 0.1052 [g/km]
Diesel Intercity Busses      1.48 [g/km] 0.1693 [g/km]
Gasohol Motorcycles          1.61 [g/km] 0.0000 [g/km]
Flex Motorcycles             0.75 [g/km] 0.0000 [g/km]
Emission factors:
                                      CO            PM
Light Duty Vehicles Gasohol  1.75 [g/km] 0.0013 [g/km]
Light Duty Vehicles Ethanol 10.04 [g/km] 0.0000 [g/km]
Light Duty Vehicles Flex     0.39 [g/km] 0.0010 [g/km]
Diesel Trucks                0.45 [g/km] 0.0612 [g/km]
Diesel Urban Busses          0.77 [g/km] 0.1052 [g/km]
Diesel Intercity Busses      1.48 [g/km] 0.1693 [g/km]
Gasohol Motorcycles          1.61 [g/km] 0.0000 [g/km]
Flex Motorcycles             0.75 [g/km] 0.0000 [g/km]
processing area ... 
Grid information from: /home/rsb/topics/packages/rgdal/deps_ng/EmissV.Rcheck/EmissV/extdata/wrfinput_d01 
fraction of area inside the domain = 0.955761973247402
── 1. Failure: emissions with source by area (@test-areaSource.R#4)  ───────────
areaSource(...) not equal to readRDS("data01.Rds").
Attributes: < Component "crs": Attributes: < Names: 1 string mismatch > >
Attributes: < Component "crs": Attributes: < Length mismatch: comparison on first 2 components > >
Attributes: < Component "crs": Attributes: < Component 2: 1 string mismatch > >

processing Chururuba area ... 
Grid information from: /home/rsb/topics/packages/rgdal/deps_ng/EmissV.Rcheck/EmissV/extdata/wrfinput_d01 
fraction of Chururuba area inside the domain = 0.955761973247402
processing Juruzinha area ... 
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
using a example emission factor (values calculated from CETESB 2015):
Total of CO : 1676996.43578795 t year-1 
FISH not found in total !
FISH not found in total !
calculating emissions for CO as aerosol ...
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
using a example emission factor (values calculated from CETESB 2015):
Total of CO : 1676996.43578795 t year-1 
Grid information from: /home/rsb/topics/packages/rgdal/deps_ng/EmissV.Rcheck/EmissV/extdata/wrfinput_d01 
Grid information from: /home/rsb/topics/packages/rgdal/deps_ng/EmissV.Rcheck/EmissV/extdata/wrfinput_d01 
calculating emissions for CO using molar mass = 28 ...
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
using a example emission factor (values calculated from CETESB 2015):
Grid information from: /home/rsb/topics/packages/rgdal/deps_ng/EmissV.Rcheck/EmissV/extdata/wrfinput_d01 
reading emi_co (EDGAR) output unit is g m-2 s-1 ...
from edgar_co_test.nc x 1.00 
Using raster from inventory ...
Grid output: 99 columns 93 rows
reading emi_co (EDGAR) output unit is g m-2 s-1 ...
from edgar_co_test.nc x 1.00 
Using raster from inventory ...
Grid output: 99 columns 93 rows
Grid information from: vertical.nc 
Grid information from: /home/rsb/topics/packages/rgdal/deps_ng/EmissV.Rcheck/EmissV/extdata/wrfinput_d03 
using length as emission variable
Number of lat points 51
Number of lon points 51
using length as emission variable
Number of lat points 51
Number of lon points 51
convective, h/L = -5.7372346528973 
using weil max= 31 
convective, h/L = -8.61326442721792 
strong convective, h/L = -16.3733115022513 
using weil max= 155 
strong convective, h/L = -33.003300330033 
using weil max= 217 
strong convective, h/L = -67.7966101694915 
strong convective, h/L = -79.3650793650794 
strong convective, h/L = -110.650069156293 
strong convective, h/L = -32.0056899004267 
stable, h/L = 200 - calm, U= 0.11 m/s 
stable, h/L = 200 - windy, U= 3.11 m/s 
neutral, h/L = 0.956937799043062 
* max iterations reached! 
Grid information from: vertical.nc 
Layer limits for grid position lat= -23.5803346633911 lon= -44.9668502807617 
  height= 0.00 m k= 1 
  height= 59.74 m k= 2 
  height= 145.50 m k= 3 
  height= 257.90 m k= 4 
  height= 397.87 m k= 5 
  height= 575.59 m k= 6 
  height= 802.06 m k= 7 
  height= 1070.66 m k= 8 
  height= 1532.39 m k= 9 
  height= 2014.39 m k= 10 
  height= 2519.01 m k= 11 
  height= 3049.04 m k= 12 
  height= 4035.38 m k= 13 
  height= 5020.68 m k= 14 
  height= 6005.89 m k= 15 
  height= 6992.68 m k= 16 
  height= 7982.44 m k= 17 
  height= 8976.27 m k= 18 
  height= 9968.42 m k= 19 
  height= 10957.52 m k= 20 
  height= 11941.38 m k= 21 
  height= 12920.99 m k= 22 
  height= 13908.15 m k= 23 
  height= 14879.66 m k= 24 
  height= 15842.59 m k= 25 
  height= 16803.16 m k= 26 
  height= 17760.40 m k= 27 
  height= 18715.93 m k= 28 
  height= 19676.74 m k= 29 
  height= 20649.44 m k= 30 
Emission heigh between 59.74 m and 145.50 m at k= 2 for z= 100
Layer limits for grid position lat= -23.5803346633911 lon= -44.9668502807617 
  height= 0.00 m k= 1 
  height= 59.74 m k= 2 
  height= 145.50 m k= 3 
  height= 257.90 m k= 4 
  height= 397.87 m k= 5 
  height= 575.59 m k= 6 
  height= 802.06 m k= 7 
  height= 1070.66 m k= 8 
  height= 1532.39 m k= 9 
  height= 2014.39 m k= 10 
  height= 2519.01 m k= 11 
  height= 3049.04 m k= 12 
  height= 4035.38 m k= 13 
  height= 5020.68 m k= 14 
  height= 6005.89 m k= 15 
  height= 6992.68 m k= 16 
  height= 7982.44 m k= 17 
  height= 8976.27 m k= 18 
  height= 9968.42 m k= 19 
  height= 10957.52 m k= 20 
  height= 11941.38 m k= 21 
  height= 12920.99 m k= 22 
  height= 13908.15 m k= 23 
  height= 14879.66 m k= 24 
  height= 15842.59 m k= 25 
  height= 16803.16 m k= 26 
  height= 17760.40 m k= 27 
  height= 18715.93 m k= 28 
  height= 19676.74 m k= 29 
  height= 20649.44 m k= 30 
Emission heigh between 802.06 m and 1070.66 m at k= 7 for z= 1000
Layer limits for grid position lat= -23.5196027755737 lon= -44.9668502807617 
  height= 0.00 m k= 1 
  height= 59.81 m k= 2 
  height= 145.61 m k= 3 
  height= 257.97 m k= 4 
  height= 397.90 m k= 5 
  height= 575.53 m k= 6 
  height= 801.97 m k= 7 
  height= 1070.70 m k= 8 
  height= 1532.64 m k= 9 
  height= 2014.67 m k= 10 
  height= 2519.25 m k= 11 
  height= 3049.28 m k= 12 
  height= 4035.69 m k= 13 
  height= 5020.84 m k= 14 
  height= 6005.95 m k= 15 
  height= 6993.00 m k= 16 
  height= 7982.73 m k= 17 
  height= 8976.44 m k= 18 
  height= 9968.59 m k= 19 
  height= 10957.95 m k= 20 
  height= 11942.11 m k= 21 
  height= 12921.73 m k= 22 
  height= 13908.66 m k= 23 
  height= 14880.00 m k= 24 
  height= 15842.81 m k= 25 
  height= 16803.23 m k= 26 
  height= 17760.21 m k= 27 
  height= 18715.41 m k= 28 
  height= 19675.99 m k= 29 
  height= 20648.63 m k= 30 
Emission heigh between 575.53 m and 801.97 m at k= 6 for z= 666
Grid information from: /home/rsb/topics/packages/rgdal/deps_ng/EmissV.Rcheck/EmissV/extdata/wrfinput_d01 
grid position lat= -22.010806627171 lon= -46.0152584808041 
grid position lat= -22.010806627171 lon= -47.9944115841027 
grid position lat= -23.4723500487625 lon= -47.0048350324534 
Grid information from: vertical.nc 
Grid output: 4 columns 4 rows 30 levels
Grid information from: vertical.nc 
Grid output: 4 columns 4 rows 30 levels
reading emi_co (EDGAR) output unit is g m-2 s-1 ...
from edgar_co_test.nc x 1.00 
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
                             Category   Type Fuel        Use       SP      RJ
Light Duty Vehicles Gasohol   LDV_E25    LDV  E25  41 [km/d] 11624342 2712343
Light Duty Vehicles Ethanol  LDV_E100    LDV E100  41 [km/d]   874627  204079
Light Duty Vehicles Flex        LDV_F    LDV FLEX  41 [km/d]  9845022 2297169
Diesel Trucks               TRUCKS_B5 TRUCKS   B5 110 [km/d]   710634  165814
Diesel Urban Busses           CBUS_B5    BUS   B5 165 [km/d]   792630  184947
Diesel Intercity Busses       MBUS_B5    BUS   B5 165 [km/d]    21865    5101
Gasohol Motorcycles          MOTO_E25   MOTO  E25 140 [km/d]  3227921  753180
Flex Motorcycles               MOTO_F   MOTO FLEX 140 [km/d]   235056   54846
                                 MG      PR      SC
Light Duty Vehicles Gasohol 4371228 3036828 2029599
Light Duty Vehicles Ethanol  328895  228494  152709
Light Duty Vehicles Flex    3702131 2571986 1718932
Diesel Trucks                267227  185651  124076
Diesel Urban Busses          298061  207072  138392
Diesel Intercity Busses        8222    5712    3817
Gasohol Motorcycles         1213830  843285  563592
Flex Motorcycles              88390   61407   41040
using a example emission factor (values calculated from CETESB 2015):
                                      CO            PM
Light Duty Vehicles Gasohol  1.75 [g/km] 0.0013 [g/km]
Light Duty Vehicles Ethanol 10.04 [g/km] 0.0000 [g/km]
Light Duty Vehicles Flex     0.39 [g/km] 0.0010 [g/km]
Diesel Trucks                0.45 [g/km] 0.0612 [g/km]
Diesel Urban Busses          0.77 [g/km] 0.1052 [g/km]
Diesel Intercity Busses      1.48 [g/km] 0.1693 [g/km]
Gasohol Motorcycles          1.61 [g/km] 0.0000 [g/km]
Flex Motorcycles             0.75 [g/km] 0.0000 [g/km]
Total of PM : 15071.8124616163 t year-1 
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
using a example emission factor (values calculated from CETESB 2015):
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
using a example emission factor (values calculated from CETESB 2015):
FISH not found in emission factor!
The emissions factors contains:
CO
 PM
function totalVOC will be discontinued in the next versions
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
Total COV: 2703251.58732021 t year-1 
xyl 262330984930.355 MOL year-1 
function totalVOC will be discontinued in the next versions
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
a is not in suported COV speciation
The specie list contains:
eth hc3 hc5 hc8 ol2 olt oli iso tol xyl ket ch3oh ald 
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
                             Category   Type Fuel        Use       SP      RJ
Light Duty Vehicles Gasohol   LDV_E25    LDV  E25  41 [km/d] 11624342 2712343
Light Duty Vehicles Ethanol  LDV_E100    LDV E100  41 [km/d]   874627  204079
Light Duty Vehicles Flex        LDV_F    LDV FLEX  41 [km/d]  9845022 2297169
Diesel Trucks               TRUCKS_B5 TRUCKS   B5 110 [km/d]   710634  165814
Diesel Urban Busses           CBUS_B5    BUS   B5 165 [km/d]   792630  184947
Diesel Intercity Busses       MBUS_B5    BUS   B5 165 [km/d]    21865    5101
Gasohol Motorcycles          MOTO_E25   MOTO  E25 140 [km/d]  3227921  753180
Flex Motorcycles               MOTO_F   MOTO FLEX 140 [km/d]   235056   54846
                                 MG      PR      SC
Light Duty Vehicles Gasohol 4371228 3036828 2029599
Light Duty Vehicles Ethanol  328895  228494  152709
Light Duty Vehicles Flex    3702131 2571986 1718932
Diesel Trucks                267227  185651  124076
Diesel Urban Busses          298061  207072  138392
Diesel Intercity Busses        8222    5712    3817
Gasohol Motorcycles         1213830  843285  563592
Flex Motorcycles              88390   61407   41040
vehicles:
  Category Type Fuel       Use       SP
1       B5  LDV   NA 41 [km/d] 27332097
══ testthat results  ═══════════════════════════════════════════════════════════
[ OK: 21 | SKIPPED: 0 | WARNINGS: 72 | FAILED: 1 ]
1. Failure: emissions with source by area (@test-areaSource.R#4) 

Error: testthat unit tests failed
Execution halted

dependencies of lineSource function

This function cause dependencies of 2 r-packages: spatsts, maptools and uses sp

The package sf can be used to speed-up this function and make the package less dependent

upcoming package units causes errors in EmissV

I'm planning a new units submission to CRAN in about a week; it will break EmissV as of now.

Could you please look into this:

edzer@gin-edzer:/tmp/rdeps$ cat rdepends_EmissV.Rcheck/00check.log 
* using log directory/tmp/rdeps/EmissV.Rcheck* using R version 3.5.1 (2018-07-02)
* using platform: x86_64-pc-linux-gnu (64-bit)
* using session charset: UTF-8
* using option--no-vignettes* checking for fileEmissV/DESCRIPTION... OK
* this is packageEmissVversion0.664.7* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether packageEmissVcan be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking contents ofdatadirectory ... OK
* checking data for non-ASCII characters ... OK
* checking data for ASCII and uncompressed saves ... OK
* checking examples ... ERROR
Running examples inEmissV-Ex.Rfailed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: emission
> ### Title: Emissions in the format for atmospheric models
> ### Aliases: emission
> 
> ### ** Examples
> 
> veiculos <- vehicles(example = TRUE)
using a example of vehicles (DETRAN 2016 data and SP vahicle distribution):
                             Category   Type Fuel        Use       SP      RJ
Light Duty Vehicles Gasohol   LDV_E25    LDV  E25  41 [km/d] 11624342 2712343
Light Duty Vehicles Ethanol  LDV_E100    LDV E100  41 [km/d]   874627  204079
Light Duty Vehicles Flex        LDV_F    LDV FLEX  41 [km/d]  9845022 2297169
Diesel Trucks               TRUCKS_B5 TRUCKS   B5 110 [km/d]   710634  165814
Diesel Urban Busses           CBUS_B5    BUS   B5 165 [km/d]   792630  184947
Diesel Intercity Busses       MBUS_B5    BUS   B5 165 [km/d]    21865    5101
Gasohol Motorcycles          MOTO_E25   MOTO  E25 140 [km/d]  3227921  753180
Flex Motorcycles               MOTO_F   MOTO FLEX 140 [km/d]   235056   54846
                                 MG      PR      SC
Light Duty Vehicles Gasohol 4371228 3036828 2029599
Light Duty Vehicles Ethanol  328895  228494  152709
Light Duty Vehicles Flex    3702131 2571986 1718932
Diesel Trucks                267227  185651  124076
Diesel Urban Busses          298061  207072  138392
Diesel Intercity Busses        8222    5712    3817
Gasohol Motorcycles         1213830  843285  563592
Flex Motorcycles              88390   61407   41040
> 
> EmissionFactors <- emissionFactor(example = TRUE)
using a example emission factor (values calculated from CETESB 2015):
                                      CO            PM
Light Duty Vehicles Gasohol  1.75 [g/km] 0.0013 [g/km]
Light Duty Vehicles Ethanol 10.04 [g/km] 0.0000 [g/km]
Light Duty Vehicles Flex     0.39 [g/km] 0.0010 [g/km]
Diesel Trucks                0.45 [g/km] 0.0612 [g/km]
Diesel Urban Busses          0.77 [g/km] 0.1052 [g/km]
Diesel Intercity Busses      1.48 [g/km] 0.1693 [g/km]
Gasohol Motorcycles          1.61 [g/km] 0.0000 [g/km]
Flex Motorcycles             0.75 [g/km] 0.0000 [g/km]
> 
> TOTAL  <- totalEmission(veiculos,EmissionFactors,pol = c("CO"),verbose = TRUE)
Total of CO : 1676996.43578795 t year-1 
> 
> grid   <- gridInfo(paste0(system.file("extdata", package = "EmissV"),"/wrfinput_d01"))
Grid information from: /tmp/rdeps/EmissV.Rcheck/EmissV/extdata/wrfinput_d01 
> shape  <- raster::shapefile(paste0(system.file("extdata", package = "EmissV"),"/BR.shp"))
> raster <- raster::raster(paste0(system.file("extdata", package = "EmissV"),"/dmsp.tiff"))
> 
> SP     <- areaSource(shape[22,1],raster,grid,name = "SP")
processing SP area ... fraction of SP area inside the domain = 0.955761973247402> RJ     <- areaSource(shape[17,1],raster,grid,name = "RJ")
processing RJ area ... fraction of RJ area inside the domain = 0.748007015306122> 
> e_CO   <- emission(TOTAL,"CO",list(SP = SP, RJ = RJ),grid,mm=28)
calculating emissions for CO using molar mass = 28 ...
Error in R_ut_remove_unit(name) : unknown unit name or symbol
Calls: emission -> remove_symbolic_unit -> R_ut_remove_unit
Execution halted
* checking for unstated dependencies intests... OK
* checking tests ... ERROR
  Runningtestthat.RRunning the tests intests/testthat.Rfailed.
Last 13 lines of output:
  Light Duty Vehicles Flex    3702131 2571986 1718932
  Diesel Trucks                267227  185651  124076
  Diesel Urban Busses          298061  207072  138392
  Diesel Intercity Busses        8222    5712    3817
  Gasohol Motorcycles         1213830  843285  563592
  Flex Motorcycles              88390   61407   41040
  vehicles:
    Category Type Fuel       Use       SP
  1       B5  LDV   NA 41 [km/d] 27332097
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 18 SKIPPED: 0 FAILED: 1
  1. Error: final emission works (@test-emission.R#21) 
  
  Error: testthat unit tests failed
  Execution halted
* checking PDF version of manual ... OK
* DONE
Status: 2 ERRORs

Add profiles

Topdown emissions needs temporal profiles for distributing the emissions. They must be based on traffic, emissions and experiments. This profiles could be stored in a list.

e.g.:
data(profiles)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.