3.2.4. MOVES Post-processing scripts

3.2.4.1. Overview
3.2.4.2. Moves2smkEF.pl
3.2.4.3. gen_8digit_scc.pl

3.2.4.1. Overview

The MOVES Post-processing scripts consist of two Perl scripts. One is called Moves2smkEF.pl which extracts the emissions factor tables from the MOVES databases and converts them into a format that can be used as SMOKE inputs. The second script, called gen_8digit_scc.pl, produces a file mapping 8-digit SCCs to 10-digit SCCs used when importing activity data in Smkinven.

3.2.4.2. Moves2smkEF.pl

3.2.4.2.1. Description

The MOVES post-processor script Moves2smkEF.pl extracts the emission factor tables from the MOVES databases (RPD, RPV, RPP, and RPH MOVES formatted Lookup tables) and converts them into a format that can be processed using Movesmrg.

  1. Create a new field for 'countyID'

    None of the MOVES lookup tables contain a countyID field solely dedicated to a state-county FIPS code, but SMOKE needs this information. For this reason, Moves2smkEF.pl creates a county field by extracting it from other fields that include county codes as part of their value. The RPD table has a linkID field that contains countyID in the leading five digits followed by more numbers to allow for future implementation of link modeling. The RPV table has a zoneID field that is countyID with a trailing zero. The RPP table has a TemperatureProfileID field, which also leads with countyID and is trailed by other numbers to indicate month and other identification. The RPH table has a linkID field the same as the RPD table. The postprocessing script parses countyID from linkID, zoneID and TemperatureProfileID and stores it as a separate field.

  2. Map MOVES pollutantID to output pollutant/species name

    The pollutant mapping file has columns for MOVES2014 Pollutant ID, MOVES2014 Pollutant Name, and SMOKE Pollutant/Model Species Name. Moves2smkEF.pl reads this list to determine which MOVES pollutants to output in the emission factor files and what name to use for each pollutant. Because MOVES2014 contains emission factors for both inventory pollutants and model species, the sample pollutant mapping file included with SMOKE uses the _INV suffix to distinguish inventory pollutants from model species.

  3. Cross-tab pollutantID to reduce output table size

    Each of the four MOVES lookup tables contains a pollutantID field, and associated emission rates for each are listed in the ratePerDistance, ratePerVehicle, or ratePerHour field (depending on lookup table). This table structure repeats the leftmost fields (e.g., MOVESRunID, yearID, monthID) for each pollutantID, which greatly increases the total number of rows. The cross-tabbing postprocessing step replaces the column for 'ratePerDistance' (or 'ratePerVehicle' or 'ratePerHour') with additional pollutant-specific columns containing values of emission rates. For example, new field headings would include 'CO_INV', 'NOX', 'BENZENE_INV', etc. Performing this cross-tab on the pollutant emission rates significantly reduces the size of the tables for use by SMOKE.

  4. Aggregate emission factors by fuel type, source type, road type, and/or process type

    To reduce the total number of sources to be processed in SMOKE, Moves2smkEF.pl supports user-specified aggregations of MOVES fuel types, source types, road types, and process types to SCCs.

  5. Apply formulas to calculate additional inventory pollutants or model species

    Formulas can be applied to augment the existing MOVES output pollutants. For example, speciated versions of criteria pollutants are not provided in the MOVES2014 output nor are speciated emission factors for brake and tire wear.

  6. Create final emission rate lookup tables in SMOKE format

    The four postprocessed tables named rateperdistance_smoke, ratepervehicle_smoke, rateperprofile_smoke, and rateperhour_smoke are exported from MySQL into ASCII files for their use in SMOKE.

3.2.4.2.2. Processing Order

Moves2smkEF.pl is run after Runspec_generator.pl, and before any SMOKE processing. The Moves2smkEF.pl is written in Perl, generates SMOKE-ready MOVES lookup tables (i.e., RPD, RPV, RPP, and RPH) by each representative county and fuel month for inputs to Movesmrg.

