fied.ghgrp package¶
Submodules¶
fied.ghgrp.calc_GHGRP_AA module¶
Created on Wed Aug 30 09:52:53 2017
@author: cmcmilla
- class subpartAA(aa_ff, aa_sl, std_efs)[source]¶
Bases:
object
- calc_energy_ff()[source]¶
Calculate MMBtu value based on reported CO2 emissions. Does not capture emissions and energy from facilities using Tier 4 calculation methodology.
fied.ghgrp.calc_GHGRP_energy module¶
fied.ghgrp.get_GHGRP_data module¶
- requests_retry_session(retries=3, backoff_factor=0.7, status_forcelist=[500, 502, 504], session=None)[source]¶
- get_count(table_url)[source]¶
Get the number of rows for a specified GHGRP table (via url) from EPA Envirofacts.
- get_records(table_url, start_end)[source]¶
Get specified rows for a specified GHGRP table (via url) from EPA Envirofacts.
- get_GHGRP_records(reporting_year, table, rows=None, api_row_max=1000)[source]¶
Return GHGRP data using EPA RESTful API based on specified reporting year and table. Tables of interest are C_FUEL_LEVEL_INFORMATION, D_FUEL_LEVEL_INFORMATION, c_configuration_level_info, and V_GHG_EMITTER_FACILITIES. Optional argument to specify number of table rows.
- Parameters:
reporting_year (int) – Reporting year of GHGRP data
table (str) – Name of GHGRP Envirofacts table to retrieve records from
rows (int; default=None) – Number of table rows to retrieve, beginning at row 0.
api_row_max (int; default={1000}) – Maximum number of table rows to return at a time. Envirofacts API for the GHGRP seems to be overwhelmed by > 1000 rows.
- Returns:
ghgrp – DataFrame of GHGRP Envirofacts data.
- Return type:
pandas.DataFrame
fied.ghgrp.ghg_tiers module¶
fied.ghgrp.ghgrp_fac_unit module¶
- class GHGRP_unit_char(ghgrp_energy_file, reporting_year)[source]¶
Bases:
object
- load_fueltype_dict()[source]¶
Opens and loads a yaml that specifies the mapping of GHGRP fuel types to standard fuel types that have aready been applied to NEI data.
- Returns:
fuel_dict – Dictionary of mappings between GHGRP fuel types and generic fuel types that have been applied to NEI data.
- Return type:
dictionary
- harmonize_fuel_type(ghgrp_unit_data, fuel_type_column)[source]¶
Applies fuel type mapping to fuel types reported under GHGRP.
- Parameters:
ghgrp_unit_data (pandas.DataFrame)
fuel_type_column (str) – Name of column containing fuel types.
- Returns:
ghgrp_unit_data
- Return type:
pandas.DataFrame
- download_unit_data()[source]¶
Download and unzip GHGRP unit data.
- Returns:
file_path – File path of unit data spreadsheet.
- Return type:
- get_unit_capacity(ghgrp_df)[source]¶
Retrieve unit capacity data from EPA GHGRP data file.
- Parameters:
ghgrp_df (pandas.DataFrame) – Dataframe from GHGRP energy calculations with UNIT_TYPE column updated from OCS to a specific unit type.
- Returns:
unit_capacity – Dataframe with unit capacity information by Facility ID and unit name.
- Return type:
pandas.DataFrame
- format_ghgrp_df(ghgrp_df)[source]¶
Formatting (e.g., dropping columns, aggregating fuel types) for GHGRP energy estimates, which now include unit capacity data.