emission_model {gtfs2emis}R Documentation

Emission model

Description

Estimate hot-exhaust emissions of public transport systems. This function must be used together with transport_model.

Usage

emission_model(
  tp_model,
  ef_model,
  fleet_data,
  pollutant,
  reference_year = 2020,
  heightfile = NULL,
  parallel = TRUE,
  ncores = NULL,
  output_path = NULL,
  continue = FALSE,
  quiet = TRUE
)

Arguments

tp_model

sf_linestring object or a character path the to sf_linestring objects. The tp_model is the output from transport_model, or the path in which the output files from the transport_model are saved.

ef_model

character. A string indicating the emission factor model to be used. Options include ef_usa_moves, ef_usa_emfac,ef_europe_emep, ,ef_brazil_cetesb, and ef_brazil_scaled_euro (scale ef_brazil_cetesb() based on ef_scaled_euro()).

fleet_data

data.frame. A data.frame with information the fleet characteristics. The required columns depend on the ef_model selection. See @examples for input.

pollutant

character. Vector with one or more pollutants to be estimated. Example: c("CO", "CO2", "PM10", "NOx"). See the documentation to check which pollutants are available for each emission factor model (ef_usa_moves, ef_usa_emfac, ef_europe_emep, or ef_brazil_cetesb).

reference_year

numeric. Year of reference considered to calculate the emissions inventory. Defaults to 2020. This argument is only required when the ef_model argument is ef_usa_moves or ef_usa_emfac.

heightfile

character or raster data. The raster file with height data, or its filepath, used to estimate emissions considering the effect of street slope. This argument is used only when ef_brazil_scaled_euro or ef_europe_emep are selected. Default is NULL. Details are provided in slope_class_europe_emep.

parallel

logical. Decides whether the function should run in parallel. Defaults is TRUE.

ncores

integer. Number of cores to be used in parallel execution. This argument is ignored if parallel is FALSE. Default (NULL) selects the total number of available cores minus one.

output_path

character. File path where the function output is exported. If NULL (Default), the function returns the output to user.

continue

logical. Argument that can be used only with output_path When TRUE, it skips processing the shape identifiers that were already saved into files. It is useful to continue processing a GTFS file that was stopped for some reason. Default value is FALSE.

quiet

Logical; Display messages from the emissions or emission factor functions. Default is 'TRUE'.

Details

The fleet_data must be a data.frame organized according to the desired ef_model. The required columns is organized as follows (see @examples for real data usage).

Based on the input height data, the function returns the slope class between two consecutive bus stop positions of a LineString Simple Feature (transport model object). The slope is given by the ratio between the height difference and network distance from two consecutive public transport stops. The function classifies the slope into one of the seven categories available on the European Environmental Agency (EEA) database, which is -0.06, -0.04,-0.02, 0.00, 0.02, 0.04, and 0.06. The classifications is described in

Value

A list with emissions estimates or NULL with output files saved locally at output_path.

See Also

Other Core function: transport_model()

Examples


library(gtfstools)

# read GTFS
gtfs_file <- system.file("extdata/bra_cur_gtfs.zip", package = "gtfs2emis")
gtfs <- gtfstools::read_gtfs(gtfs_file) 

# keep a single trip_id to speed up this example
gtfs_small <- gtfstools::filter_by_trip_id(gtfs, trip_id ="4451136")
  
# run transport model
tp_model <- transport_model(gtfs_data = gtfs_small,
                            min_speed = 2,
                            max_speed = 80,
                            new_speed = 20,
                            spatial_resolution = 100,
                            parallel = FALSE)

# Example using Brazilian emission model and fleet
fleet_data_ef_cetesb <- data.frame(veh_type = "BUS_URBAN_D",
                                   model_year = 2010:2019,
                                   fuel = "D",
                                   fleet_composition = rep(0.1,10)
                                   )
                                   
emi_cetesb <- progressr::with_progress(emission_model(
                tp_model = tp_model,
                ef_model = "ef_brazil_cetesb",
                fleet_data = fleet_data_ef_cetesb,
                pollutant = c("CO","PM10","CO2","CH4","NOx")
                ))
                            
# Example using European emission model and fleet
fleet_data_ef_europe <- data.frame(  veh_type = c("Ubus Midi <=15 t",
                                                  "Ubus Std 15 - 18 t",
                                                  "Ubus Artic >18 t")
                                   , euro = c("III","IV","V")
                                   , fuel = rep("D",3)
                                   , tech = c("-","SCR","SCR")
                                   , fleet_composition = c(0.4,0.5,0.1))
                                   
emi_emep <- progressr::with_progress(emission_model(tp_model = tp_model
                          , ef_model = "ef_europe_emep"
                          , fleet_data = fleet_data_ef_europe
                          , pollutant = c("PM10","NOx")))

raster_cur <- system.file("extdata/bra_cur-srtm.tif", package = "gtfs2emis")                           
emi_emep_slope <- progressr::with_progress(emission_model(tp_model = tp_model
                          , ef_model = "ef_europe_emep"
                          , fleet_data = fleet_data_ef_europe
                          , heightfile = raster_cur
                          , pollutant = c("PM10","NOx")))  
                                                  
# Example using US EMFAC emission model and fleet
fleet_data_ef_moves <- data.frame(  veh_type = "BUS_URBAN_D"
                                  , model_year = 2010:2019
                                  , fuel = "D"
                                  , reference_year = 2020
                                  , fleet_composition = rep(0.1,10))
                                  
fleet_data_ef_emfac <- data.frame(  veh_type =  "BUS_URBAN_D"
                                  , model_year = 2010:2019
                                  , fuel = "D"
                                  , reference_year = 2020
                                  , fleet_composition = rep(0.1,10))
                                  
# Example using US MOVES emission model and fleet
emi_moves <- emission_model(tp_model = tp_model
                          , ef_model = "ef_usa_moves"
                          , fleet_data = fleet_data_ef_moves
                          , pollutant = c("CO","PM10","CO2","CH4","NOx")
                          , reference_year = 2020)
                          
emi_emfac <- emission_model(tp_model = tp_model
                          , ef_model = "ef_usa_emfac"
                          , fleet_data = fleet_data_ef_emfac
                          , pollutant = c("CO","PM10","CO2","CH4","NOx")
                          , reference_year = 2020)


[Package gtfs2emis version 0.1.0 Index]