3.2.4.2.3. Files, Environment Variables and Run Syntax
3.2.4.2.3.1. Input Files
File Name Format Description
rateperdistance
ratepervehicle
rateperprofile
rateperhour
MOVES format Columns in the MOVES Emission Rate Lookup Table are described in Table 2.10, “MOVES Emission Rate Lookup Table (MOVES Format)”.
InputDBList: ASCII List of MySQL database names to process generated by Runspec_generator.pl
PollutantFormulasFile: ASCII List of formulas used to calculate additional emission factors
FuelTypeMappingFile: ASCII List of MOVES fuel type IDs and corresponding aggregated fuel type ID
SourceTypeMappingFile: ASCII List of MOVES source type IDs and corresponding aggregated source type ID
RoadTypeMappingFile: ASCII List of MOVES road type IDs and corresponding aggregated road type ID
ProcessTypeMappingFile: ASCII List of MOVES process type IDs and corresponding aggregated process type ID
PollutantMappingFile: ASCII List of MOVES pollutant IDs and corresponding pollutant name; only listed pollutants will be included in output emission factor tables
3.2.4.2.3.2. Run Command syntax
moves2smkEF.pl [-r RPD|RPV|RPP|RPH] [--formulas PollutantFormulasFile] [--fuel_agg FuelTypeMappingFile] [--src_agg SourceTypeMappingFile] [--road_agg RoadTypeMappingFile] [--proc_agg ProcessTypeMappingFile] InputDBList PollutantMappingFile [OutputPath]
  • RPD|RPP|RPV|RPH - optional type of emission factors to process (rate-per-distance, rate-per-vehicle, rate-per-profile, or rate-per-hour); if not specified, script will process all four types
  • PollutantFormulasFile - list of formulas used to calculate additional emission factors
  • FuelTypeMappingFile - list of MOVES fuel type IDs and corresponding aggregated fuel type ID
  • SourceTypeMappingFile - list of MOVES source type IDs and corresponding aggregated source type ID
  • RoadTypeMappingFile - list of MOVES road type IDs and corresponding aggregated road type ID
  • ProcessTypeMappingFile - list of MOVES process type IDs and corresponding aggregated process type ID
  • InputDBList - list of MySQL database names to process (generated by runspec_generator.pl MOVES preprocessor)
  • PollutantMappingFile - list of MOVES pollutant IDs and corresponding pollutant name
  • OutputPath - optional; overrides the output path specified in InputDBList
3.2.4.2.3.3. Output Files
File Name Format Description
rateperdistance_smoke*.csv ASCII RPD SMOKE formatted lookup table (fuel month specific). The format of MOVES lookup tables are described in Table 2.11, “MOVES Emission Rate Lookup Table (SMOKE Format)”.
ratepervehicle_smoke*.csv ASCII RPV SMOKE formatted lookup table (fuel month specific)
rateperprofile_smoke*.csv ASCII RPP SMOKE formatted lookup table (fuel month specific)
rateperhour_smoke*.csv ASCII RPH SMOKE formatted lookup table (fuel month specific)
mcrlist.rateperdistance*.lst: ASCII list of MOVES-based rateperdistance lookup tables
mcrlist.ratepervehicle*.lst: ASCII list of MOVES-based ratepervehicle lookup tables
mcrlist.rateperprofile*.lst: ASCII list of MOVES-based rateperprofile lookup tables
mcrlist.rateperhour*.lst: ASCII list of MOVES-based rateperhour lookup tables

3.2.4.3. gen_8digit_scc.pl

3.2.4.3.1. Description

The gen_8digit_scc.pl script generates a file mapping 8-digits SCCs to aggregated SCCs produced by Moves2smkEF.pl.

3.2.4.3.2. Processing Order

The Perl script performs the following steps:

  • Connect to the first database listed in the InputDBList file

  • Query the specified database table (rateperdistance, ratepervehicle, rateperprofile, or rateperhour) and generate a list of all SCCs in the MOVES2014 output

  • Apply the fuel type, source type, road type, and process type mappings to generate a list of 10-digit aggregated SCCs

  • Output the list of 10-digit aggregated SCCs with corresponding 8-digit SCC (first 8 digits of 10-digit SCC)

3.2.4.3.3. Files, Environment Variables and Run Syntax
3.2.4.3.3. Files, Environment Variables and Run Syntax
File Name Format Description
FuelTypeMappingFile: ASCII List of MOVES fuel type IDs and corresponding aggregated fuel type ID
SourceTypeMappingFile: ASCII List of MOVES source type IDs and corresponding aggregated source type ID
RoadTypeMappingFile: ASCII List of MOVES road type IDs and corresponding aggregated road type ID
ProcessTypeMappingFile: ASCII List of MOVES process type IDs and corresponding aggregated process type ID
InputDBList: ASCII List of MySQL database names to process generated by Runspec_generator.pl; only the first database listed will be used
3.2.4.3.4. Run Command syntax
gen_8digit_scc.pl -r RPD|RPV|RPP|RPH [--fuel_agg FuelTypeMappingFile] [--src_agg SourceTypeMappingFile] [--road_agg RoadTypeMappingFile] [--proc_agg ProcessTypeMappingFile] InputDBList
  • RPD|RPP|RPV|RPH - emission factor table to query (rateperdistance, ratepervehicle, rateperprofile, or rateperhour)
  • FuelTypeMappingFile - list of MOVES fuel type IDs and corresponding aggregated fuel type ID
  • SourceTypeMappingFile - list of MOVES source type IDs and corresponding aggregated source type ID
  • RoadTypeMappingFile - list of MOVES road type IDs and corresponding aggregated road type ID
  • ProcessTypeMappingFile - list of MOVES process type IDs and corresponding aggregated process type ID
  • InputDBList - list of MySQL database names to process (generated by runspec_generator.pl MOVES preprocessor); only first database listed will be used
3.2.4.3.5. Output Files

gen_8digit_scc.pl outputs a list of 10-digit SCCs and corresponding 8-digit SCCs. Users should direct this output to the file of their choosing.